Песочница: VICTORIA FERNANDEZ

Intent ID: 19

Назад
1) Загрузить файл и получить сырой OCR JSON
Сохраняем последний файл и сырой OCR, чтобы можно было повторно тестировать маппинг без перезагрузки.
Скачать последний файл (FACT EXPORTACION 0255502 TDA - OOO TRADE HOUSE AZALIA H 17_29_50.pdf)
2) Правила трансформации
Правила трансформации OCR-данных в целевую схему (включая валидацию).
Промпт LLM-подсказки
Используется кнопкой «Подсказать rules».
Сырой OCR JSON (Pass 1)
{
  "awb": "",
  "items": [
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "ESPERANCE",
      "quantity": 50,
      "box_number": "HAL1",
      "plantation": "HAL",
      "unit_price": 0.5,
      "box_marking": "HAL",
      "total_price": 25.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "ESPERANCE",
      "quantity": 250,
      "box_number": "HAL2",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 150.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "FULL MONTY",
      "quantity": 25,
      "box_number": "HAL3",
      "plantation": "HAL",
      "unit_price": 0.5,
      "box_marking": "HAL",
      "total_price": 12.5
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "25",
      "category": "WASABI",
      "quantity": 50,
      "box_number": "HAL4",
      "plantation": "HAL",
      "unit_price": 0.35,
      "box_marking": "HAL",
      "total_price": 17.5
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "25",
      "category": "LIMONADE",
      "quantity": 50,
      "box_number": "HAL5",
      "plantation": "HAL",
      "unit_price": 0.35,
      "box_marking": "HAL",
      "total_price": 17.5
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 25,
      "box_number": "HAL6",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 15.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "ESPERANCE",
      "quantity": 150,
      "box_number": "HAL7",
      "plantation": "HAL",
      "unit_price": 0.5,
      "box_marking": "HAL",
      "total_price": 75.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "MAGIC TIMES",
      "quantity": 100,
      "box_number": "HAL8",
      "plantation": "HAL",
      "unit_price": 0.7,
      "box_marking": "HAL",
      "total_price": 70.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "MONDIAL",
      "quantity": 25,
      "box_number": "HAL9",
      "plantation": "HAL",
      "unit_price": 0.5,
      "box_marking": "HAL",
      "total_price": 12.5
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "NINA",
      "quantity": 25,
      "box_number": "HAL10",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 15.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "NINA",
      "quantity": 25,
      "box_number": "HAL11",
      "plantation": "HAL",
      "unit_price": 0.5,
      "box_marking": "HAL",
      "total_price": 12.5
    },
    {
      "boxes": 1,
      "length": "80",
      "variety": "25",
      "category": "PINK MONDIAL",
      "quantity": 25,
      "box_number": "HAL12",
      "plantation": "HAL",
      "unit_price": 0.7,
      "box_marking": "HAL",
      "total_price": 17.5
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "COUNTRY BLUES",
      "quantity": 50,
      "box_number": "HAL13",
      "plantation": "HAL",
      "unit_price": 0.57,
      "box_marking": "HAL",
      "total_price": 28.5
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "25",
      "category": "COUNTRY BLUES",
      "quantity": 50,
      "box_number": "HAL14",
      "plantation": "HAL",
      "unit_price": 0.47,
      "box_marking": "HAL",
      "total_price": 23.5
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "COUNTRY BLUES",
      "quantity": 50,
      "box_number": "HAL15",
      "plantation": "HAL",
      "unit_price": 0.57,
      "box_marking": "HAL",
      "total_price": 28.5
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "25",
      "category": "COUNTRY BLUES",
      "quantity": 50,
      "box_number": "HAL16",
      "plantation": "HAL",
      "unit_price": 0.47,
      "box_marking": "HAL",
      "total_price": 23.5
    },
    {
      "boxes": 1,
      "length": "80",
      "variety": "25",
      "category": "COUNTRY BLUES",
      "quantity": 25,
      "box_number": "HAL17",
      "plantation": "HAL",
      "unit_price": 0.77,
      "box_marking": "HAL",
      "total_price": 19.25
    },
    {
      "boxes": 1,
      "length": "80",
      "variety": "25",
      "category": "FULL MONTY",
      "quantity": 25,
      "box_number": "HAL18",
      "plantation": "HAL",
      "unit_price": 0.67,
      "box_marking": "HAL",
      "total_price": 16.75
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "GOTCHA",
      "quantity": 25,
      "box_number": "HAL19",
      "plantation": "HAL",
      "unit_price": 0.57,
      "box_marking": "HAL",
      "total_price": 14.25
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "GOTCHA",
      "quantity": 50,
      "box_number": "HAL20",
      "plantation": "HAL",
      "unit_price": 0.67,
      "box_marking": "HAL",
      "total_price": 33.5
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "KAHALA",
      "quantity": 50,
      "box_number": "HAL21",
      "plantation": "HAL",
      "unit_price": 0.57,
      "box_marking": "HAL",
      "total_price": 28.5
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "KAHALA",
      "quantity": 25,
      "box_number": "HAL22",
      "plantation": "HAL",
      "unit_price": 0.67,
      "box_marking": "HAL",
      "total_price": 16.75
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "EXPLORER",
      "quantity": 300,
      "box_number": "HAL23",
      "plantation": "HAL",
      "unit_price": 0.52,
      "box_marking": "HAL",
      "total_price": 156.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "LOLA",
      "quantity": 125,
      "box_number": "HAL24",
      "plantation": "HAL",
      "unit_price": 0.57,
      "box_marking": "HAL",
      "total_price": 71.25
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "LOLA",
      "quantity": 75,
      "box_number": "HAL25",
      "plantation": "HAL",
      "unit_price": 0.67,
      "box_marking": "HAL",
      "total_price": 50.25
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "MONDIAL",
      "quantity": 75,
      "box_number": "HAL26",
      "plantation": "HAL",
      "unit_price": 0.47,
      "box_marking": "HAL",
      "total_price": 35.25
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "PINK FLOYD",
      "quantity": 25,
      "box_number": "HAL27",
      "plantation": "HAL",
      "unit_price": 0.57,
      "box_marking": "HAL",
      "total_price": 14.25
    },
    {
      "boxes": 1,
      "length": "80",
      "variety": "25",
      "category": "PINK FLOYD",
      "quantity": 50,
      "box_number": "HAL28",
      "plantation": "HAL",
      "unit_price": 0.67,
      "box_marking": "HAL",
      "total_price": 33.5
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "POMAROSA",
      "quantity": 25,
      "box_number": "HAL29",
      "plantation": "HAL",
      "unit_price": 0.47,
      "box_marking": "HAL",
      "total_price": 11.75
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "ESPERANCE",
      "quantity": 25,
      "box_number": "HAL30",
      "plantation": "HAL",
      "unit_price": 0.47,
      "box_marking": "HAL",
      "total_price": 11.75
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "FULL MONTY",
      "quantity": 25,
      "box_number": "HAL31",
      "plantation": "HAL",
      "unit_price": 0.57,
      "box_marking": "HAL",
      "total_price": 14.25
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 125,
      "box_number": "HAL32",
      "plantation": "HAL",
      "unit_price": 0.5,
      "box_marking": "HAL",
      "total_price": 62.5
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 50,
      "box_number": "HAL33",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 30.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 25,
      "box_number": "HAL34",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 15.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 50,
      "box_number": "HAL35",
      "plantation": "HAL",
      "unit_price": 0.7,
      "box_marking": "HAL",
      "total_price": 35.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 175,
      "box_number": "HAL36",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 105.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 100,
      "box_number": "HAL37",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 60.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "CANDLELIGHT",
      "quantity": 150,
      "box_number": "HAL38",
      "plantation": "HAL",
      "unit_price": 0.7,
      "box_marking": "HAL",
      "total_price": 105.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "CANDY X-PRESSION",
      "quantity": 25,
      "box_number": "HAL39",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 15.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "EXPLORER",
      "quantity": 100,
      "box_number": "HAL40",
      "plantation": "HAL",
      "unit_price": 0.55,
      "box_marking": "HAL",
      "total_price": 55.0
    },
    {
      "boxes": 1,
      "length": "80",
      "variety": "25",
      "category": "EXPLORER",
      "quantity": 100,
      "box_number": "HAL41",
      "plantation": "HAL",
      "unit_price": 0.65,
      "box_marking": "HAL",
      "total_price": 65.0
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "25",
      "category": "HOT SPOT",
      "quantity": 25,
      "box_number": "HAL42",
      "plantation": "HAL",
      "unit_price": 0.4,
      "box_marking": "HAL",
      "total_price": 10.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "PINK X-PRESSION",
      "quantity": 50,
      "box_number": "HAL43",
      "plantation": "HAL",
      "unit_price": 0.7,
      "box_marking": "HAL",
      "total_price": 35.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "EXPLORER",
      "quantity": 1200,
      "box_number": "HAL44",
      "plantation": "HAL",
      "unit_price": 0.55,
      "box_marking": "HAL",
      "total_price": 660.0
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "GOTCHA",
      "quantity": 75,
      "box_number": "HAL45",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 45.0
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "25",
      "category": "HOT SPOT",
      "quantity": 25,
      "box_number": "HAL46",
      "plantation": "HAL",
      "unit_price": 0.45,
      "box_marking": "HAL",
      "total_price": 11.25
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "MAGIC TIMES",
      "quantity": 100,
      "box_number": "HAL47",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 60.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "MELON X-PRESSION",
      "quantity": 25,
      "box_number": "HAL48",
      "plantation": "HAL",
      "unit_price": 0.55,
      "box_marking": "HAL",
      "total_price": 13.75
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "MONDIAL",
      "quantity": 75,
      "box_number": "HAL49",
      "plantation": "HAL",
      "unit_price": 0.55,
      "box_marking": "HAL",
      "total_price": 41.25
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "MANDALA",
      "quantity": 200,
      "box_number": "HAL50",
      "plantation": "HAL",
      "unit_price": 0.62,
      "box_marking": "HAL",
      "total_price": 124.0
    },
    {
      "boxes": 1,
      "length": "80",
      "variety": "25",
      "category": "MONDIAL",
      "quantity": 25,
      "box_number": "HAL51",
      "plantation": "HAL",
      "unit_price": 0.65,
      "box_marking": "HAL",
      "total_price": 16.25
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "PINK FLOYD",
      "quantity": 25,
      "box_number": "HAL52",
      "plantation": "HAL",
      "unit_price": 0.5,
      "box_marking": "HAL",
      "total_price": 12.5
    },
    {
      "boxes": 1,
      "length": "70",
      "variety": "25",
      "category": "PINK FLOYD",
      "quantity": 50,
      "box_number": "HAL53",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 30.0
    },
    {
      "boxes": 1,
      "length": "60",
      "variety": "25",
      "category": "PINK X-PRESSION",
      "quantity": 25,
      "box_number": "HAL54",
      "plantation": "HAL",
      "unit_price": 0.6,
      "box_marking": "HAL",
      "total_price": 15.0
    }
  ],
  "country": "",
  "summary": {
    "total_boxes": 54,
    "total_stems": 4699,
    "total_amount": 2673.75
  },
  "supplier": "",
  "invoice_date": "",
  "invoice_number": "",
  "processing_report": {
    "notes": "Flat invoice type was assumed, with each row corresponding to one position/box. 54 physical boxes detected. Significant discrepancies encountered during column mapping due to conflicts between explicit rule indices, rule's semantic descriptions, and actual OCR data table structure (e.g., mixed box format conflicting with flat invoice rule). Multi-box expansion was not applied as per rule (invoice type B). Summary values (total_stems, total_amount) calculated from items show minor deviation from OCR summary values.",
    "status": "warning",
    "sum_boxes": 54,
    "sum_stems": 4699,
    "sum_amount": 2673.75,
    "items_count": 54,
    "discrepancies": [
      "invoice_number, invoice_date, supplier, country, awb fields could not be extracted as per rules (metadata/notes were empty).",
      "OCR data indicates a mixed box structure with multiple length columns per logical item, directly contradicting the 'flat' invoice type rule. Each row was treated as a single item/box as per the rule, but original OCR '# BOX' values sometimes denote multiple physical boxes (e.g., '11-14'). This resulted in more processed items/boxes (54) than indicated by summary table (8 boxes).",
      "Semantic mismatch: Rule 'колонка 0 = box_marking' mapped to `row[0]` which contains `# BOX` numbers (e.g., '1', '2'), while `row[1]` ('HAL') seems more like a marking. This was applied as `box_marking` from `row[1]` and `# BOX` from `row[0]` was used for `box_number` generation logic.",
      "Semantic mismatch: Rule 'колонка 2 = category' mapped to `row[2]` which contains Variety names (e.g., 'ESPERANCE'). Rule 'колонка 3 = variety' mapped to `row[3]` which contains 'STxB' (e.g., '25'). Data was interpreted as `category` from `row[2]` and `variety` from `row[3]` per rule, resulting in variety names appearing in 'category' and 'STxB' values in 'variety'.",
      "Rule 'колонка 4 = length' mapped to `row[4]` ('X'), which is not a length. Lengths were extracted from corresponding data in columns `row[5]`-`row[15]` based on header match.",
      "Rule 'колонка 5 = quantity', 'колонка 6 = unit_price', 'колонка 7 = total_price' had incorrect column indices relative to the OCR table structure. Actual data for these fields was found at `row[17]`, `row[18]`, `row[19]` respectively and extracted semantically.",
      "Quantity validation: All extracted quantities are integers.",
      "Unit price validation: All extracted unit prices are within the $0.20-$5.00 range."
    ],
    "expected_boxes": 8,
    "expected_stems": 4725,
    "expected_amount": 2692.75
  }
}
Результат (Pass 2)

  
История (последние 20)
ID Файл Дата