| Original Filename: | VAT_return_detail_1775543704.pdf |
| Upload Date: | April 07, 2026 at 07:40 AM |
| Total Pages: | 7 |
| Processing Status: | Failed |
| Total Documents: | 0 |
Unknown
13%Invoice
85%Invoice
85%Invoice
90%Nominal Ledger
95%Invoice
85%Unknown
80%{
"document_groups": [
{
"avg_confidence": 0.85,
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "25/03/2025",
"invoice_number": "ITUKDN1104787751",
"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": "HP Instant Ink",
"statement_period": null,
"total_amount": "9.99"
},
"document_type": "invoice",
"end_page": 2,
"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 multiple references to \u0027Bill\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \u0027Bill\u0027, \u0027NO.\u0027, \u0027NAME\u0027, \u0027VAT\u0027, and \u0027AMOUNT\u0027 further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"ITUKDN1104787751\",\n \"seller_name\": \"HP Instant Ink\",\n \"invoice_date\": \"25/03/2025\",\n \"total_amount\": \"9.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-DRvL3ZGumiKq9BptaPac9BMvfwnQD\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 multiple references to \\\u0027Bill\\\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \\\u0027Bill\\\u0027, \\\u0027NO.\\\u0027, \\\u0027NAME\\\u0027, \\\u0027VAT\\\u0027, and \\\u0027AMOUNT\\\u0027 further supports this classification.\",\\n \"document_identifiers\": {\\n \"invoice_number\": \"ITUKDN1104787751\",\\n \"seller_name\": \"HP Instant Ink\",\\n \"invoice_date\": \"25/03/2025\",\\n \"total_amount\": \"9.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=1775547637, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=255, prompt_tokens=2608, total_tokens=2863, completion_tokens_details=CompletionTokensDetails"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "25/03/2025",
"invoice_number": "ITUKDN1104787751",
"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": "HP Instant Ink",
"statement_period": null,
"total_amount": "9.99"
},
"llm_reasoning": "The document contains multiple references to \u0027Bill\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \u0027Bill\u0027, \u0027NO.\u0027, \u0027NAME\u0027, \u0027VAT\u0027, and \u0027AMOUNT\u0027 further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains multiple references to \u0027Bill\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \u0027Bill\u0027, \u0027NO.\u0027, \u0027NAME\u0027, \u0027VAT\u0027, and \u0027AMOUNT\u0027 further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"ITUKDN1104787751\",\n \"seller_name\": \"HP Instant Ink\",\n \"invoice_date\": \"25/03/2025\",\n \"total_amount\": \"9.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": "llm_preferred",
"pattern_based": {
"confidence": 0.13,
"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.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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"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": "nominal_ledger"
}
},
"page_number": 2,
"text_length": 5351
}
],
"start_page": 2
},
{
"avg_confidence": 0.85,
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "01/05/2025",
"invoice_number": "INV1485089",
"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": "Stephensons",
"statement_period": null,
"total_amount": "1,442.23"
},
"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 multiple references to \u0027Bill\u0027, \u0027Invoice\u0027, and \u0027INV\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"INV1485089\",\n \"seller_name\": \"Stephensons\",\n \"invoice_date\": \"01/05/2025\",\n \"total_amount\": \"1,442.23\",\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-DRvL5NSyddTvOqVjTdk0BYOgxbI35\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 multiple references to \\\u0027Bill\\\u0027, \\\u0027Invoice\\\u0027, and \\\u0027INV\\\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.\",\\n \"document_identifiers\": {\\n \"invoice_number\": \"INV1485089\",\\n \"seller_name\": \"Stephensons\",\\n \"invoice_date\": \"01/05/2025\",\\n \"total_amount\": \"1,442.23\",\\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=1775547639, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=2638, total_tokens=2880, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, r"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "01/05/2025",
"invoice_number": "INV1485089",
"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": "Stephensons",
"statement_period": null,
"total_amount": "1,442.23"
},
"llm_reasoning": "The document contains multiple references to \u0027Bill\u0027, \u0027Invoice\u0027, and \u0027INV\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains multiple references to \u0027Bill\u0027, \u0027Invoice\u0027, and \u0027INV\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"INV1485089\",\n \"seller_name\": \"Stephensons\",\n \"invoice_date\": \"01/05/2025\",\n \"total_amount\": \"1,442.23\",\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.13333333333333333,
"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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.2222222222222222,
"pattern_score": 0.0,
"total_score": 0.13333333333333333
},
"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": 3,
"text_length": 5430
}
],
"start_page": 3
},
{
"avg_confidence": 0.9,
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025",
"invoice_number": "1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156",
"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": "Contemporary Cafe Bars Ltd",
"statement_period": null,
"total_amount": "82,880.74"
},
"document_type": "invoice",
"end_page": 4,
"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 multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025\",\n \"total_amount\": \"82,880.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-DRvL7kZICv0LAqGtQUbfP203BYUYB\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 multiple entries labeled as \\\u0027Invoice\\\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.\",\\n \"document_identifiers\": {\\n \"invoice_number\": \"1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025\",\\n \"total_amount\": \"82,880.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=1775547641, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=354, prompt_tokens=249"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025",
"invoice_number": "1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156",
"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": "Contemporary Cafe Bars Ltd",
"statement_period": null,
"total_amount": "82,880.74"
},
"llm_reasoning": "The document contains multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.9,\n \"reasoning\": \"The document contains multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025\",\n \"total_amount\": \"82,880.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.13333333333333333,
"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.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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.2222222222222222,
"pattern_score": 0.0,
"total_score": 0.13333333333333333
},
"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": 4,
"text_length": 4567
}
],
"start_page": 4
},
{
"avg_confidence": 0.95,
"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": "nominal_ledger",
"end_page": 5,
"pages": [
{
"confidence_score": 0.95,
"document_type": "nominal_ledger",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"nominal_ledger\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.\",\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-DRvLAdS3sajC6ySnLkjmntIZfjgDj\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"nominal_ledger\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.\",\\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=1775547644, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=245, prompt_tokens=2553, total_tokens=2798, completion_tokens_details=Co"
},
"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 a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.",
"raw_response": "```json\n{\n \"document_type\": \"nominal_ledger\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.\",\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": "nominal_ledger"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.13,
"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.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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"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": "nominal_ledger"
}
},
"page_number": 5,
"text_length": 4616
}
],
"start_page": 5
},
{
"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": "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 multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.\",\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-DRvLCWmo6Cfq4XZWAmBE2uAprmfzj\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 multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.\",\\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=1775547646, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=245, prompt_tokens=2548, total_tokens=2793, completion_tokens_details=CompletionTokensDetails(accepted_pre"
},
"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 multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.\",\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": "invoice"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.13,
"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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.16666666666666666,
"pattern_score": 0.0,
"total_score": 0.09999999999999999
},
"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": "nominal_ledger"
}
},
"page_number": 6,
"text_length": 4618
}
],
"start_page": 6
}
],
"page_classifications": [
{
"confidence_score": 0.13333333333333333,
"document_type": "unknown",
"features": {
"llm_based": {
"confidence": 0.0,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.9,\n \"reasoning\": \"The document contains multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, VAT details, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT codes, rates, and amounts further supports the classification as an invoice document.\",\n \"document_identifiers\": [\n {\n \"invoice_number\": \"1143\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"02/03/2025\",\n \"total_amount\": \"1951.08\"\n },\n {\n \"invoice_number\": \"1144\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"09/03/2025\",\n \"total_amount\": \"5371.69\"\n },\n {\n \"invoice_number\": \"1145\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"16/03/2025\",\n \"total_amount\": \"5331.66\"\n },\n {\n \"invoice_number\": \"1146\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"23/03/2025\",\n \"total_amount\": \"5819.60\"\n },\n {\n \"invoice_number\": \"1147\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"30/03/2025\",\n \"total_amount\": \"6658.98\"\n },\n {\n \"invoice_number\": \"1150\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"06/04/2025\",\n \"total_amount\": \"6074.00\"\n },\n {\n \"invoice_number\": \"1148\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"13/04/2025\",\n \"total_amount\": \"6125.91\"\n },\n {\n \"invoice_number\": \"1149\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"20/04/2025\",\n \"total_amount\": \"6093.08\"\n },\n {\n \"invoice_nu",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-DRvL1Yu0DqKwzADMkVd7HBtfH7AgY\u0027, choices=[Choice(finish_reason=\u0027length\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"invoice\",\\n \"confidence\": 0.9,\\n \"reasoning\": \"The document contains multiple entries labeled as \\\u0027Invoice\\\u0027 with invoice numbers, dates, VAT details, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT codes, rates, and amounts further supports the classification as an invoice document.\",\\n \"document_identifiers\": [\\n {\\n \"invoice_number\": \"1143\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"02/03/2025\",\\n \"total_amount\": \"1951.08\"\\n },\\n {\\n \"invoice_number\": \"1144\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"09/03/2025\",\\n \"total_amount\": \"5371.69\"\\n },\\n {\\n \"invoice_number\": \"1145\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"16/03/2025\",\\n \"total_amount\": \"5331.66\"\\n },\\n {\\n \"invoice_number\": \"1146\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"23/03/2025\",\\n \"total_amount\": \"5819.60\"\\n },\\n {\\n \"invoice_number\": \"1147\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"30/03/2025\",\\n \"total_amount\": \"6658.98\"\\n },\\n {\\n \"invoice_number\": \"1150\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"06/04/2025\",\\n \"total_amount\": \"6074.00\"\\n },\\n {\\n \"invoice_number\": \"1148\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"13/04/2025\",\\n \"total_amount\": \"6125.91\"\\n },\\n {\\n "
},
"error": "Expecting \u0027,\u0027 delimiter: line 53 column 10 (char 1957)",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.9,\n \"reasoning\": \"The document contains multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, VAT details, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT codes, rates, and amounts further supports the classification as an invoice document.\",\n \"document_identifiers\": [\n {\n \"invoice_number\": \"1143\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"02/03/2025\",\n \"total_amount\": \"1951.08\"\n },\n {\n \"invoice_number\": \"1144\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"09/03/2025\",\n \"total_amount\": \"5371.69\"\n },\n {\n \"invoice_number\": \"1145\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"16/03/2025\",\n \"total_amount\": \"5331.66\"\n },\n {\n \"invoice_number\": \"1146\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"23/03/2025\",\n \"total_amount\": \"5819.60\"\n },\n {\n \"invoice_number\": \"1147\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"30/03/2025\",\n \"total_amount\": \"6658.98\"\n },\n {\n \"invoice_number\": \"1150\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"06/04/2025\",\n \"total_amount\": \"6074.00\"\n },\n {\n \"invoice_number\": \"1148\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"13/04/2025\",\n \"total_amount\": \"6125.91\"\n },\n {\n \"invoice_number\": \"1149\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"20/04/2025\",\n \"total_amount\": \"6093.08\"\n },\n {\n \"invoice_number\": \"1151\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd"
},
"type": "unknown"
},
"method_used": "pattern_only",
"pattern_based": {
"confidence": 0.13333333333333333,
"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.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.2222222222222222,
"pattern_score": 0.0,
"total_score": 0.13333333333333333
},
"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": 1,
"text_length": 5378
},
{
"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 multiple references to \u0027Bill\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \u0027Bill\u0027, \u0027NO.\u0027, \u0027NAME\u0027, \u0027VAT\u0027, and \u0027AMOUNT\u0027 further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"ITUKDN1104787751\",\n \"seller_name\": \"HP Instant Ink\",\n \"invoice_date\": \"25/03/2025\",\n \"total_amount\": \"9.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-DRvL3ZGumiKq9BptaPac9BMvfwnQD\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 multiple references to \\\u0027Bill\\\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \\\u0027Bill\\\u0027, \\\u0027NO.\\\u0027, \\\u0027NAME\\\u0027, \\\u0027VAT\\\u0027, and \\\u0027AMOUNT\\\u0027 further supports this classification.\",\\n \"document_identifiers\": {\\n \"invoice_number\": \"ITUKDN1104787751\",\\n \"seller_name\": \"HP Instant Ink\",\\n \"invoice_date\": \"25/03/2025\",\\n \"total_amount\": \"9.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=1775547637, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=255, prompt_tokens=2608, total_tokens=2863, completion_tokens_details=CompletionTokensDetails"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "25/03/2025",
"invoice_number": "ITUKDN1104787751",
"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": "HP Instant Ink",
"statement_period": null,
"total_amount": "9.99"
},
"llm_reasoning": "The document contains multiple references to \u0027Bill\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \u0027Bill\u0027, \u0027NO.\u0027, \u0027NAME\u0027, \u0027VAT\u0027, and \u0027AMOUNT\u0027 further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains multiple references to \u0027Bill\u0027 transactions with details such as transaction numbers, seller names, VAT codes, VAT rates, net amounts, and balances. These are key indicators of an invoice or a collection of invoices. The presence of invoice-like identifiers such as \u0027Bill\u0027, \u0027NO.\u0027, \u0027NAME\u0027, \u0027VAT\u0027, and \u0027AMOUNT\u0027 further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"ITUKDN1104787751\",\n \"seller_name\": \"HP Instant Ink\",\n \"invoice_date\": \"25/03/2025\",\n \"total_amount\": \"9.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": "llm_preferred",
"pattern_based": {
"confidence": 0.13,
"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.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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"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": "nominal_ledger"
}
},
"page_number": 2,
"text_length": 5351
},
{
"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 multiple references to \u0027Bill\u0027, \u0027Invoice\u0027, and \u0027INV\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"INV1485089\",\n \"seller_name\": \"Stephensons\",\n \"invoice_date\": \"01/05/2025\",\n \"total_amount\": \"1,442.23\",\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-DRvL5NSyddTvOqVjTdk0BYOgxbI35\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 multiple references to \\\u0027Bill\\\u0027, \\\u0027Invoice\\\u0027, and \\\u0027INV\\\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.\",\\n \"document_identifiers\": {\\n \"invoice_number\": \"INV1485089\",\\n \"seller_name\": \"Stephensons\",\\n \"invoice_date\": \"01/05/2025\",\\n \"total_amount\": \"1,442.23\",\\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=1775547639, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=2638, total_tokens=2880, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, r"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "01/05/2025",
"invoice_number": "INV1485089",
"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": "Stephensons",
"statement_period": null,
"total_amount": "1,442.23"
},
"llm_reasoning": "The document contains multiple references to \u0027Bill\u0027, \u0027Invoice\u0027, and \u0027INV\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains multiple references to \u0027Bill\u0027, \u0027Invoice\u0027, and \u0027INV\u0027 numbers, along with seller names, VAT codes, VAT rates, net amounts, and total amounts. These are key indicators of an invoice or a collection of invoices. The presence of transaction dates and specific invoice numbers further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"INV1485089\",\n \"seller_name\": \"Stephensons\",\n \"invoice_date\": \"01/05/2025\",\n \"total_amount\": \"1,442.23\",\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.13333333333333333,
"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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.2222222222222222,
"pattern_score": 0.0,
"total_score": 0.13333333333333333
},
"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": 3,
"text_length": 5430
},
{
"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 multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025\",\n \"total_amount\": \"82,880.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-DRvL7kZICv0LAqGtQUbfP203BYUYB\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 multiple entries labeled as \\\u0027Invoice\\\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.\",\\n \"document_identifiers\": {\\n \"invoice_number\": \"1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156\",\\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\\n \"invoice_date\": \"16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025\",\\n \"total_amount\": \"82,880.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=1775547641, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=354, prompt_tokens=249"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": "16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025",
"invoice_number": "1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156",
"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": "Contemporary Cafe Bars Ltd",
"statement_period": null,
"total_amount": "82,880.74"
},
"llm_reasoning": "The document contains multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.9,\n \"reasoning\": \"The document contains multiple entries labeled as \u0027Invoice\u0027 with invoice numbers, dates, and amounts. These are key indicators of an invoice document. Additionally, the presence of VAT details and net amounts further supports this classification.\",\n \"document_identifiers\": {\n \"invoice_number\": \"1145, 1146, 1147, 1150, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156\",\n \"seller_name\": \"Contemporary Cafe Bars Ltd\",\n \"invoice_date\": \"16/03/2025, 23/03/2025, 30/03/2025, 06/04/2025, 13/04/2025, 20/04/2025, 27/04/2025, 04/05/2025, 11/05/2025, 18/05/2025, 25/05/2025, 31/05/2025\",\n \"total_amount\": \"82,880.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.13333333333333333,
"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.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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.2222222222222222,
"pattern_score": 0.0,
"total_score": 0.13333333333333333
},
"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": 4,
"text_length": 4567
},
{
"confidence_score": 0.95,
"document_type": "nominal_ledger",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"nominal_ledger\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.\",\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-DRvLAdS3sajC6ySnLkjmntIZfjgDj\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"nominal_ledger\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.\",\\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=1775547644, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=245, prompt_tokens=2553, total_tokens=2798, completion_tokens_details=Co"
},
"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 a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.",
"raw_response": "```json\n{\n \"document_type\": \"nominal_ledger\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains a detailed list of transactions with fields such as transaction type, memo/description, VAT codes, VAT rates, net amounts, and balances. These are key indicators of a nominal ledger or VAT detail report, which is used for accounting purposes to track financial transactions and VAT details. There are no specific indicators of invoices, payroll, loan, mortgage, or other document types in the provided text.\",\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": "nominal_ledger"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.13,
"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.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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"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": "nominal_ledger"
}
},
"page_number": 5,
"text_length": 4616
},
{
"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 multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.\",\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-DRvLCWmo6Cfq4XZWAmBE2uAprmfzj\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 multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.\",\\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=1775547646, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=245, prompt_tokens=2548, total_tokens=2793, completion_tokens_details=CompletionTokensDetails(accepted_pre"
},
"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 multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.",
"raw_response": "```json\n{\n \"document_type\": \"invoice\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains multiple entries with details such as transaction dates, invoice numbers, seller names, VAT codes, and amounts. These are key indicators of an invoice or a VAT detail report, which is closely related to invoices. The presence of invoice numbers (e.g., INV1485089, INV-16788), seller names (e.g., Lidl, Booker Limited, EDF Energy), and amounts further supports this classification.\",\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": "invoice"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.13,
"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.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.16666666666666666,
"pattern_score": 0.0,
"total_score": 0.09999999999999999
},
"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": "nominal_ledger"
}
},
"page_number": 6,
"text_length": 4618
},
{
"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 is titled \u0027VAT Detail Report\u0027 and includes references to a tax return and an accrual basis, which are indicative of financial reporting. However, it does not contain specific indicators of other categories such as invoices, payroll, or loan/mortgage statements.\",\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-DRvLE4I4dMSn6etbJSuXYvk5VSJ5Y\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 is titled \\\u0027VAT Detail Report\\\u0027 and includes references to a tax return and an accrual basis, which are indicative of financial reporting. However, it does not contain specific indicators of other categories such as invoices, payroll, or loan/mortgage statements.\",\\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=1775547648, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=216, prompt_tokens=1051, total_tokens=1267, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptT"
},
"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 is titled \u0027VAT Detail Report\u0027 and includes references to a tax return and an accrual basis, which are indicative of financial reporting. However, it does not contain specific indicators of other categories such as invoices, payroll, or loan/mortgage statements.",
"raw_response": "```json\n{\n \"document_type\": \"financial_statement\",\n \"confidence\": 0.8,\n \"reasoning\": \"The document is titled \u0027VAT Detail Report\u0027 and includes references to a tax return and an accrual basis, which are indicative of financial reporting. However, it does not contain specific indicators of other categories such as invoices, payroll, or loan/mortgage statements.\",\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.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"property_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "invoice"
}
},
"page_number": 7,
"text_length": 225
}
],
"processing_timestamp": "2026-04-07T07:40:49.241436"
}