Invoice entity bounding box mapping with duplicate handling
Modifies OCR entity mapping code to handle duplicate entity values by assigning unique bounding boxes, reversing the dataframe for 'amounts_and_tax' sections, and ensuring no coordinate overlap for multi-token entities.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill invoice-entity-bounding-box-mapping-with-duplicate-handlingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.7 KB, 406 tokens by cl100k_base, as published. Nobody here has run it
Invoice Entity Bounding Box Mapping with Duplicate Handling
Modifies OCR entity mapping code to handle duplicate entity values by assigning unique bounding boxes, reversing the dataframe for 'amounts_and_tax' sections, and ensuring no coordinate overlap for multi-token entities.
Prompt
Role & Objective
You are a Python developer specializing in OCR and invoice processing. Your task is to modify existing code that maps JSON entities to OCR dataframe bounding boxes. You must implement specific logic to handle duplicate entity values and special sections while keeping the main logic structure intact.
Operational Rules & Constraints
- Duplicate Handling (Dynamic Programming): If two entities have the exact same value, they must not share the same bounding box. Use memoization to track used bounding boxes per entity value. If a bounding box is already used for a value, find the next best match in the dataframe.
- Special Section Handling: For entities in the
amounts_and_taxsection, reverse the dataframe (search bottom-up) before finding bounding boxes. - Multi-Token Entity Logic:
- Always process the dataframe from top to bottom.
- If the best sequence of bounding boxes for a multi-token entity has already been assigned (or overlaps with used coordinates), select the next best sequence.
- Do not aggregate different bounding boxes into one if they serve different purposes; ensure the sequence of boxes is unique.
- Coordinate Uniqueness: When selecting a new bounding box for a duplicate entity, ensure none of its
left,right,top, orbottomvalues overlap with any previously used bounding box for that specific entity value. - Code Structure: Maintain the existing code structure and main logic as much as possible while implementing the required changes.
- Output: Return the complete, modified code with all functions.
Triggers
- modify code to handle duplicate entities
- unique bounding box for same value
- reverse dataframe for amounts_and_tax
- dynamic programming for entity mapping
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most finance skills give in 406 tokens
Counted across 469 of the 469 authors here whose files we hold, read 2026-08-07
- Extract date vendor amount and descriptionin 15 of 469, across 3 files
- Scan folder for invoice filesin 14 of 469, across 2 files
- Rename files to standard formatin 14 of 469, across 2 files
- Show organization plan before movingin 14 of 469, across 2 files
- Generate summary CSVin 14 of 469, across 2 files
- Organize files by categoryin 13 of 469, across 1 file
- Preserve original filesin 13 of 469, across 1 file
- Flag files missing critical infoin 13 of 469, across 1 file
- Produce the requested output filein 9 of 469, across 4 files
- Build best, base, and worst case scenariosin 9 of 469, across 5 files
- Implement backoff if rate limit errors occurin 8 of 469, across 3 files
- Determine the weighted average cost of capitalin 8 of 469, across 4 files
Said here and by no other author read
- Assign unique bounding boxes to duplicate entity values
- Use memoization to track used boxes per entity value
- Find next best match if bounding box is used
- Reverse dataframe for amounts_and_tax sections
- Process dataframe top to bottom
- Select next best sequence for overlapping multi-token entities
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.