Merged PDF Processing Results

Back to Dashboard
PDF Information
Original Filename: Plan.com_-_68.20.pdf
Upload Date: August 14, 2026 at 12:10 PM
Total Pages: 6
Processing Status: Partial
Extraction Summary
Total Documents: 5
Invoices: 3
Bank Statements: 2
Page Classification Results
Page 1

Invoice

95%
Page 2

Invoice

90%
Page 3

Invoice

90%
Page 4

Bank Statement

90%
Page 5

Bank Statement

95%
Page 6

Bank Statement

90%
Extracted Documents 5
Document Type Pages Confidence Processing Status Created Actions
Invoice 1 (1 page) 95% Failed 2026-08-14 12:10 Processing...
Invoice 2 (1 page) 95% Failed 2026-08-14 12:10 Processing...
Invoice 3 (1 page) 95% Failed 2026-08-14 12:10 Processing...
Bank Statement 4-5 (2 pages) 95% Processed 2026-08-14 12:10 View
Bank Statement 6 (1 page) 95% Processed 2026-08-14 12:11 View
{
  "document_groups": [
    {
      "avg_confidence": 0.95,
      "document_identifiers": {
        "invoice_date": "01/06/2026",
        "invoice_number": "IN-492296-202606-34886-1",
        "seller_name": "T.T BUILDING SERVICES LIMITED",
        "statement_period": null
      },
      "document_type": "invoice",
      "end_page": 1,
      "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 reference\u0027, \u0027issue date\u0027, \u0027due date\u0027, \u0027total\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"IN-492296-202606-34886-1\",\n        \"seller_name\": \"T.T BUILDING SERVICES LIMITED\",\n        \"invoice_date\": \"01/06/2026\",\n        \"statement_period\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl221XYGrhr2Npb3epLW2oKulhw4\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 reference\\\u0027, \\\u0027issue date\\\u0027, \\\u0027due date\\\u0027, \\\u0027total\\\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, which are typical of invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"IN-492296-202606-34886-1\",\\n        \"seller_name\": \"T.T BUILDING SERVICES LIMITED\",\\n        \"invoice_date\": \"01/06/2026\",\\n        \"statement_period\": 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=1786709434, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=139, prompt_tokens=1015, total_tokens=1154, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 6, \u0027engine_ttft_ms\u0027: 82, \u0027engine_ttlt_ms\u0027: 955, \u0027pre_inference_ms\u0027: 78, \u0027service_tbt_ms\u0027: 6, \u0027service_ttft_ms\u0027: 181, \u0027service_ttlt_ms\u0027: 1050, \u0027total_duration_ms\u0027: 980, \u0027user_visible_ttft_ms\u0027: 103}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak\u0027: "
                },
                "document_identifiers": {
                  "invoice_date": "01/06/2026",
                  "invoice_number": "IN-492296-202606-34886-1",
                  "seller_name": "T.T BUILDING SERVICES LIMITED",
                  "statement_period": null
                },
                "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027invoice reference\u0027, \u0027issue date\u0027, \u0027due date\u0027, \u0027total\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, 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 \u0027invoice reference\u0027, \u0027issue date\u0027, \u0027due date\u0027, \u0027total\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"IN-492296-202606-34886-1\",\n        \"seller_name\": \"T.T BUILDING SERVICES LIMITED\",\n        \"invoice_date\": \"01/06/2026\",\n        \"statement_period\": null\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.21666666666666667,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.17647058823529413,
                  "pattern_score": 0.0,
                  "total_score": 0.10588235294117648
                },
                "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.2777777777777778,
                  "pattern_score": 0.125,
                  "total_score": 0.21666666666666667
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.02526315789473684
                },
                "nominal_ledger": {
                  "keyword_score": 0.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "payroll": {
                  "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": 1,
          "text_length": 2167
        }
      ],
      "start_page": 1
    },
    {
      "avg_confidence": 0.9,
      "document_identifiers": {
        "invoice_date": null,
        "invoice_number": null,
        "seller_name": "Plan Communications Ltd",
        "statement_period": "01/06/2026 - 30/06/2026"
      },
      "document_type": "invoice",
      "end_page": 3,
      "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 key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl23MYtq6fI5aiILb3sALPHubfwH\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 key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Plan Communications Ltd\",\\n        \"invoice_date\": null,\\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\\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=1786709435, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=150, prompt_tokens=591, total_tokens=741, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 12, \u0027engine_ttft_ms\u0027: 64, \u0027engine_ttlt_ms\u0027: 1867, \u0027pre_inference_ms\u0027: 88, \u0027service_tbt_ms\u0027: 12, \u0027service_ttft_ms\u0027: 177, \u0027service_ttlt_ms\u0027: 1978, \u0027total_duration_ms\u0027: 1922, \u0027user_visible_ttft_ms\u0027: 88}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, "
                },
                "document_identifiers": {
                  "invoice_date": null,
                  "invoice_number": null,
                  "seller_name": "Plan Communications Ltd",
                  "statement_period": "01/06/2026 - 30/06/2026"
                },
                "llm_reasoning": "The document contains key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.065,
              "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.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "payroll": {
                  "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": "nominal_ledger"
            }
          },
          "page_number": 2,
          "text_length": 804
        },
        {
          "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 key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl25lKvD5e7AZjsHZSsYAvGYn3X0\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 key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Plan Communications Ltd\",\\n        \"invoice_date\": null,\\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\\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=1786709437, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=131, prompt_tokens=559, total_tokens=690, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 10, \u0027engine_ttft_ms\u0027: 74, \u0027engine_ttlt_ms\u0027: 1326, \u0027pre_inference_ms\u0027: 75, \u0027service_tbt_ms\u0027: 10, \u0027service_ttft_ms\u0027: 173, \u0027service_ttlt_ms\u0027: 1422, \u0027total_duration_ms\u0027: 1353, \u0027user_visible_ttft_ms\u0027: 98}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak\u0027: {\u0027detected\u0027: Fa"
                },
                "document_identifiers": {
                  "invoice_date": null,
                  "invoice_number": null,
                  "seller_name": "Plan Communications Ltd",
                  "statement_period": "01/06/2026 - 30/06/2026"
                },
                "llm_reasoning": "The document contains key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.",
                "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```"
              },
              "type": "invoice"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.065,
              "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.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "payroll": {
                  "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": "nominal_ledger"
            }
          },
          "page_number": 3,
          "text_length": 695
        }
      ],
      "start_page": 2
    },
    {
      "avg_confidence": 0.9166666666666666,
      "document_identifiers": {
        "invoice_date": null,
        "invoice_number": null,
        "seller_name": null,
        "statement_period": "01/05/26 to 03/05/26"
      },
      "document_type": "bank_statement",
      "end_page": 6,
      "pages": [
        {
          "confidence_score": 0.9,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 0.9,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"01/05/26 to 03/05/26\"\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl27Ormzz1uKuzjzQtRwO0Abf1Xb\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"statement_period\": \"01/05/26 to 03/05/26\"\\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=1786709439, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=130, prompt_tokens=2115, total_tokens=2245, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 7, \u0027engine_ttft_ms\u0027: 149, \u0027engine_ttlt_ms\u0027: 1047, \u0027pre_inference_ms\u0027: 67, \u0027service_tbt_ms\u0027: 7, \u0027service_ttft_ms\u0027: 238, \u0027service_ttlt_ms\u0027: 1133, \u0027total_duration_ms\u0027: 1071, \u0027user_visible_ttft_ms\u0027: 171}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak\u0027: {\u0027detected\u0027: False, \u0027fil"
                },
                "document_identifiers": {
                  "invoice_date": null,
                  "invoice_number": null,
                  "seller_name": null,
                  "statement_period": "01/05/26 to 03/05/26"
                },
                "llm_reasoning": "The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"01/05/26 to 03/05/26\"\n    }\n}\n```"
              },
              "type": "bank_statement"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.065,
              "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.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "payroll": {
                  "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": "nominal_ledger"
            }
          },
          "page_number": 4,
          "text_length": 10786
        },
        {
          "confidence_score": 0.95,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 0.95,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"14/05/26 to 19/05/26\"\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl28fBZpXqy4NTt7u7uKyy0oklwi\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"statement_period\": \"14/05/26 to 19/05/26\"\\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=1786709440, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=142, prompt_tokens=2115, total_tokens=2257, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 7, \u0027engine_ttft_ms\u0027: 128, \u0027engine_ttlt_ms\u0027: 1120, \u0027pre_inference_ms\u0027: 88, \u0027service_tbt_ms\u0027: 7, \u0027service_ttft_ms\u0027: 249, \u0027service_ttlt_ms\u0027: 1237, \u0027total_duration_ms\u0027: 1156, \u0027user_visible_ttft_ms\u0027: 161}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filte"
                },
                "document_identifiers": {
                  "invoice_date": null,
                  "invoice_number": null,
                  "seller_name": null,
                  "statement_period": "14/05/26 to 19/05/26"
                },
                "llm_reasoning": "The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"14/05/26 to 19/05/26\"\n    }\n}\n```"
              },
              "type": "bank_statement"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.065,
              "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.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "payroll": {
                  "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": "nominal_ledger"
            }
          },
          "page_number": 5,
          "text_length": 10638
        },
        {
          "confidence_score": 0.9,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 0.9,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"28/05/26 to 31/05/26\"\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl2Aq4M6uxyW1IevHlVDmiaDMyVP\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"statement_period\": \"28/05/26 to 31/05/26\"\\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=1786709442, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=136, prompt_tokens=2115, total_tokens=2251, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 8, \u0027engine_ttft_ms\u0027: 124, \u0027engine_ttlt_ms\u0027: 1165, \u0027pre_inference_ms\u0027: 90, \u0027service_tbt_ms\u0027: 8, \u0027service_ttft_ms\u0027: 272, \u0027service_ttlt_ms\u0027: 1276, \u0027total_duration_ms\u0027: 1194, \u0027user_visible_ttft_ms\u0027: 182}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027"
                },
                "document_identifiers": {
                  "invoice_date": null,
                  "invoice_number": null,
                  "seller_name": null,
                  "statement_period": "28/05/26 to 31/05/26"
                },
                "llm_reasoning": "The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"28/05/26 to 31/05/26\"\n    }\n}\n```"
              },
              "type": "bank_statement"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.065,
              "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.08333333333333333,
                  "pattern_score": 0.0,
                  "total_score": 0.065
                },
                "payroll": {
                  "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": "nominal_ledger"
            }
          },
          "page_number": 6,
          "text_length": 3486
        }
      ],
      "start_page": 4
    }
  ],
  "page_classifications": [
    {
      "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 reference\u0027, \u0027issue date\u0027, \u0027due date\u0027, \u0027total\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"IN-492296-202606-34886-1\",\n        \"seller_name\": \"T.T BUILDING SERVICES LIMITED\",\n        \"invoice_date\": \"01/06/2026\",\n        \"statement_period\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl221XYGrhr2Npb3epLW2oKulhw4\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 reference\\\u0027, \\\u0027issue date\\\u0027, \\\u0027due date\\\u0027, \\\u0027total\\\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, which are typical of invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": \"IN-492296-202606-34886-1\",\\n        \"seller_name\": \"T.T BUILDING SERVICES LIMITED\",\\n        \"invoice_date\": \"01/06/2026\",\\n        \"statement_period\": 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=1786709434, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=139, prompt_tokens=1015, total_tokens=1154, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 6, \u0027engine_ttft_ms\u0027: 82, \u0027engine_ttlt_ms\u0027: 955, \u0027pre_inference_ms\u0027: 78, \u0027service_tbt_ms\u0027: 6, \u0027service_ttft_ms\u0027: 181, \u0027service_ttlt_ms\u0027: 1050, \u0027total_duration_ms\u0027: 980, \u0027user_visible_ttft_ms\u0027: 103}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak\u0027: "
            },
            "document_identifiers": {
              "invoice_date": "01/06/2026",
              "invoice_number": "IN-492296-202606-34886-1",
              "seller_name": "T.T BUILDING SERVICES LIMITED",
              "statement_period": null
            },
            "llm_reasoning": "The document contains clear indicators of an invoice, such as \u0027invoice reference\u0027, \u0027issue date\u0027, \u0027due date\u0027, \u0027total\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, 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 \u0027invoice reference\u0027, \u0027issue date\u0027, \u0027due date\u0027, \u0027total\u0027, and VAT details. Additionally, it includes a breakdown of charges and payment terms, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": \"IN-492296-202606-34886-1\",\n        \"seller_name\": \"T.T BUILDING SERVICES LIMITED\",\n        \"invoice_date\": \"01/06/2026\",\n        \"statement_period\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.21666666666666667,
          "features": {
            "bank_statement": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.0,
              "total_score": 0.10588235294117648
            },
            "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.2777777777777778,
              "pattern_score": 0.125,
              "total_score": 0.21666666666666667
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.02526315789473684
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "payroll": {
              "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": 1,
      "text_length": 2167
    },
    {
      "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 key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl23MYtq6fI5aiILb3sALPHubfwH\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 key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Plan Communications Ltd\",\\n        \"invoice_date\": null,\\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\\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=1786709435, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=150, prompt_tokens=591, total_tokens=741, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 12, \u0027engine_ttft_ms\u0027: 64, \u0027engine_ttlt_ms\u0027: 1867, \u0027pre_inference_ms\u0027: 88, \u0027service_tbt_ms\u0027: 12, \u0027service_ttft_ms\u0027: 177, \u0027service_ttlt_ms\u0027: 1978, \u0027total_duration_ms\u0027: 1922, \u0027user_visible_ttft_ms\u0027: 88}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, "
            },
            "document_identifiers": {
              "invoice_date": null,
              "invoice_number": null,
              "seller_name": "Plan Communications Ltd",
              "statement_period": "01/06/2026 - 30/06/2026"
            },
            "llm_reasoning": "The document contains key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as rental charges, extras, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical of invoices. No account numbers, transaction details, or balances indicative of a bank statement are present.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.065,
          "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.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "payroll": {
              "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": "nominal_ledger"
        }
      },
      "page_number": 2,
      "text_length": 804
    },
    {
      "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 key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl25lKvD5e7AZjsHZSsYAvGYn3X0\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 key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Plan Communications Ltd\",\\n        \"invoice_date\": null,\\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\\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=1786709437, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=131, prompt_tokens=559, total_tokens=690, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 10, \u0027engine_ttft_ms\u0027: 74, \u0027engine_ttlt_ms\u0027: 1326, \u0027pre_inference_ms\u0027: 75, \u0027service_tbt_ms\u0027: 10, \u0027service_ttft_ms\u0027: 173, \u0027service_ttlt_ms\u0027: 1422, \u0027total_duration_ms\u0027: 1353, \u0027user_visible_ttft_ms\u0027: 98}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak\u0027: {\u0027detected\u0027: Fa"
            },
            "document_identifiers": {
              "invoice_date": null,
              "invoice_number": null,
              "seller_name": "Plan Communications Ltd",
              "statement_period": "01/06/2026 - 30/06/2026"
            },
            "llm_reasoning": "The document contains key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains key indicators of an invoice, such as rental charges, usage charges, a total amount, and a statement period. It also includes a company name (Plan Communications Ltd) and VAT information, which are typical for invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Plan Communications Ltd\",\n        \"invoice_date\": null,\n        \"statement_period\": \"01/06/2026 - 30/06/2026\"\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.065,
          "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.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "payroll": {
              "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": "nominal_ledger"
        }
      },
      "page_number": 3,
      "text_length": 695
    },
    {
      "confidence_score": 0.9,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 0.9,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"01/05/26 to 03/05/26\"\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl27Ormzz1uKuzjzQtRwO0Abf1Xb\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"statement_period\": \"01/05/26 to 03/05/26\"\\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=1786709439, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=130, prompt_tokens=2115, total_tokens=2245, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 7, \u0027engine_ttft_ms\u0027: 149, \u0027engine_ttlt_ms\u0027: 1047, \u0027pre_inference_ms\u0027: 67, \u0027service_tbt_ms\u0027: 7, \u0027service_ttft_ms\u0027: 238, \u0027service_ttlt_ms\u0027: 1133, \u0027total_duration_ms\u0027: 1071, \u0027user_visible_ttft_ms\u0027: 171}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak\u0027: {\u0027detected\u0027: False, \u0027fil"
            },
            "document_identifiers": {
              "invoice_date": null,
              "invoice_number": null,
              "seller_name": null,
              "statement_period": "01/05/26 to 03/05/26"
            },
            "llm_reasoning": "The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed usage data, including dates, times, phone numbers, and costs, which are typical of a mobile usage or account statement. There are no indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"01/05/26 to 03/05/26\"\n    }\n}\n```"
          },
          "type": "bank_statement"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.065,
          "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.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "payroll": {
              "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": "nominal_ledger"
        }
      },
      "page_number": 4,
      "text_length": 10786
    },
    {
      "confidence_score": 0.95,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"14/05/26 to 19/05/26\"\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl28fBZpXqy4NTt7u7uKyy0oklwi\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"statement_period\": \"14/05/26 to 19/05/26\"\\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=1786709440, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=142, prompt_tokens=2115, total_tokens=2257, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 7, \u0027engine_ttft_ms\u0027: 128, \u0027engine_ttlt_ms\u0027: 1120, \u0027pre_inference_ms\u0027: 88, \u0027service_tbt_ms\u0027: 7, \u0027service_ttft_ms\u0027: 249, \u0027service_ttlt_ms\u0027: 1237, \u0027total_duration_ms\u0027: 1156, \u0027user_visible_ttft_ms\u0027: 161}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filte"
            },
            "document_identifiers": {
              "invoice_date": null,
              "invoice_number": null,
              "seller_name": null,
              "statement_period": "14/05/26 to 19/05/26"
            },
            "llm_reasoning": "The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains detailed records of transactions, including dates, times, phone numbers, usage types, origins, and costs. These are indicative of a usage or transaction statement, similar to a bank statement. There are no clear indicators of an invoice, such as an invoice number, seller name, or payment terms.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"14/05/26 to 19/05/26\"\n    }\n}\n```"
          },
          "type": "bank_statement"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.065,
          "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.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "payroll": {
              "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": "nominal_ledger"
        }
      },
      "page_number": 5,
      "text_length": 10638
    },
    {
      "confidence_score": 0.9,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 0.9,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"28/05/26 to 31/05/26\"\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-ECl2Aq4M6uxyW1IevHlVDmiaDMyVP\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"statement_period\": \"28/05/26 to 31/05/26\"\\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=1786709442, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_85fa909971\u0027, usage=CompletionUsage(completion_tokens=136, prompt_tokens=2115, total_tokens=2251, 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=0), latency_checkpoint={\u0027engine_tbt_ms\u0027: 8, \u0027engine_ttft_ms\u0027: 124, \u0027engine_ttlt_ms\u0027: 1165, \u0027pre_inference_ms\u0027: 90, \u0027service_tbt_ms\u0027: 8, \u0027service_ttft_ms\u0027: 272, \u0027service_ttlt_ms\u0027: 1276, \u0027total_duration_ms\u0027: 1194, \u0027user_visible_ttft_ms\u0027: 182}), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027"
            },
            "document_identifiers": {
              "invoice_date": null,
              "invoice_number": null,
              "seller_name": null,
              "statement_period": "28/05/26 to 31/05/26"
            },
            "llm_reasoning": "The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains detailed records of usage, including dates, times, phone numbers, call durations, and costs. These are indicative of a statement of account activity rather than an invoice. There are no invoice numbers, seller names, or payment terms present, which are typical of invoices.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"statement_period\": \"28/05/26 to 31/05/26\"\n    }\n}\n```"
          },
          "type": "bank_statement"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.065,
          "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.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "payroll": {
              "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": "nominal_ledger"
        }
      },
      "page_number": 6,
      "text_length": 3486
    }
  ],
  "processing_timestamp": "2026-08-14T12:10:43.564489"
}