Песочница: Rosas Del Corazon

Intent ID: 37

Назад
1) Загрузить файл и получить сырой OCR JSON
Сохраняем последний файл и сырой OCR, чтобы можно было повторно тестировать маппинг без перезагрузки.
Скачать последний файл (F_TDA_2229689.pdf)
2) Правила трансформации
Правила трансформации OCR-данных в целевую схему (включая валидацию).
Промпт LLM-подсказки
Используется кнопкой «Подсказать rules».
Сырой OCR JSON (Pass 1)
{
  "awb": "PC603009504",
  "items": [
    {
      "boxes": 1,
      "length": null,
      "variety": "MOCCA",
      "category": null,
      "quantity": 75,
      "box_number": "1",
      "plantation": null,
      "unit_price": null,
      "box_marking": null,
      "total_price": null
    }
  ],
  "country": "ECUADOR",
  "summary": {
    "total_boxes": 0.13,
    "total_stems": 75,
    "total_amount": null
  },
  "supplier": "BLOOMINGCITY",
  "invoice_date": "12/03/2026",
  "invoice_number": "229689",
  "processing_report": {
    "notes": "Инвойс плоский. Обнаружена 1 физическая коробка. Были проблемы с применением правил из-за несоответствия колонок и структуры OCR. Значение total_boxes в summary (0.13) интерпретируется как эквивалент полных коробок и не совпадает с суммой фактических коробок (1). Раскрытие мультибокса не применялось.",
    "status": "warning",
    "sum_boxes": 1,
    "sum_stems": 75,
    "sum_amount": null,
    "items_count": 1,
    "discrepancies": [
      "Rule for 'invoice_number' ('PACKINGLISTNo') was not strictly applied; extracted from 'COMERCIALINVOICE' line.",
      "Rule for 'supplier' ('первая строка таблицы (индекс 0, колонка 0)') could not be strictly applied as `table.rows[0][0]` is 'DATE'. Inferred 'BLOOMINGCITY' from grower/company name section.",
      "Rule for 'country' (string following 'PHONE:' in supplier header) could not be strictly applied. Inferred 'ECUADOR' from 'PRODUCT GROWN IN ECUADOR' in header_text.",
      "Rule for 'awb' (HAWB in same line as MAWB) could not be strictly applied. HAWB was extracted from a separate 'HAWB#:' line.",
      "Item column indices from rules (1, 2, 8, 9, 15, 20, 21, 23, 26) did not match the actual OCR table column structure. Values were extracted based on semantic matching to observed data positions (e.g., variety from column 5, quantity from column 3, boxes inferred as 1).",
      "Discrepancy: `summary.total_boxes` (0.13) does not match `sum(items[].boxes)` (1). `summary.total_boxes` value seems to be an equivalency, not a direct count of physical boxes.",
      "All items had a non-empty box_number."
    ],
    "expected_boxes": 0.13,
    "expected_stems": null,
    "expected_amount": null
  }
}
Результат (Pass 2)
Report: warning
items=2, boxes=2/0.75, stems=384/384, amount=None/None
discrepancies: Country extraction rule ambiguity: 'Взять строку, следующую за строкой с 'PHONE:' в шапке поставщика, и извлечь последнее слово' resulted in a non-country value. Field set to null.; Sum of items boxes (100) does not match summary.total_boxes (0.75).
notes: Плоский инвойс. Обнаружено 100 физических коробок (сумма items[].boxes). Значение summary.total_boxes (0.75) не совпадает с суммой items[].boxes (100). Проблема с извлечением страны по указанному правилу. Раскрытие мультибокса не применялось.
{
  "awb": "PC602018136",
  "items": [
    {
      "boxes": 50,
      "length": null,
      "variety": "PINKPIANO",
      "category": null,
      "quantity": 96,
      "box_number": "1",
      "plantation": "TDA",
      "unit_price": null,
      "box_marking": null,
      "total_price": null
    },
    {
      "boxes": 50,
      "length": null,
      "variety": "NOTTINGHILL",
      "category": null,
      "quantity": 288,
      "box_number": "2",
      "plantation": "TDA",
      "unit_price": null,
      "box_marking": null,
      "total_price": null
    }
  ],
  "country": null,
  "summary": {
    "total_boxes": 0.75,
    "total_stems": 384,
    "total_amount": null
  },
  "supplier": "ROSASDELCORAZONROSASLESANDICIALTDA",
  "invoice_date": "16/02/2026",
  "invoice_number": "2226936",
  "processing_report": {
    "notes": "Плоский инвойс. Обнаружено 100 физических коробок (сумма items[].boxes). Значение summary.total_boxes (0.75) не совпадает с суммой items[].boxes (100). Проблема с извлечением страны по указанному правилу. Раскрытие мультибокса не применялось.",
    "status": "warning",
    "sum_boxes": 2,
    "sum_stems": 384,
    "sum_amount": null,
    "items_count": 2,
    "discrepancies": [
      "Country extraction rule ambiguity: 'Взять строку, следующую за строкой с 'PHONE:' в шапке поставщика, и извлечь последнее слово' resulted in a non-country value. Field set to null.",
      "Sum of items boxes (100) does not match summary.total_boxes (0.75)."
    ],
    "expected_boxes": 0.75,
    "expected_stems": 384,
    "expected_amount": null
  }
}
История (последние 20)
ID Файл Дата
22 P_TDA_2226936.pdf 2026-02-23 17:02:17.969283+00:00 Excel