Merged PDF Processing Results

Back to Dashboard
PDF Information
Original Filename: W.E_15.11.25_1776757527.pdf
Upload Date: April 21, 2026 at 08:47 AM
Total Pages: 21
Processing Status: Completed
Extraction Summary
Total Documents: 16
Invoices: 15
Credit Cards: 1
Page Classification Results
Page 1

Unknown

80%
Page 2

Invoice

80%
Page 3

Invoice

85%
Page 4

Invoice

85%
Page 5

Invoice

85%
Page 6

Invoice

85%
Page 7

Invoice

85%
Page 8

Invoice

80%
Page 9

Invoice

90%
Page 10

Invoice

80%
Page 11

Invoice

80%
Page 12

Credit Card

85%
Page 13

Unknown

70%
Page 14

Unknown

70%
Page 15

Unknown

70%
Page 16

Unknown

70%
Page 17

Invoice

95%
Page 18

Invoice

95%
Page 19

Invoice

95%
Page 20

Invoice

95%
Page 21

Invoice

95%
Extracted Documents 16
Document Type Pages Confidence Processing Status Created Actions
Invoice 2 (1 page) 80% Processed 2026-04-21 08:47 View
Invoice 3 (1 page) 85% Processed 2026-04-21 08:47 View
Invoice 4 (1 page) 85% Processed 2026-04-21 08:48 View
Invoice 5 (1 page) 85% Processed 2026-04-21 08:48 View
Invoice 6 (1 page) 85% Processed 2026-04-21 08:48 View
Invoice 7 (1 page) 85% Processed 2026-04-21 08:48 View
Invoice 8 (1 page) 80% Processed 2026-04-21 08:48 View
Invoice 9 (1 page) 95% Processed 2026-04-21 08:48 View
Invoice 10 (1 page) 95% Processed 2026-04-21 08:48 View
Invoice 11 (1 page) 80% Processed 2026-04-21 08:48 View
Credit Card 12 (1 page) 85% Processed 2026-04-21 08:48 View
Invoice 17 (1 page) 95% Processed 2026-04-21 08:48 View
Invoice 18 (1 page) 95% Processed 2026-04-21 08:48 View
Invoice 19 (1 page) 95% Processed 2026-04-21 08:48 View
Invoice 20 (1 page) 95% Processed 2026-04-21 08:48 View
Invoice 21 (1 page) 95% Processed 2026-04-21 08:48 View
{
  "document_groups": [
    {
      "avg_confidence": 0.8,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": null,
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Aldi Stores",
        "statement_period": null,
        "total_amount": "5.93"
      },
      "document_type": "invoice",
      "end_page": 2,
      "pages": [
        {
          "confidence_score": 0.8,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.8,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller name (\u0027Aldi Stores\u0027), a total amount (\u00275.93 GBP\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": null,\n        \"total_amount\": \"5.93\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX133wdKgKPKIO0EssMGwO5a7omgd\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller name (\\\u0027Aldi Stores\\\u0027), a total amount (\\\u00275.93 GBP\\\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldi Stores\",\\n        \"invoice_date\": null,\\n        \"total_amount\": \"5.93\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761225, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=220, prompt_tokens=1166, total_tokens=1386, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetail"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Aldi Stores",
                  "statement_period": null,
                  "total_amount": "5.93"
                },
                "llm_reasoning": "The document contains key indicators of an invoice, such as a seller name (\u0027Aldi Stores\u0027), a total amount (\u00275.93 GBP\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller name (\u0027Aldi Stores\u0027), a total amount (\u00275.93 GBP\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": null,\n        \"total_amount\": \"5.93\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.08333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.125,
                  "total_score": 0.08333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 2,
          "text_length": 419
        }
      ],
      "start_page": 2
    },
    {
      "avg_confidence": 0.85,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "14/11/2025",
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Morrisons",
        "statement_period": null,
        "total_amount": "\u00a316.57"
      },
      "document_type": "invoice",
      "end_page": 3,
      "pages": [
        {
          "confidence_score": 0.85,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.85,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Morrisons\",\n        \"invoice_date\": \"14/11/2025\",\n        \"total_amount\": \"\u00a316.57\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX134mGPL5T2Oukhux7yeG0BshsMT\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Morrisons\",\\n        \"invoice_date\": \"14/11/2025\",\\n        \"total_amount\": \"\u00a316.57\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761226, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=236, prompt_tokens=1350, total_tokens=1586, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_pr"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "14/11/2025",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Morrisons",
                  "statement_period": null,
                  "total_amount": "\u00a316.57"
                },
                "llm_reasoning": "The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Morrisons\",\n        \"invoice_date\": \"14/11/2025\",\n        \"total_amount\": \"\u00a316.57\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.2042857142857143,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.11764705882352941,
                  "pattern_score": 0.0,
                  "total_score": 0.07058823529411765
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.0,
                  "total_score": 0.03333333333333333
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.16666666666666666,
                  "pattern_score": 0.14285714285714285,
                  "total_score": 0.2042857142857143
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "nominal_ledger"
            }
          },
          "page_number": 3,
          "text_length": 1015
        }
      ],
      "start_page": 3
    },
    {
      "avg_confidence": 0.85,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "2025-11-08",
        "invoice_number": "2103 C411/001/003",
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Aldi Stores",
        "statement_period": null,
        "total_amount": "39.09"
      },
      "document_type": "invoice",
      "end_page": 4,
      "pages": [
        {
          "confidence_score": 0.85,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.85,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\u0027Aldi Stores\u0027) and a date (\u002708.11.25\u0027) further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"2103 C411/001/003\",\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": \"2025-11-08\",\n        \"total_amount\": \"39.09\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX1360gu6XVktbBL63sH1zDsEpNSA\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\\\u0027Aldi Stores\\\u0027) and a date (\\\u002708.11.25\\\u0027) further supports the classification as an invoice.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"2103 C411/001/003\",\\n        \"seller_name\": \"Aldi Stores\",\\n        \"invoice_date\": \"2025-11-08\",\\n        \"total_amount\": \"39.09\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761228, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=237, prompt_tokens=1547, total_tokens=1784, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_de"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "2025-11-08",
                  "invoice_number": "2103 C411/001/003",
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Aldi Stores",
                  "statement_period": null,
                  "total_amount": "39.09"
                },
                "llm_reasoning": "The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\u0027Aldi Stores\u0027) and a date (\u002708.11.25\u0027) further supports the classification as an invoice.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\u0027Aldi Stores\u0027) and a date (\u002708.11.25\u0027) further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"2103 C411/001/003\",\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": \"2025-11-08\",\n        \"total_amount\": \"39.09\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.03,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.027777777777777776,
                  "pattern_score": 0.0,
                  "total_score": 0.03
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "payroll_statement"
            }
          },
          "page_number": 4,
          "text_length": 1213
        }
      ],
      "start_page": 4
    },
    {
      "avg_confidence": 0.85,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "2025-11-05",
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "ALDI STORES",
        "statement_period": null,
        "total_amount": "12.24"
      },
      "document_type": "invoice",
      "end_page": 5,
      "pages": [
        {
          "confidence_score": 0.85,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.85,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\u0027ALDI STORES\u0027) and a date (\u002705.11.25\u0027), which align with typical invoice characteristics.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-05\",\n        \"total_amount\": \"12.24\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX137qRqcAHrq6vRlmRtyG0lPGdUh\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\\\u0027ALDI STORES\\\u0027) and a date (\\\u002705.11.25\\\u0027), which align with typical invoice characteristics.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-05\",\\n        \"total_amount\": \"12.24\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761229, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=226, prompt_tokens=1222, total_tokens=1448, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "2025-11-05",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "ALDI STORES",
                  "statement_period": null,
                  "total_amount": "12.24"
                },
                "llm_reasoning": "The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\u0027ALDI STORES\u0027) and a date (\u002705.11.25\u0027), which align with typical invoice characteristics.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\u0027ALDI STORES\u0027) and a date (\u002705.11.25\u0027), which align with typical invoice characteristics.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-05\",\n        \"total_amount\": \"12.24\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.02564102564102564,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "property_statement"
            }
          },
          "page_number": 5,
          "text_length": 541
        }
      ],
      "start_page": 5
    },
    {
      "avg_confidence": 0.85,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "11/11/2025",
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "KAKA SUPERMARKET",
        "statement_period": null,
        "total_amount": "20.25"
      },
      "document_type": "invoice",
      "end_page": 6,
      "pages": [
        {
          "confidence_score": 0.85,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.85,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller/company name (\u0027KAKA SUPERMARKET\u0027), a date (\u002711/11/2025\u0027), and a subtotal (\u002720.25\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"KAKA SUPERMARKET\",\n        \"invoice_date\": \"11/11/2025\",\n        \"total_amount\": \"20.25\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX139JBKBdR9rcQ7hT7ylNIUOMNkC\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller/company name (\\\u0027KAKA SUPERMARKET\\\u0027), a date (\\\u002711/11/2025\\\u0027), and a subtotal (\\\u002720.25\\\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"KAKA SUPERMARKET\",\\n        \"invoice_date\": \"11/11/2025\",\\n        \"total_amount\": \"20.25\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761231, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=249, prompt_tokens=1191, total_tokens=1440, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_toke"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "11/11/2025",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "KAKA SUPERMARKET",
                  "statement_period": null,
                  "total_amount": "20.25"
                },
                "llm_reasoning": "The document contains key indicators of an invoice, such as a seller/company name (\u0027KAKA SUPERMARKET\u0027), a date (\u002711/11/2025\u0027), and a subtotal (\u002720.25\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller/company name (\u0027KAKA SUPERMARKET\u0027), a date (\u002711/11/2025\u0027), and a subtotal (\u002720.25\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"KAKA SUPERMARKET\",\n        \"invoice_date\": \"11/11/2025\",\n        \"total_amount\": \"20.25\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.08333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.125,
                  "total_score": 0.08333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 6,
          "text_length": 428
        }
      ],
      "start_page": 6
    },
    {
      "avg_confidence": 0.85,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "11.11.25",
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "ALDI STORES",
        "statement_period": null,
        "total_amount": "25.96"
      },
      "document_type": "invoice",
      "end_page": 7,
      "pages": [
        {
          "confidence_score": 0.85,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.85,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\u0027ALDI STORES\u0027) and a date (\u002711.11.25\u0027) further supports this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"11.11.25\",\n        \"total_amount\": \"25.96\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13AE2NyxwTmQKmebJXIy5VkGgIE\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\\\u0027ALDI STORES\\\u0027) and a date (\\\u002711.11.25\\\u0027) further supports this classification.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"11.11.25\",\\n        \"total_amount\": \"25.96\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761232, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=235, prompt_tokens=1384, total_tokens=1619, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), promp"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "11.11.25",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "ALDI STORES",
                  "statement_period": null,
                  "total_amount": "25.96"
                },
                "llm_reasoning": "The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\u0027ALDI STORES\u0027) and a date (\u002711.11.25\u0027) further supports this classification.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\u0027ALDI STORES\u0027) and a date (\u002711.11.25\u0027) further supports this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"11.11.25\",\n        \"total_amount\": \"25.96\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.08333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.125,
                  "total_score": 0.08333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 7,
          "text_length": 864
        }
      ],
      "start_page": 7
    },
    {
      "avg_confidence": 0.8,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "12.11.25",
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "ALDI STORES",
        "statement_period": null,
        "total_amount": "19.33"
      },
      "document_type": "invoice",
      "end_page": 8,
      "pages": [
        {
          "confidence_score": 0.8,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.8,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"12.11.25\",\n        \"total_amount\": \"19.33\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13B3yVOMVKkFPl0dXi99wy7RbeU\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"12.11.25\",\\n        \"total_amount\": \"19.33\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761233, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=217, prompt_tokens=1171, total_tokens=1388, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_toke"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "12.11.25",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "ALDI STORES",
                  "statement_period": null,
                  "total_amount": "19.33"
                },
                "llm_reasoning": "The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"12.11.25\",\n        \"total_amount\": \"19.33\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.08333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.125,
                  "total_score": 0.08333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 8,
          "text_length": 442
        }
      ],
      "start_page": 8
    },
    {
      "avg_confidence": 0.8500000000000001,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "2025-11-13",
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "ALDI STORES",
        "statement_period": null,
        "total_amount": "8.53"
      },
      "document_type": "invoice",
      "end_page": 10,
      "pages": [
        {
          "confidence_score": 0.9,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.9,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-13\",\n        \"total_amount\": \"8.53\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13DTsk2HUQ7Ywm7flNkqPe2uvX5\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-13\",\\n        \"total_amount\": \"8.53\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761235, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=211, prompt_tokens=1191, total_tokens=1402, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=1152)), prompt_filter_results=[{\u0027prompt_"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "2025-11-13",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "ALDI STORES",
                  "statement_period": null,
                  "total_amount": "8.53"
                },
                "llm_reasoning": "The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-13\",\n        \"total_amount\": \"8.53\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.16666666666666669,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.1111111111111111,
                  "pattern_score": 0.25,
                  "total_score": 0.16666666666666669
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.027777777777777776,
                  "pattern_score": 0.0,
                  "total_score": 0.03
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 9,
          "text_length": 466
        },
        {
          "confidence_score": 0.8,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.8,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a list of purchased items with prices, a total amount (\u0027Total 8.58\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"8.58\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13E58mpl0RSwLx2y69eIB9IifOW\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains key indicators of a receipt or invoice, such as a seller name (\\\u0027ALDI STORES\\\u0027), a list of purchased items with prices, a total amount (\\\u0027Total 8.58\\\u0027), and a date (\\\u002709.11.25\\\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-09\",\\n        \"total_amount\": \"8.58\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761236, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=238, prompt_tokens=1207, total_tokens=1445, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_d"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "2025-11-09",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "ALDI STORES",
                  "statement_period": null,
                  "total_amount": "8.58"
                },
                "llm_reasoning": "The document contains key indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a list of purchased items with prices, a total amount (\u0027Total 8.58\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a list of purchased items with prices, a total amount (\u0027Total 8.58\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"8.58\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.08333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.125,
                  "total_score": 0.08333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 10,
          "text_length": 498
        }
      ],
      "start_page": 9
    },
    {
      "avg_confidence": 0.8,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "2025-11-09",
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "ALDI STORES",
        "statement_period": null,
        "total_amount": "5.56"
      },
      "document_type": "invoice",
      "end_page": 11,
      "pages": [
        {
          "confidence_score": 0.8,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.8,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a total amount (\u00275.56 GBP\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"5.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13GMMVoJENTsbYmcwpxyEJ0bzw0\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains indicators of a receipt or invoice, such as a seller name (\\\u0027ALDI STORES\\\u0027), a total amount (\\\u00275.56 GBP\\\u0027), and a date (\\\u002709.11.25\\\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-09\",\\n        \"total_amount\": \"5.56\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761238, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=232, prompt_tokens=1109, total_tokens=1341, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=Promp"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "2025-11-09",
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "ALDI STORES",
                  "statement_period": null,
                  "total_amount": "5.56"
                },
                "llm_reasoning": "The document contains indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a total amount (\u00275.56 GBP\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a total amount (\u00275.56 GBP\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"5.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.08333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.125,
                  "total_score": 0.08333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 11,
          "text_length": 315
        }
      ],
      "start_page": 11
    },
    {
      "avg_confidence": 0.85,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": null,
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": null,
        "statement_period": null,
        "total_amount": null
      },
      "document_type": "credit_card",
      "end_page": 12,
      "pages": [
        {
          "confidence_score": 0.85,
          "document_type": "credit_card",
          "features": {
            "llm_based": {
              "confidence": 0.85,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \u0027DEBIT MASTERCARD\u0027 and \u0027Card Sales,\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13HmxeeroAACypBMhAZJ42ADass\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \\\u0027DEBIT MASTERCARD\\\u0027 and \\\u0027Card Sales,\\\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761239, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=253, prompt_tokens=1240, "
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \u0027DEBIT MASTERCARD\u0027 and \u0027Card Sales,\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.",
                "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \u0027DEBIT MASTERCARD\u0027 and \u0027Card Sales,\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "credit_card"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.1392857142857143,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.058823529411764705,
                  "pattern_score": 0.0,
                  "total_score": 0.03529411764705882
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.06666666666666667,
                  "pattern_score": 0.0,
                  "total_score": 0.04
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.125,
                  "total_score": 0.08333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.08333333333333333,
                  "pattern_score": 0.14285714285714285,
                  "total_score": 0.1392857142857143
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.013888888888888888,
                  "pattern_score": 0.0,
                  "total_score": 0.015
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.02564102564102564,
                  "total_score": 0.02564102564102564
                }
              },
              "type": "nominal_ledger"
            }
          },
          "page_number": 12,
          "text_length": 649
        }
      ],
      "start_page": 12
    },
    {
      "avg_confidence": 0.95,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "07 November 2025",
        "invoice_number": "GB58OSCKJAEUI",
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Amazon EU S.\u00e0 r.l ., UK Branch",
        "statement_period": null,
        "total_amount": "\u00a34.74"
      },
      "document_type": "invoice",
      "end_page": 17,
      "pages": [
        {
          "confidence_score": 0.95,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.95,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Sold by\u0027, \u0027Billing address\u0027, \u0027Delivery address\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB58OSCKJAEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"07 November 2025\",\n        \"total_amount\": \"\u00a34.74\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13PgRRAsD1w5ccafP534tSC8X2n\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Sold by\\\u0027, \\\u0027Billing address\\\u0027, \\\u0027Delivery address\\\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"GB58OSCKJAEUI\",\\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\\n        \"invoice_date\": \"07 November 2025\",\\n        \"total_amount\": \"\u00a34.74\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761247, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=239, prompt_tokens=1561, total_tokens=1800, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "07 November 2025",
                  "invoice_number": "GB58OSCKJAEUI",
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Amazon EU S.\u00e0 r.l ., UK Branch",
                  "statement_period": null,
                  "total_amount": "\u00a34.74"
                },
                "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Sold by\u0027, \u0027Billing address\u0027, \u0027Delivery address\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Sold by\u0027, \u0027Billing address\u0027, \u0027Delivery address\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB58OSCKJAEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"07 November 2025\",\n        \"total_amount\": \"\u00a34.74\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.23333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.3888888888888889,
                  "pattern_score": 0.0,
                  "total_score": 0.23333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.16666666666666666,
                  "pattern_score": 0.0,
                  "total_score": 0.13
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.027777777777777776,
                  "pattern_score": 0.0,
                  "total_score": 0.03
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 17,
          "text_length": 1660
        }
      ],
      "start_page": 17
    },
    {
      "avg_confidence": 0.95,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "06 November 2025",
        "invoice_number": "GB5809X12AEUI",
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Amazon EU S.\u00e0 r.l ., UK Branch",
        "statement_period": null,
        "total_amount": "\u00a311.56"
      },
      "document_type": "invoice",
      "end_page": 18,
      "pages": [
        {
          "confidence_score": 0.95,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.95,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice date\u0027, \u0027Invoice #\u0027, \u0027Total payable\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5809X12AEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"06 November 2025\",\n        \"total_amount\": \"\u00a311.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13QgO924xaGqRxvRHD40fO8aE5x\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Total payable\\\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"GB5809X12AEUI\",\\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\\n        \"invoice_date\": \"06 November 2025\",\\n        \"total_amount\": \"\u00a311.56\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761248, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=247, prompt_tokens=1620, total_tokens=1867, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens="
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "06 November 2025",
                  "invoice_number": "GB5809X12AEUI",
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Amazon EU S.\u00e0 r.l ., UK Branch",
                  "statement_period": null,
                  "total_amount": "\u00a311.56"
                },
                "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice date\u0027, \u0027Invoice #\u0027, \u0027Total payable\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice date\u0027, \u0027Invoice #\u0027, \u0027Total payable\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5809X12AEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"06 November 2025\",\n        \"total_amount\": \"\u00a311.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.23333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.3888888888888889,
                  "pattern_score": 0.0,
                  "total_score": 0.23333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.16666666666666666,
                  "pattern_score": 0.0,
                  "total_score": 0.13
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.027777777777777776,
                  "pattern_score": 0.0,
                  "total_score": 0.03
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 18,
          "text_length": 1858
        }
      ],
      "start_page": 18
    },
    {
      "avg_confidence": 0.95,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "06.11.2025",
        "invoice_number": "DS-AEU-INV-GB-2025-620978253",
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Fruit Fly Ninja B.V.",
        "statement_period": null,
        "total_amount": "\u00a311.39"
      },
      "document_type": "invoice",
      "end_page": 19,
      "pages": [
        {
          "confidence_score": 0.95,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.95,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978253\",\n        \"seller_name\": \"Fruit Fly Ninja B.V.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a311.39\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13TuY5g7r99fdv5FVrJpU15SxR1\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Total payable\\\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978253\",\\n        \"seller_name\": \"Fruit Fly Ninja B.V.\",\\n        \"invoice_date\": \"06.11.2025\",\\n        \"total_amount\": \"\u00a311.39\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761251, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=238, prompt_tokens=1527, total_tokens=1765, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_det"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "06.11.2025",
                  "invoice_number": "DS-AEU-INV-GB-2025-620978253",
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Fruit Fly Ninja B.V.",
                  "statement_period": null,
                  "total_amount": "\u00a311.39"
                },
                "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978253\",\n        \"seller_name\": \"Fruit Fly Ninja B.V.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a311.39\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.23333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.3888888888888889,
                  "pattern_score": 0.0,
                  "total_score": 0.23333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.027777777777777776,
                  "pattern_score": 0.0,
                  "total_score": 0.03
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 19,
          "text_length": 1515
        }
      ],
      "start_page": 19
    },
    {
      "avg_confidence": 0.95,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "06.11.2025",
        "invoice_number": "DS-AEU-INV-GB-2025-620978309",
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.",
        "statement_period": null,
        "total_amount": "\u00a322.78"
      },
      "document_type": "invoice",
      "end_page": 20,
      "pages": [
        {
          "confidence_score": 0.95,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.95,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as the presence of an \u0027Invoice #\u0027 (DS-AEU-INV-GB-2025-620978309), \u0027Invoice date\u0027 (06.11.2025), \u0027Total payable\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978309\",\n        \"seller_name\": \"DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a322.78\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13UAdAxusCzsJnae6PIafFKJZef\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as the presence of an \\\u0027Invoice #\\\u0027 (DS-AEU-INV-GB-2025-620978309), \\\u0027Invoice date\\\u0027 (06.11.2025), \\\u0027Total payable\\\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978309\",\\n        \"seller_name\": \"DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.\",\\n        \"invoice_date\": \"06.11.2025\",\\n        \"total_amount\": \"\u00a322.78\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761252, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=287, prompt_tokens=1556, total_tokens=1843, completion_tokens_detai"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "06.11.2025",
                  "invoice_number": "DS-AEU-INV-GB-2025-620978309",
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.",
                  "statement_period": null,
                  "total_amount": "\u00a322.78"
                },
                "llm_reasoning": "The document contains clear indicators of an invoice, such as the presence of an \u0027Invoice #\u0027 (DS-AEU-INV-GB-2025-620978309), \u0027Invoice date\u0027 (06.11.2025), \u0027Total payable\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as the presence of an \u0027Invoice #\u0027 (DS-AEU-INV-GB-2025-620978309), \u0027Invoice date\u0027 (06.11.2025), \u0027Total payable\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978309\",\n        \"seller_name\": \"DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a322.78\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.23333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.3888888888888889,
                  "pattern_score": 0.0,
                  "total_score": 0.23333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.16666666666666666,
                  "pattern_score": 0.0,
                  "total_score": 0.13
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.027777777777777776,
                  "pattern_score": 0.0,
                  "total_score": 0.03
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 20,
          "text_length": 1572
        }
      ],
      "start_page": 20
    },
    {
      "avg_confidence": 0.95,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": "05 November 2025",
        "invoice_number": "GB5008X55Z04FI",
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Take Way Supplies Limited",
        "statement_period": null,
        "total_amount": "\u00a314.99"
      },
      "document_type": "invoice",
      "end_page": 21,
      "pages": [
        {
          "confidence_score": 0.95,
          "document_type": "invoice",
          "features": {
            "llm_based": {
              "confidence": 0.95,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5008X55Z04FI\",\n        \"seller_name\": \"Take Way Supplies Limited\",\n        \"invoice_date\": \"05 November 2025\",\n        \"total_amount\": \"\u00a314.99\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13XQWu4FSGRzMVSBfgN0XIjhiiZ\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Total payable\\\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"GB5008X55Z04FI\",\\n        \"seller_name\": \"Take Way Supplies Limited\",\\n        \"invoice_date\": \"05 November 2025\",\\n        \"total_amount\": \"\u00a314.99\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761255, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=1373, total_tokens=1615, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_to"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": "05 November 2025",
                  "invoice_number": "GB5008X55Z04FI",
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Take Way Supplies Limited",
                  "statement_period": null,
                  "total_amount": "\u00a314.99"
                },
                "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5008X55Z04FI\",\n        \"seller_name\": \"Take Way Supplies Limited\",\n        \"invoice_date\": \"05 November 2025\",\n        \"total_amount\": \"\u00a314.99\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.23333333333333334,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.3888888888888889,
                  "pattern_score": 0.0,
                  "total_score": 0.23333333333333334
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.027777777777777776,
                  "pattern_score": 0.0,
                  "total_score": 0.03
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 21,
          "text_length": 1058
        }
      ],
      "start_page": 21
    }
  ],
  "page_classifications": [
    {
      "confidence_score": 0.8,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.8,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document lists various expense categories (e.g., entertainment, stationary, travel) and their corresponding amounts, along with subtotals and a total amount. This structure is indicative of a financial summary or statement of expenditures, rather than a specific invoice, payroll, or other document type.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX131oqACKubNAEhMpbVhuhx4EU3m\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"financial_statement\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document lists various expense categories (e.g., entertainment, stationary, travel) and their corresponding amounts, along with subtotals and a total amount. This structure is indicative of a financial summary or statement of expenditures, rather than a specific invoice, payroll, or other document type.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761223, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=219, prompt_tokens=1074, total_tokens=1293, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_toke"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document lists various expense categories (e.g., entertainment, stationary, travel) and their corresponding amounts, along with subtotals and a total amount. This structure is indicative of a financial summary or statement of expenditures, rather than a specific invoice, payroll, or other document type.",
            "raw_response": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document lists various expense categories (e.g., entertainment, stationary, travel) and their corresponding amounts, along with subtotals and a total amount. This structure is indicative of a financial summary or statement of expenditures, rather than a specific invoice, payroll, or other document type.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "financial_statement"
        },
        "method_used": "uncertain",
        "pattern_based": {
          "confidence": 0.03333333333333333,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 1,
      "text_length": 190
    },
    {
      "confidence_score": 0.8,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.8,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller name (\u0027Aldi Stores\u0027), a total amount (\u00275.93 GBP\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": null,\n        \"total_amount\": \"5.93\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX133wdKgKPKIO0EssMGwO5a7omgd\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller name (\\\u0027Aldi Stores\\\u0027), a total amount (\\\u00275.93 GBP\\\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldi Stores\",\\n        \"invoice_date\": null,\\n        \"total_amount\": \"5.93\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761225, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=220, prompt_tokens=1166, total_tokens=1386, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetail"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Aldi Stores",
              "statement_period": null,
              "total_amount": "5.93"
            },
            "llm_reasoning": "The document contains key indicators of an invoice, such as a seller name (\u0027Aldi Stores\u0027), a total amount (\u00275.93 GBP\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller name (\u0027Aldi Stores\u0027), a total amount (\u00275.93 GBP\u0027), and itemized purchases with descriptions and prices. However, it lacks a clear invoice number and date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": null,\n        \"total_amount\": \"5.93\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.08333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 2,
      "text_length": 419
    },
    {
      "confidence_score": 0.85,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.85,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Morrisons\",\n        \"invoice_date\": \"14/11/2025\",\n        \"total_amount\": \"\u00a316.57\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX134mGPL5T2Oukhux7yeG0BshsMT\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Morrisons\",\\n        \"invoice_date\": \"14/11/2025\",\\n        \"total_amount\": \"\u00a316.57\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761226, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=236, prompt_tokens=1350, total_tokens=1586, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_pr"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "14/11/2025",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Morrisons",
              "statement_period": null,
              "total_amount": "\u00a316.57"
            },
            "llm_reasoning": "The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as item descriptions, quantities, prices, and a total amount. Additionally, it includes a seller name (Morrisons) and a transaction date, which are typical elements of an invoice. However, it lacks a clear invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Morrisons\",\n        \"invoice_date\": \"14/11/2025\",\n        \"total_amount\": \"\u00a316.57\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.2042857142857143,
          "features": {
            "bank_statement": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.0,
              "total_score": 0.07058823529411765
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.16666666666666666,
              "pattern_score": 0.14285714285714285,
              "total_score": 0.2042857142857143
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "nominal_ledger"
        }
      },
      "page_number": 3,
      "text_length": 1015
    },
    {
      "confidence_score": 0.85,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.85,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\u0027Aldi Stores\u0027) and a date (\u002708.11.25\u0027) further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"2103 C411/001/003\",\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": \"2025-11-08\",\n        \"total_amount\": \"39.09\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX1360gu6XVktbBL63sH1zDsEpNSA\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\\\u0027Aldi Stores\\\u0027) and a date (\\\u002708.11.25\\\u0027) further supports the classification as an invoice.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"2103 C411/001/003\",\\n        \"seller_name\": \"Aldi Stores\",\\n        \"invoice_date\": \"2025-11-08\",\\n        \"total_amount\": \"39.09\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761228, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=237, prompt_tokens=1547, total_tokens=1784, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_de"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "2025-11-08",
              "invoice_number": "2103 C411/001/003",
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Aldi Stores",
              "statement_period": null,
              "total_amount": "39.09"
            },
            "llm_reasoning": "The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\u0027Aldi Stores\u0027) and a date (\u002708.11.25\u0027) further supports the classification as an invoice.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of purchased items, their prices, and a total amount, which are key indicators of an invoice. Additionally, the presence of a seller name (\u0027Aldi Stores\u0027) and a date (\u002708.11.25\u0027) further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"2103 C411/001/003\",\n        \"seller_name\": \"Aldi Stores\",\n        \"invoice_date\": \"2025-11-08\",\n        \"total_amount\": \"39.09\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.03,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "payroll_statement"
        }
      },
      "page_number": 4,
      "text_length": 1213
    },
    {
      "confidence_score": 0.85,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.85,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\u0027ALDI STORES\u0027) and a date (\u002705.11.25\u0027), which align with typical invoice characteristics.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-05\",\n        \"total_amount\": \"12.24\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX137qRqcAHrq6vRlmRtyG0lPGdUh\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\\\u0027ALDI STORES\\\u0027) and a date (\\\u002705.11.25\\\u0027), which align with typical invoice characteristics.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-05\",\\n        \"total_amount\": \"12.24\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761229, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=226, prompt_tokens=1222, total_tokens=1448, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "2025-11-05",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "ALDI STORES",
              "statement_period": null,
              "total_amount": "12.24"
            },
            "llm_reasoning": "The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\u0027ALDI STORES\u0027) and a date (\u002705.11.25\u0027), which align with typical invoice characteristics.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains itemized purchases, prices, and a total amount, which are key indicators of an invoice. Additionally, it includes a seller name (\u0027ALDI STORES\u0027) and a date (\u002705.11.25\u0027), which align with typical invoice characteristics.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-05\",\n        \"total_amount\": \"12.24\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.02564102564102564,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "property_statement"
        }
      },
      "page_number": 5,
      "text_length": 541
    },
    {
      "confidence_score": 0.85,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.85,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller/company name (\u0027KAKA SUPERMARKET\u0027), a date (\u002711/11/2025\u0027), and a subtotal (\u002720.25\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"KAKA SUPERMARKET\",\n        \"invoice_date\": \"11/11/2025\",\n        \"total_amount\": \"20.25\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX139JBKBdR9rcQ7hT7ylNIUOMNkC\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller/company name (\\\u0027KAKA SUPERMARKET\\\u0027), a date (\\\u002711/11/2025\\\u0027), and a subtotal (\\\u002720.25\\\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"KAKA SUPERMARKET\",\\n        \"invoice_date\": \"11/11/2025\",\\n        \"total_amount\": \"20.25\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761231, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=249, prompt_tokens=1191, total_tokens=1440, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_toke"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "11/11/2025",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "KAKA SUPERMARKET",
              "statement_period": null,
              "total_amount": "20.25"
            },
            "llm_reasoning": "The document contains key indicators of an invoice, such as a seller/company name (\u0027KAKA SUPERMARKET\u0027), a date (\u002711/11/2025\u0027), and a subtotal (\u002720.25\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a seller/company name (\u0027KAKA SUPERMARKET\u0027), a date (\u002711/11/2025\u0027), and a subtotal (\u002720.25\u0027). However, it lacks an explicit invoice number, which slightly reduces confidence. The presence of itemized purchases and a total amount further supports the classification as an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"KAKA SUPERMARKET\",\n        \"invoice_date\": \"11/11/2025\",\n        \"total_amount\": \"20.25\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.08333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 6,
      "text_length": 428
    },
    {
      "confidence_score": 0.85,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.85,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\u0027ALDI STORES\u0027) and a date (\u002711.11.25\u0027) further supports this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"11.11.25\",\n        \"total_amount\": \"25.96\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13AE2NyxwTmQKmebJXIy5VkGgIE\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\\\u0027ALDI STORES\\\u0027) and a date (\\\u002711.11.25\\\u0027) further supports this classification.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"11.11.25\",\\n        \"total_amount\": \"25.96\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761232, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=235, prompt_tokens=1384, total_tokens=1619, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), promp"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "11.11.25",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "ALDI STORES",
              "statement_period": null,
              "total_amount": "25.96"
            },
            "llm_reasoning": "The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\u0027ALDI STORES\u0027) and a date (\u002711.11.25\u0027) further supports this classification.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains a list of items with descriptions, quantities, and prices, as well as a total amount and VAT details. These are key indicators of an invoice. Additionally, the presence of a seller name (\u0027ALDI STORES\u0027) and a date (\u002711.11.25\u0027) further supports this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"11.11.25\",\n        \"total_amount\": \"25.96\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.08333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 7,
      "text_length": 864
    },
    {
      "confidence_score": 0.8,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.8,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"12.11.25\",\n        \"total_amount\": \"19.33\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13B3yVOMVKkFPl0dXi99wy7RbeU\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"12.11.25\",\\n        \"total_amount\": \"19.33\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761233, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=217, prompt_tokens=1171, total_tokens=1388, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_toke"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "12.11.25",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "ALDI STORES",
              "statement_period": null,
              "total_amount": "19.33"
            },
            "llm_reasoning": "The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains details of purchased items, quantities, prices, and a total amount, which are key indicators of an invoice. However, it lacks explicit identifiers like an invoice number or invoice date, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"12.11.25\",\n        \"total_amount\": \"19.33\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.08333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 8,
      "text_length": 442
    },
    {
      "confidence_score": 0.9,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.9,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-13\",\n        \"total_amount\": \"8.53\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13DTsk2HUQ7Ywm7flNkqPe2uvX5\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-13\",\\n        \"total_amount\": \"8.53\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761235, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=211, prompt_tokens=1191, total_tokens=1402, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=1152)), prompt_filter_results=[{\u0027prompt_"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "2025-11-13",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "ALDI STORES",
              "statement_period": null,
              "total_amount": "8.53"
            },
            "llm_reasoning": "The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains itemized purchases with descriptions, prices, a subtotal, and a total amount. It also includes a date and a seller name, which are key indicators of an invoice.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-13\",\n        \"total_amount\": \"8.53\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.16666666666666669,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.1111111111111111,
              "pattern_score": 0.25,
              "total_score": 0.16666666666666669
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 9,
      "text_length": 466
    },
    {
      "confidence_score": 0.8,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.8,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a list of purchased items with prices, a total amount (\u0027Total 8.58\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"8.58\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13E58mpl0RSwLx2y69eIB9IifOW\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains key indicators of a receipt or invoice, such as a seller name (\\\u0027ALDI STORES\\\u0027), a list of purchased items with prices, a total amount (\\\u0027Total 8.58\\\u0027), and a date (\\\u002709.11.25\\\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-09\",\\n        \"total_amount\": \"8.58\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761236, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=238, prompt_tokens=1207, total_tokens=1445, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_d"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "2025-11-09",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "ALDI STORES",
              "statement_period": null,
              "total_amount": "8.58"
            },
            "llm_reasoning": "The document contains key indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a list of purchased items with prices, a total amount (\u0027Total 8.58\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains key indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a list of purchased items with prices, a total amount (\u0027Total 8.58\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"8.58\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.08333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 10,
      "text_length": 498
    },
    {
      "confidence_score": 0.8,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.8,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a total amount (\u00275.56 GBP\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"5.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13GMMVoJENTsbYmcwpxyEJ0bzw0\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.8,\\n    \"reasoning\": \"The document contains indicators of a receipt or invoice, such as a seller name (\\\u0027ALDI STORES\\\u0027), a total amount (\\\u00275.56 GBP\\\u0027), and a date (\\\u002709.11.25\\\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"ALDI STORES\",\\n        \"invoice_date\": \"2025-11-09\",\\n        \"total_amount\": \"5.56\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761238, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=232, prompt_tokens=1109, total_tokens=1341, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=Promp"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "2025-11-09",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "ALDI STORES",
              "statement_period": null,
              "total_amount": "5.56"
            },
            "llm_reasoning": "The document contains indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a total amount (\u00275.56 GBP\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.8,\n    \"reasoning\": \"The document contains indicators of a receipt or invoice, such as a seller name (\u0027ALDI STORES\u0027), a total amount (\u00275.56 GBP\u0027), and a date (\u002709.11.25\u0027). However, it lacks a formal invoice number and detailed billing information, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"ALDI STORES\",\n        \"invoice_date\": \"2025-11-09\",\n        \"total_amount\": \"5.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.08333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 11,
      "text_length": 315
    },
    {
      "confidence_score": 0.85,
      "document_type": "credit_card",
      "features": {
        "llm_based": {
          "confidence": 0.85,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \u0027DEBIT MASTERCARD\u0027 and \u0027Card Sales,\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13HmxeeroAACypBMhAZJ42ADass\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.85,\\n    \"reasoning\": \"The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \\\u0027DEBIT MASTERCARD\\\u0027 and \\\u0027Card Sales,\\\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761239, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=253, prompt_tokens=1240, "
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \u0027DEBIT MASTERCARD\u0027 and \u0027Card Sales,\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.",
            "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.85,\n    \"reasoning\": \"The document contains details of a card transaction, including a card number (masked), merchant ID, terminal ID, EFT number, and authorization code. It also specifies the total amount of the transaction and mentions \u0027DEBIT MASTERCARD\u0027 and \u0027Card Sales,\u0027 which are indicative of a credit or debit card statement. However, it lacks the detailed breakdown of purchases and payments typically found in a full credit card statement, which slightly lowers the confidence level.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "credit_card"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.1392857142857143,
          "features": {
            "bank_statement": {
              "keyword_score": 0.058823529411764705,
              "pattern_score": 0.0,
              "total_score": 0.03529411764705882
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.06666666666666667,
              "pattern_score": 0.0,
              "total_score": 0.04
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.14285714285714285,
              "total_score": 0.1392857142857143
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.02564102564102564,
              "total_score": 0.02564102564102564
            }
          },
          "type": "nominal_ledger"
        }
      },
      "page_number": 12,
      "text_length": 649
    },
    {
      "confidence_score": 0.7,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.7,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document includes a payment amount (\u00a3120.00), a date (15/11/22), and a description of a service provided (\u0027payment for the above performance\u0027). These elements are indicative of an invoice or receipt for services rendered. However, the lack of a formal invoice number or explicit mention of \u0027invoice\u0027 reduces confidence slightly.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Century City Nites\",\n        \"invoice_date\": \"15/11/22\",\n        \"total_amount\": \"120.00\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13JSYEMbKVqH6UG5bxzdVQLFyqW\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.7,\\n    \"reasoning\": \"The document includes a payment amount (\u00a3120.00), a date (15/11/22), and a description of a service provided (\\\u0027payment for the above performance\\\u0027). These elements are indicative of an invoice or receipt for services rendered. However, the lack of a formal invoice number or explicit mention of \\\u0027invoice\\\u0027 reduces confidence slightly.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Century City Nites\",\\n        \"invoice_date\": \"15/11/22\",\\n        \"total_amount\": \"120.00\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761241, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=240, prompt_tokens=1107, total_tokens=1347, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, re"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "15/11/22",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Century City Nites",
              "statement_period": null,
              "total_amount": "120.00"
            },
            "llm_reasoning": "The document includes a payment amount (\u00a3120.00), a date (15/11/22), and a description of a service provided (\u0027payment for the above performance\u0027). These elements are indicative of an invoice or receipt for services rendered. However, the lack of a formal invoice number or explicit mention of \u0027invoice\u0027 reduces confidence slightly.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document includes a payment amount (\u00a3120.00), a date (15/11/22), and a description of a service provided (\u0027payment for the above performance\u0027). These elements are indicative of an invoice or receipt for services rendered. However, the lack of a formal invoice number or explicit mention of \u0027invoice\u0027 reduces confidence slightly.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Century City Nites\",\n        \"invoice_date\": \"15/11/22\",\n        \"total_amount\": \"120.00\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "uncertain",
        "pattern_based": {
          "confidence": 0.015,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "payroll_statement"
        }
      },
      "page_number": 13,
      "text_length": 309
    },
    {
      "confidence_score": 0.7,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.7,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a fee amount (\u00a3120), a payment confirmation (\u0027HAVE RECEIVED THE SUM OF\u0027), and a date (\u002714/4/25\u0027). However, it lacks a formal invoice number and detailed itemization, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Chef Gillet\",\n        \"invoice_date\": \"14/4/25\",\n        \"total_amount\": \"\u00a3120\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13LbQUC5xgr8sbRKJ5idqRR7BwS\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.7,\\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a fee amount (\u00a3120), a payment confirmation (\\\u0027HAVE RECEIVED THE SUM OF\\\u0027), and a date (\\\u002714/4/25\\\u0027). However, it lacks a formal invoice number and detailed itemization, which slightly reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Chef Gillet\",\\n        \"invoice_date\": \"14/4/25\",\\n        \"total_amount\": \"\u00a3120\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761243, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=228, prompt_tokens=1104, total_tokens=1332, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptToken"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "14/4/25",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Chef Gillet",
              "statement_period": null,
              "total_amount": "\u00a3120"
            },
            "llm_reasoning": "The document contains key indicators of an invoice, such as a fee amount (\u00a3120), a payment confirmation (\u0027HAVE RECEIVED THE SUM OF\u0027), and a date (\u002714/4/25\u0027). However, it lacks a formal invoice number and detailed itemization, which slightly reduces confidence.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as a fee amount (\u00a3120), a payment confirmation (\u0027HAVE RECEIVED THE SUM OF\u0027), and a date (\u002714/4/25\u0027). However, it lacks a formal invoice number and detailed itemization, which slightly reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Chef Gillet\",\n        \"invoice_date\": \"14/4/25\",\n        \"total_amount\": \"\u00a3120\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "uncertain",
        "pattern_based": {
          "confidence": 0.0,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 14,
      "text_length": 312
    },
    {
      "confidence_score": 0.7,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.7,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document includes a fee amount, a payment confirmation, and a date, which are typical elements of an invoice. However, it lacks explicit identifiers like \u0027Invoice Number\u0027 or \u0027Seller Name,\u0027 which reduces confidence slightly.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": \"14/11/25\",\n        \"total_amount\": \"\u00a3150.00\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13MOjG2YBdOI0Y3LixA3AYpU7Qp\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.7,\\n    \"reasoning\": \"The document includes a fee amount, a payment confirmation, and a date, which are typical elements of an invoice. However, it lacks explicit identifiers like \\\u0027Invoice Number\\\u0027 or \\\u0027Seller Name,\\\u0027 which reduces confidence slightly.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": \"14/11/25\",\\n        \"total_amount\": \"\u00a3150.00\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761244, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=214, prompt_tokens=1090, total_tokens=1304, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "14/11/25",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": "\u00a3150.00"
            },
            "llm_reasoning": "The document includes a fee amount, a payment confirmation, and a date, which are typical elements of an invoice. However, it lacks explicit identifiers like \u0027Invoice Number\u0027 or \u0027Seller Name,\u0027 which reduces confidence slightly.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document includes a fee amount, a payment confirmation, and a date, which are typical elements of an invoice. However, it lacks explicit identifiers like \u0027Invoice Number\u0027 or \u0027Seller Name,\u0027 which reduces confidence slightly.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": \"14/11/25\",\n        \"total_amount\": \"\u00a3150.00\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "uncertain",
        "pattern_based": {
          "confidence": 0.015,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "payroll_statement"
        }
      },
      "page_number": 15,
      "text_length": 278
    },
    {
      "confidence_score": 0.7,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.7,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document mentions a payment received for a performance, which aligns with the structure of an invoice. It includes a fee, payment amount, and date, which are typical elements of an invoice. However, it lacks explicit terms like \u0027invoice number\u0027 or \u0027seller name,\u0027 reducing confidence slightly.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": \"12/11/25\",\n        \"total_amount\": \"\u00a35200\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13NIkVieUe35dWWMXlJVGoJd1rr\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.7,\\n    \"reasoning\": \"The document mentions a payment received for a performance, which aligns with the structure of an invoice. It includes a fee, payment amount, and date, which are typical elements of an invoice. However, it lacks explicit terms like \\\u0027invoice number\\\u0027 or \\\u0027seller name,\\\u0027 reducing confidence slightly.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": \"12/11/25\",\\n        \"total_amount\": \"\u00a35200\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761245, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=227, prompt_tokens=1109, total_tokens=1336, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prom"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "12/11/25",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": "\u00a35200"
            },
            "llm_reasoning": "The document mentions a payment received for a performance, which aligns with the structure of an invoice. It includes a fee, payment amount, and date, which are typical elements of an invoice. However, it lacks explicit terms like \u0027invoice number\u0027 or \u0027seller name,\u0027 reducing confidence slightly.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.7,\n    \"reasoning\": \"The document mentions a payment received for a performance, which aligns with the structure of an invoice. It includes a fee, payment amount, and date, which are typical elements of an invoice. However, it lacks explicit terms like \u0027invoice number\u0027 or \u0027seller name,\u0027 reducing confidence slightly.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": \"12/11/25\",\n        \"total_amount\": \"\u00a35200\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "uncertain",
        "pattern_based": {
          "confidence": 0.015,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "payroll_statement"
        }
      },
      "page_number": 16,
      "text_length": 294
    },
    {
      "confidence_score": 0.95,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Sold by\u0027, \u0027Billing address\u0027, \u0027Delivery address\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB58OSCKJAEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"07 November 2025\",\n        \"total_amount\": \"\u00a34.74\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13PgRRAsD1w5ccafP534tSC8X2n\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Sold by\\\u0027, \\\u0027Billing address\\\u0027, \\\u0027Delivery address\\\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"GB58OSCKJAEUI\",\\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\\n        \"invoice_date\": \"07 November 2025\",\\n        \"total_amount\": \"\u00a34.74\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761247, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=239, prompt_tokens=1561, total_tokens=1800, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "07 November 2025",
              "invoice_number": "GB58OSCKJAEUI",
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Amazon EU S.\u00e0 r.l ., UK Branch",
              "statement_period": null,
              "total_amount": "\u00a34.74"
            },
            "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Sold by\u0027, \u0027Billing address\u0027, \u0027Delivery address\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Sold by\u0027, \u0027Billing address\u0027, \u0027Delivery address\u0027, and itemized details with VAT and totals. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB58OSCKJAEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"07 November 2025\",\n        \"total_amount\": \"\u00a34.74\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.23333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.3888888888888889,
              "pattern_score": 0.0,
              "total_score": 0.23333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.16666666666666666,
              "pattern_score": 0.0,
              "total_score": 0.13
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 17,
      "text_length": 1660
    },
    {
      "confidence_score": 0.95,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice date\u0027, \u0027Invoice #\u0027, \u0027Total payable\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5809X12AEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"06 November 2025\",\n        \"total_amount\": \"\u00a311.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13QgO924xaGqRxvRHD40fO8aE5x\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Total payable\\\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"GB5809X12AEUI\",\\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\\n        \"invoice_date\": \"06 November 2025\",\\n        \"total_amount\": \"\u00a311.56\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761248, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=247, prompt_tokens=1620, total_tokens=1867, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens="
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "06 November 2025",
              "invoice_number": "GB5809X12AEUI",
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Amazon EU S.\u00e0 r.l ., UK Branch",
              "statement_period": null,
              "total_amount": "\u00a311.56"
            },
            "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice date\u0027, \u0027Invoice #\u0027, \u0027Total payable\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice date\u0027, \u0027Invoice #\u0027, \u0027Total payable\u0027, and itemized descriptions with quantities, unit prices, VAT rates, and totals. Additionally, it includes a seller name, billing and delivery addresses, and payment reference details.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5809X12AEUI\",\n        \"seller_name\": \"Amazon EU S.\u00e0 r.l ., UK Branch\",\n        \"invoice_date\": \"06 November 2025\",\n        \"total_amount\": \"\u00a311.56\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.23333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.3888888888888889,
              "pattern_score": 0.0,
              "total_score": 0.23333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.16666666666666666,
              "pattern_score": 0.0,
              "total_score": 0.13
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 18,
      "text_length": 1858
    },
    {
      "confidence_score": 0.95,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978253\",\n        \"seller_name\": \"Fruit Fly Ninja B.V.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a311.39\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13TuY5g7r99fdv5FVrJpU15SxR1\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Total payable\\\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978253\",\\n        \"seller_name\": \"Fruit Fly Ninja B.V.\",\\n        \"invoice_date\": \"06.11.2025\",\\n        \"total_amount\": \"\u00a311.39\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761251, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=238, prompt_tokens=1527, total_tokens=1765, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_det"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "06.11.2025",
              "invoice_number": "DS-AEU-INV-GB-2025-620978253",
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Fruit Fly Ninja B.V.",
              "statement_period": null,
              "total_amount": "\u00a311.39"
            },
            "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and details about the seller, buyer, and itemized charges. These are key characteristics of an invoice document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978253\",\n        \"seller_name\": \"Fruit Fly Ninja B.V.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a311.39\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.23333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.3888888888888889,
              "pattern_score": 0.0,
              "total_score": 0.23333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 19,
      "text_length": 1515
    },
    {
      "confidence_score": 0.95,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as the presence of an \u0027Invoice #\u0027 (DS-AEU-INV-GB-2025-620978309), \u0027Invoice date\u0027 (06.11.2025), \u0027Total payable\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978309\",\n        \"seller_name\": \"DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a322.78\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13UAdAxusCzsJnae6PIafFKJZef\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as the presence of an \\\u0027Invoice #\\\u0027 (DS-AEU-INV-GB-2025-620978309), \\\u0027Invoice date\\\u0027 (06.11.2025), \\\u0027Total payable\\\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978309\",\\n        \"seller_name\": \"DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.\",\\n        \"invoice_date\": \"06.11.2025\",\\n        \"total_amount\": \"\u00a322.78\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761252, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=287, prompt_tokens=1556, total_tokens=1843, completion_tokens_detai"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "06.11.2025",
              "invoice_number": "DS-AEU-INV-GB-2025-620978309",
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.",
              "statement_period": null,
              "total_amount": "\u00a322.78"
            },
            "llm_reasoning": "The document contains clear indicators of an invoice, such as the presence of an \u0027Invoice #\u0027 (DS-AEU-INV-GB-2025-620978309), \u0027Invoice date\u0027 (06.11.2025), \u0027Total payable\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as the presence of an \u0027Invoice #\u0027 (DS-AEU-INV-GB-2025-620978309), \u0027Invoice date\u0027 (06.11.2025), \u0027Total payable\u0027 (\u00a322.78), and details about the seller and buyer. Additionally, it includes itemized descriptions, quantities, unit prices, VAT rates, and totals, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"DS-AEU-INV-GB-2025-620978309\",\n        \"seller_name\": \"DONGGUAN EAGLE SMART HOME TECHNOLOGY CO ., LTD.\",\n        \"invoice_date\": \"06.11.2025\",\n        \"total_amount\": \"\u00a322.78\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.23333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.3888888888888889,
              "pattern_score": 0.0,
              "total_score": 0.23333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.16666666666666666,
              "pattern_score": 0.0,
              "total_score": 0.13
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 20,
      "text_length": 1572
    },
    {
      "confidence_score": 0.95,
      "document_type": "invoice",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5008X55Z04FI\",\n        \"seller_name\": \"Take Way Supplies Limited\",\n        \"invoice_date\": \"05 November 2025\",\n        \"total_amount\": \"\u00a314.99\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DX13XQWu4FSGRzMVSBfgN0XIjhiiZ\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \\\u0027Invoice\\\u0027, \\\u0027Invoice #\\\u0027, \\\u0027Invoice date\\\u0027, \\\u0027Total payable\\\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"GB5008X55Z04FI\",\\n        \"seller_name\": \"Take Way Supplies Limited\",\\n        \"invoice_date\": \"05 November 2025\",\\n        \"total_amount\": \"\u00a314.99\",\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776761255, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=1373, total_tokens=1615, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_to"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "05 November 2025",
              "invoice_number": "GB5008X55Z04FI",
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Take Way Supplies Limited",
              "statement_period": null,
              "total_amount": "\u00a314.99"
            },
            "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains clear indicators of an invoice, such as \u0027Invoice\u0027, \u0027Invoice #\u0027, \u0027Invoice date\u0027, \u0027Total payable\u0027, and itemized details including description, quantity, unit price, VAT rate, and totals. Additionally, it includes billing and delivery addresses, as well as a seller name.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"GB5008X55Z04FI\",\n        \"seller_name\": \"Take Way Supplies Limited\",\n        \"invoice_date\": \"05 November 2025\",\n        \"total_amount\": \"\u00a314.99\",\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.23333333333333334,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.3888888888888889,
              "pattern_score": 0.0,
              "total_score": 0.23333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 21,
      "text_length": 1058
    }
  ],
  "processing_timestamp": "2026-04-21T08:47:36.520484"
}