agentsclimarketplace

Invoice entity bounding box mapping with duplicate handling

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/invoice-entity-bounding-box-mapping-with-duplicate-handling

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill invoice-entity-bounding-box-mapping-with-duplicate-handling

Assembled 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.

What its author says it does

Copied from the file, not written here

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.

SKILL.md

2.7 KB, 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

  1. 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.
  2. Special Section Handling: For entities in the amounts_and_tax section, reverse the dataframe (search bottom-up) before finding bounding boxes.
  3. 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.
  4. Coordinate Uniqueness: When selecting a new bounding box for a duplicate entity, ensure none of its left, right, top, or bottom values overlap with any previously used bounding box for that specific entity value.
  5. Code Structure: Maintain the existing code structure and main logic as much as possible while implementing the required changes.
  6. 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

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.