| Original Filename: | ilovepdf_merged_2_merged.pdf |
| Upload Date: | November 26, 2025 at 06:23 AM |
| Total Pages: | 27 |
| Processing Status: | Completed |
| Total Documents: | 5 |
| Bank Statements: | 1 |
| Credit Cards: | 1 |
| Hp Agreements: | 2 |
| Loan Statements: | 1 |
Bank Statement
95%Bank Statement
95%Bank Statement
95%Bank Statement
95%Bank Statement
95%Bank Statement
95%Credit Card
95%Credit Card
95%Credit Card
95%Credit Card
95%Credit Card
95%Hp Agreement
95%Unknown
70%Hp Agreement
95%Hp Agreement
95%Hp Agreement
95%Hp Agreement
95%Hp Agreement
95%Hp Agreement
95%Loan Statement
85%Loan Statement
95%Loan Statement
95%Loan Statement
95%Loan Statement
95%Loan Statement
95%Loan Statement
95%Loan Statement
95%| Document Type | Pages | Confidence | Processing Status | Created | Actions |
|---|---|---|---|---|---|
| Bank Statement | 1-6 (6 pages) | 95% | Processed | 2025-11-26 06:24 | View |
| Credit Card | 7-11 (5 pages) | 95% | Processed | 2025-11-26 06:24 | View |
| Hp Agreement | 12 (1 page) | 95% | Processed | 2025-11-26 06:24 | View |
| Hp Agreement | 14-19 (6 pages) | 95% | Processed | 2025-11-26 06:24 | View |
| Loan Statement | 20-27 (8 pages) | 94% | Processed | 2025-11-26 06:24 | View |
{
"document_groups": [
{
"avg_confidence": 0.9499999999999998,
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": "01 JAN 2025 to 31 JAN 2025",
"total_amount": null
},
"document_type": "bank_statement",
"end_page": 6,
"pages": [
{
"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 key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.\",\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\": \"01 JAN 2025 to 31 JAN 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Di4vPQbW5npZBl2tR6O0JLC1gG\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 key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\\\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.\",\\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\": \"01 JAN 2025 to 31 JAN 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138190, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=203, prompt_tokens=1853, total_tokens=2056, 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)), prompt_filter_results=[{\u0027prompt_index\u0027:"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": "01 JAN 2025 to 31 JAN 2025",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.\",\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\": \"01 JAN 2025 to 31 JAN 2025\"\n }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.13333333333333333,
"pattern_score": 0.0,
"total_score": 0.08
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 1,
"text_length": 2962
},
{
"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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DkZkTzKrBxf0gCMb5cbCm6comI\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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138192, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1961, total_tokens=2158, 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)), prompt_filter_results="
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_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
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 2,
"text_length": 3154
},
{
"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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Dm5i6gWF2Sl8UP3G0uJHrcTGa8\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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138194, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1945, total_tokens=2142, 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)), prompt_filter_results="
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.3,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.058823529411764705,
"pattern_score": 0.1,
"total_score": 0.0903529411764706
},
"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.2222222222222222,
"pattern_score": 0.0,
"total_score": 0.13333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.3333333333333333,
"pattern_score": 0.0,
"total_score": 0.3
}
},
"type": "trial_balance"
}
},
"page_number": 3,
"text_length": 3463
},
{
"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 key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DomvVevEQ7Ej8Wl41uo1qd4j2J\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 key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138196, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=200, prompt_tokens=2004, total_tokens=2204, 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)), prompt_"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.16666666666666666,
"pattern_score": 0.0,
"total_score": 0.09999999999999999
},
"loan_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
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 4,
"text_length": 3080
},
{
"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 key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \u0027charges\u0027 and \u0027bill payments,\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DpwFIGrM0EGAFXxXYwlRyblorv\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 key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \\\u0027charges\\\u0027 and \\\u0027bill payments,\\\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138197, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=206, prompt_tokens=1191, total_tokens=1397, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_token"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \u0027charges\u0027 and \u0027bill payments,\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \u0027charges\u0027 and \u0027bill payments,\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.\",\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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 5,
"text_length": 1219
},
{
"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 key indicators of a bank statement, such as an account name (\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\u0027), account number (\u002794161356\u0027), sort code (\u002760-17-21\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Dr1cE0yYAscxufX3q6I83mxOy5\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 key indicators of a bank statement, such as an account name (\\\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\\\u0027), account number (\\\u002794161356\\\u0027), sort code (\\\u002760-17-21\\\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138199, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=205, prompt_tokens=1421, total_tokens=1626, 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)), prompt_filter_results=[{\u0027pro"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as an account name (\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\u0027), account number (\u002794161356\u0027), sort code (\u002760-17-21\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as an account name (\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\u0027), account number (\u002794161356\u0027), sort code (\u002760-17-21\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.03529411764705882,
"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.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"loan_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
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 6,
"text_length": 4017
}
],
"start_page": 1
},
{
"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,
"outstanding_balance": "1,081.76",
"seller_name": null,
"statement_period": "From 27 May to 26 June 2024",
"total_amount": null
},
"document_type": "credit_card",
"end_page": 11,
"pages": [
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.\",\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\": \"1,081.76\",\n \"statement_period\": \"From 27 May to 26 June 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DtS6ZKujXp0g8kLssGaZEZcjIX\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.\",\\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\": \"1,081.76\",\\n \"statement_period\": \"From 27 May to 26 June 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138201, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=219, prompt_tokens=1216, total_tokens=1435, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_to"
},
"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,
"outstanding_balance": "1,081.76",
"seller_name": null,
"statement_period": "From 27 May to 26 June 2024",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.\",\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\": \"1,081.76\",\n \"statement_period\": \"From 27 May to 26 June 2024\"\n }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.1411764705882353,
"features": {
"bank_statement": {
"keyword_score": 0.23529411764705882,
"pattern_score": 0.0,
"total_score": 0.1411764705882353
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.06666666666666667,
"pattern_score": 0.0,
"total_score": 0.04
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 7,
"text_length": 1691
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.\",\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\": \"26/06/24 to 26/07/24\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DvV4FDzLV7sauAAMoNos64b9iR\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.\",\\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\": \"26/06/24 to 26/07/24\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138203, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1629, total_tokens=1826, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_re"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": "26/06/24 to 26/07/24",
"total_amount": null
},
"llm_reasoning": "The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.\",\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\": \"26/06/24 to 26/07/24\"\n }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.19831932773109243,
"features": {
"bank_statement": {
"keyword_score": 0.23529411764705882,
"pattern_score": 0.14285714285714285,
"total_score": 0.19831932773109243
},
"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.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 8,
"text_length": 3498
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains references to a credit card statement, including a card type (\u0027American Express Business Platinum Card\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Dxf1Nxe4V8Jjbl8tyXEqNzQaMk\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains references to a credit card statement, including a card type (\\\u0027American Express Business Platinum Card\\\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138205, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=180, prompt_tokens=869, total_tokens=1049, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027s"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains references to a credit card statement, including a card type (\u0027American Express Business Platinum Card\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains references to a credit card statement, including a card type (\u0027American Express Business Platinum Card\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.\",\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 }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.03529411764705882,
"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.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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 9,
"text_length": 401
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a card type (\u0027SBS Platinum Charge Card\u0027), card number, membership number, statement period (\u0027Period 20/05/24 to 19/06/24\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.\",\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\": \"20/05/24 to 19/06/24\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DytGYktP5s0ZyVQaR1BLQJ3Qjt\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a card type (\\\u0027SBS Platinum Charge Card\\\u0027), card number, membership number, statement period (\\\u0027Period 20/05/24 to 19/06/24\\\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.\",\\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\": \"20/05/24 to 19/06/24\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138206, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=238, prompt_tokens=1271, total_tokens=1509, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tok"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": "20/05/24 to 19/06/24",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a credit card statement, such as a card type (\u0027SBS Platinum Charge Card\u0027), card number, membership number, statement period (\u0027Period 20/05/24 to 19/06/24\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a card type (\u0027SBS Platinum Charge Card\u0027), card number, membership number, statement period (\u0027Period 20/05/24 to 19/06/24\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.\",\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\": \"20/05/24 to 19/06/24\"\n }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.05263157894736842,
"pattern_score": 0.0,
"total_score": 0.03789473684210525
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 10,
"text_length": 2145
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document mentions \u0027American Express Business Platinum Card\u0027, \u0027Statement of Account\u0027, and includes details such as \u0027Membership Number\u0027, \u0027Next Statement Date\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E02cCwYuHIFfKUQ0WDFva4rq9V\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document mentions \\\u0027American Express Business Platinum Card\\\u0027, \\\u0027Statement of Account\\\u0027, and includes details such as \\\u0027Membership Number\\\u0027, \\\u0027Next Statement Date\\\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138208, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=201, prompt_tokens=914, total_tokens=1115, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens="
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document mentions \u0027American Express Business Platinum Card\u0027, \u0027Statement of Account\u0027, and includes details such as \u0027Membership Number\u0027, \u0027Next Statement Date\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document mentions \u0027American Express Business Platinum Card\u0027, \u0027Statement of Account\u0027, and includes details such as \u0027Membership Number\u0027, \u0027Next Statement Date\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.\",\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 }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.03529411764705882,
"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.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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 11,
"text_length": 682
}
],
"start_page": 7
},
{
"avg_confidence": 0.95,
"document_identifiers": {
"agreement_date": "10/7/2025",
"amount_financed": "\u00a316,485.84",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "36 months",
"monthly_payment": "\u00a3514.16",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"document_type": "hp_agreement",
"end_page": 12,
"pages": [
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement (Unregulated)\u0027, includes terms like \u0027amount financed\u0027, \u0027monthly payment\u0027, \u0027hire period\u0027, and \u0027balance to finance\u0027, which are key indicators of a hire purchase agreement.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null,\n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"10/7/2025\",\n \"amount_financed\": \"\u00a316,485.84\",\n \"monthly_payment\": \"\u00a3514.16\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E2UmwLqUm0u0u8W3CmQIOLTht7\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document explicitly mentions \\\u0027Hire Purchase Agreement (Unregulated)\\\u0027, includes terms like \\\u0027amount financed\\\u0027, \\\u0027monthly payment\\\u0027, \\\u0027hire period\\\u0027, and \\\u0027balance to finance\\\u0027, which are key indicators of a hire purchase agreement.\",\\n \"document_identifiers\": {\\n \"invoice_number\": null,\\n \"seller_name\": null,\\n \"invoice_date\": null,\\n \"total_amount\": null,\\n \"agreement_date\": \"10/7/2025\",\\n \"amount_financed\": \"\u00a316,485.84\",\\n \"monthly_payment\": \"\u00a3514.16\",\\n \"loan_tenure\": \"36 months\",\\n \"loan_reference\": null,\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": null,\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138210, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=191, prompt_tokens=1442, total_tokens=1633, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak"
},
"document_identifiers": {
"agreement_date": "10/7/2025",
"amount_financed": "\u00a316,485.84",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "36 months",
"monthly_payment": "\u00a3514.16",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document explicitly mentions \u0027Hire Purchase Agreement (Unregulated)\u0027, includes terms like \u0027amount financed\u0027, \u0027monthly payment\u0027, \u0027hire period\u0027, and \u0027balance to finance\u0027, which are key indicators of a hire purchase agreement.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement (Unregulated)\u0027, includes terms like \u0027amount financed\u0027, \u0027monthly payment\u0027, \u0027hire period\u0027, and \u0027balance to finance\u0027, which are key indicators of a hire purchase agreement.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null,\n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"10/7/2025\",\n \"amount_financed\": \"\u00a316,485.84\",\n \"monthly_payment\": \"\u00a3514.16\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.11923076923076924,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.11538461538461539,
"pattern_score": 0.125,
"total_score": 0.11923076923076924
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "hp_agreement"
}
},
"page_number": 12,
"text_length": 4470
}
],
"start_page": 12
},
{
"avg_confidence": 0.9499999999999998,
"document_identifiers": {
"agreement_date": "Not explicitly mentioned",
"amount_financed": "54,256.58",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "36 months",
"monthly_payment": "1,760.08",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"document_type": "hp_agreement",
"end_page": 19,
"pages": [
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Hirer\u0027, \u0027finance agreement\u0027, \u0027payments\u0027, \u0027equipment\u0027, and terms like \u0027the Equipment will not become your property until you have made all the payments\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E5qlqD74RJIVxJELphS39mfHOs\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Hirer\\\u0027, \\\u0027finance agreement\\\u0027, \\\u0027payments\\\u0027, \\\u0027equipment\\\u0027, and terms like \\\u0027the Equipment will not become your property until you have made all the payments\\\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138213, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=205, prompt_tokens=1370, total_tokens=1575, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails("
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Hirer\u0027, \u0027finance agreement\u0027, \u0027payments\u0027, \u0027equipment\u0027, and terms like \u0027the Equipment will not become your property until you have made all the payments\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Hirer\u0027, \u0027finance agreement\u0027, \u0027payments\u0027, \u0027equipment\u0027, and terms like \u0027the Equipment will not become your property until you have made all the payments\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.\",\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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.11923076923076924,
"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.11538461538461539,
"pattern_score": 0.125,
"total_score": 0.11923076923076924
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "hp_agreement"
}
},
"page_number": 14,
"text_length": 4100
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement\u0027 and includes key details such as \u0027Agreement Number\u0027, \u0027Balance Financed\u0027, \u0027Monthly Payment\u0027, and \u0027Hire Period\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.\",\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\": \"54,256.58\",\n \"monthly_payment\": \"1,760.08\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E77oMc1ZWWMgLrT0gWB2bQyg5g\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document explicitly mentions \\\u0027Hire Purchase Agreement\\\u0027 and includes key details such as \\\u0027Agreement Number\\\u0027, \\\u0027Balance Financed\\\u0027, \\\u0027Monthly Payment\\\u0027, and \\\u0027Hire Period\\\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.\",\\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\": \"54,256.58\",\\n \"monthly_payment\": \"1,760.08\",\\n \"loan_tenure\": \"36 months\",\\n \"loan_reference\": null,\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": null,\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138215, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=214, prompt_tokens=1484, total_tokens=1698, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_t"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": "54,256.58",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "36 months",
"monthly_payment": "1,760.08",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document explicitly mentions \u0027Hire Purchase Agreement\u0027 and includes key details such as \u0027Agreement Number\u0027, \u0027Balance Financed\u0027, \u0027Monthly Payment\u0027, and \u0027Hire Period\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement\u0027 and includes key details such as \u0027Agreement Number\u0027, \u0027Balance Financed\u0027, \u0027Monthly Payment\u0027, and \u0027Hire Period\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.\",\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\": \"54,256.58\",\n \"monthly_payment\": \"1,760.08\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.18653846153846151,
"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.2692307692307692,
"pattern_score": 0.0625,
"total_score": 0.18653846153846151
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "hp_agreement"
}
},
"page_number": 15,
"text_length": 2556
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027finance\u0027, \u0027Supplier\u0027, \u0027Equipment\u0027, and \u0027settlement amount\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E9lOVcWJ7KV4yaHekvsha5LyHY\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Agreement\\\u0027, \\\u0027finance\\\u0027, \\\u0027Supplier\\\u0027, \\\u0027Equipment\\\u0027, and \\\u0027settlement amount\\\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138217, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=188, prompt_tokens=1355, total_tokens=1543, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_resul"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027finance\u0027, \u0027Supplier\u0027, \u0027Equipment\u0027, and \u0027settlement amount\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027finance\u0027, \u0027Supplier\u0027, \u0027Equipment\u0027, and \u0027settlement amount\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.\",\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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"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.07692307692307693,
"pattern_score": 0.0,
"total_score": 0.046153846153846156
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 16,
"text_length": 4689
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027Hire\u0027, \u0027Equipment\u0027, \u0027Payment of Rentals\u0027, \u0027Direct Debit\u0027, \u0027amount financed\u0027, and \u0027monthly payment\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null, \n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"Not explicitly mentioned\",\n \"amount_financed\": \"Not explicitly mentioned\",\n \"monthly_payment\": \"Not explicitly mentioned\",\n \"loan_tenure\": \"Not explicitly mentioned\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EANVjYr65vBUZKJ2zv3Am0UXQM\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Agreement\\\u0027, \\\u0027Hire\\\u0027, \\\u0027Equipment\\\u0027, \\\u0027Payment of Rentals\\\u0027, \\\u0027Direct Debit\\\u0027, \\\u0027amount financed\\\u0027, and \\\u0027monthly payment\\\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.\",\\n \"document_identifiers\": {\\n \"invoice_number\": null,\\n \"seller_name\": null, \\n \"invoice_date\": null,\\n \"total_amount\": null,\\n \"agreement_date\": \"Not explicitly mentioned\",\\n \"amount_financed\": \"Not explicitly mentioned\",\\n \"monthly_payment\": \"Not explicitly mentioned\",\\n \"loan_tenure\": \"Not explicitly mentioned\",\\n \"loan_reference\": null,\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": null,\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138218, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=220, prompt_tokens=1407, total_tokens=1627, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, re"
},
"document_identifiers": {
"agreement_date": "Not explicitly mentioned",
"amount_financed": "Not explicitly mentioned",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "Not explicitly mentioned",
"monthly_payment": "Not explicitly mentioned",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027Hire\u0027, \u0027Equipment\u0027, \u0027Payment of Rentals\u0027, \u0027Direct Debit\u0027, \u0027amount financed\u0027, and \u0027monthly payment\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027Hire\u0027, \u0027Equipment\u0027, \u0027Payment of Rentals\u0027, \u0027Direct Debit\u0027, \u0027amount financed\u0027, and \u0027monthly payment\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null, \n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"Not explicitly mentioned\",\n \"amount_financed\": \"Not explicitly mentioned\",\n \"monthly_payment\": \"Not explicitly mentioned\",\n \"loan_tenure\": \"Not explicitly mentioned\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.2374736842105263,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.2631578947368421,
"pattern_score": 0.1,
"total_score": 0.2374736842105263
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "financial_statement"
}
},
"page_number": 17,
"text_length": 12322
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Equipment\u0027, \u0027Insurance monies\u0027, \u0027Total Loss\u0027, \u0027Rentals\u0027, and terms like \u0027hiring of the Equipment under this Agreement\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3ECuit8q6s5A4D3Qpots8iaonSH\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Equipment\\\u0027, \\\u0027Insurance monies\\\u0027, \\\u0027Total Loss\\\u0027, \\\u0027Rentals\\\u0027, and terms like \\\u0027hiring of the Equipment under this Agreement\\\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138220, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=208, prompt_tokens=1425, total_tokens=1633, 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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Equipment\u0027, \u0027Insurance monies\u0027, \u0027Total Loss\u0027, \u0027Rentals\u0027, and terms like \u0027hiring of the Equipment under this Agreement\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm this classification.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Equipment\u0027, \u0027Insurance monies\u0027, \u0027Total Loss\u0027, \u0027Rentals\u0027, and terms like \u0027hiring of the Equipment under this Agreement\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm 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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"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.058823529411764705,
"pattern_score": 0.0,
"total_score": 0.042352941176470586
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.10526315789473684,
"pattern_score": 0.0,
"total_score": 0.0757894736842105
},
"hp_agreement": {
"keyword_score": 0.07692307692307693,
"pattern_score": 0.0625,
"total_score": 0.07115384615384615
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "invoice"
}
},
"page_number": 18,
"text_length": 11405
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \u0027Option to Purchase,\u0027 \u0027Rentals,\u0027 \u0027Option to Purchase Fee,\u0027 and \u0027hiring of the Equipment.\u0027 Additionally, it mentions terms like \u0027termination of the hiring,\u0027 \u0027retaking possession,\u0027 and \u0027selling the Equipment,\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EEbQAjrp5zbxT3LcTNdOLRSXSo\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \\\u0027Option to Purchase,\\\u0027 \\\u0027Rentals,\\\u0027 \\\u0027Option to Purchase Fee,\\\u0027 and \\\u0027hiring of the Equipment.\\\u0027 Additionally, it mentions terms like \\\u0027termination of the hiring,\\\u0027 \\\u0027retaking possession,\\\u0027 and \\\u0027selling the Equipment,\\\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138222, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=227, prompt_tokens=1380, total_tokens=1607, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reason"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \u0027Option to Purchase,\u0027 \u0027Rentals,\u0027 \u0027Option to Purchase Fee,\u0027 and \u0027hiring of the Equipment.\u0027 Additionally, it mentions terms like \u0027termination of the hiring,\u0027 \u0027retaking possession,\u0027 and \u0027selling the Equipment,\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support this classification.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \u0027Option to Purchase,\u0027 \u0027Rentals,\u0027 \u0027Option to Purchase Fee,\u0027 and \u0027hiring of the Equipment.\u0027 Additionally, it mentions terms like \u0027termination of the hiring,\u0027 \u0027retaking possession,\u0027 and \u0027selling the Equipment,\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support 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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.10526315789473684,
"pattern_score": 0.0,
"total_score": 0.0757894736842105
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 19,
"text_length": 10817
}
],
"start_page": 14
},
{
"avg_confidence": 0.9375,
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": "2.500%",
"invoice_date": null,
"invoice_number": null,
"loan_reference": "23653883476995",
"loan_tenure": "277 months (23 years and 1 month)",
"monthly_payment": "\u00a3804.94",
"outstanding_balance": "12,233.97 DR",
"seller_name": null,
"statement_period": "21 May 2025 to 29 Aug 2025",
"total_amount": null
},
"document_type": "loan_statement",
"end_page": 27,
"pages": [
{
"confidence_score": 0.85,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.85,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains references to loan-related terms such as \u0027creditworthiness,\u0027 \u0027product suitability,\u0027 \u0027manage your account,\u0027 \u0027trace and recover debts,\u0027 and \u0027financial history.\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EGStN5uVkhV3C8dC7nYXpfOHVG\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.85,\\n \"reasoning\": \"The document contains references to loan-related terms such as \\\u0027creditworthiness,\\\u0027 \\\u0027product suitability,\\\u0027 \\\u0027manage your account,\\\u0027 \\\u0027trace and recover debts,\\\u0027 and \\\u0027financial history.\\\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138224, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=211, prompt_tokens=1333, total_tokens=1544, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejecte"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains references to loan-related terms such as \u0027creditworthiness,\u0027 \u0027product suitability,\u0027 \u0027manage your account,\u0027 \u0027trace and recover debts,\u0027 and \u0027financial history.\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains references to loan-related terms such as \u0027creditworthiness,\u0027 \u0027product suitability,\u0027 \u0027manage your account,\u0027 \u0027trace and recover debts,\u0027 and \u0027financial history.\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.\",\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 }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.07058823529411765,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 20,
"text_length": 7424
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027loan repayment\u0027, \u0027debit interest\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account 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\": \"12,233.97 DR\",\n \"statement_period\": \"21 May 2025 to 29 Aug 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EHK4peOZjSefWTcCmf4pXHdHpb\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \\\u0027loan repayment\\\u0027, \\\u0027debit interest\\\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account 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\": \"12,233.97 DR\",\\n \"statement_period\": \"21 May 2025 to 29 Aug 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138225, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1124, total_tokens=1321, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filte"
},
"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,
"outstanding_balance": "12,233.97 DR",
"seller_name": null,
"statement_period": "21 May 2025 to 29 Aug 2025",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as \u0027loan repayment\u0027, \u0027debit interest\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account statements.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027loan repayment\u0027, \u0027debit interest\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account 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\": \"12,233.97 DR\",\n \"statement_period\": \"21 May 2025 to 29 Aug 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.2181818181818182,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.36363636363636365,
"total_score": 0.2181818181818182
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "loan_statement"
}
},
"page_number": 21,
"text_length": 958
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to \u0027LOAN REPAYMENT\u0027 and \u0027DEBIT INTEREST\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.\",\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\": \"15,663.17 DR\",\n \"statement_period\": \"28 Aug 2024 to 22 Apr 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EJHge3XeGjUJBTenBlTVeAhmrV\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains multiple references to \\\u0027LOAN REPAYMENT\\\u0027 and \\\u0027DEBIT INTEREST\\\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.\",\\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\": \"15,663.17 DR\",\\n \"statement_period\": \"28 Aug 2024 to 22 Apr 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138227, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=210, prompt_tokens=1310, total_tokens=1520, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, "
},
"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,
"outstanding_balance": "15,663.17 DR",
"seller_name": null,
"statement_period": "28 Aug 2024 to 22 Apr 2025",
"total_amount": null
},
"llm_reasoning": "The document contains multiple references to \u0027LOAN REPAYMENT\u0027 and \u0027DEBIT INTEREST\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to \u0027LOAN REPAYMENT\u0027 and \u0027DEBIT INTEREST\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.\",\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\": \"15,663.17 DR\",\n \"statement_period\": \"28 Aug 2024 to 22 Apr 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.2181818181818182,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.36363636363636365,
"total_score": 0.2181818181818182
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "loan_statement"
}
},
"page_number": 22,
"text_length": 1421
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Loan Account Statement\u0027 and includes key indicators such as \u0027Barclayloan for Business\u0027, \u0027Annual Interest Rates\u0027, \u0027Loan Account Statement\u0027, \u0027Direct Debit Payment\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.\",\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\": \"23653883476995\",\n \"annual_interest_rate\": \"2.500%\",\n \"outstanding_balance\": \"14966.52 DR\",\n \"statement_period\": \"10 August 2024 to 11 August 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3ELRtpQ4DF9HcEM3GgFeqWr2TSd\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document is titled \\\u0027Loan Account Statement\\\u0027 and includes key indicators such as \\\u0027Barclayloan for Business\\\u0027, \\\u0027Annual Interest Rates\\\u0027, \\\u0027Loan Account Statement\\\u0027, \\\u0027Direct Debit Payment\\\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.\",\\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\": \"23653883476995\",\\n \"annual_interest_rate\": \"2.500%\",\\n \"outstanding_balance\": \"14966.52 DR\",\\n \"statement_period\": \"10 August 2024 to 11 August 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138229, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=210, prompt_tokens=1232, total_tokens=1442, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": "2.500%",
"invoice_date": null,
"invoice_number": null,
"loan_reference": "23653883476995",
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": "14966.52 DR",
"seller_name": null,
"statement_period": "10 August 2024 to 11 August 2025",
"total_amount": null
},
"llm_reasoning": "The document is titled \u0027Loan Account Statement\u0027 and includes key indicators such as \u0027Barclayloan for Business\u0027, \u0027Annual Interest Rates\u0027, \u0027Loan Account Statement\u0027, \u0027Direct Debit Payment\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Loan Account Statement\u0027 and includes key indicators such as \u0027Barclayloan for Business\u0027, \u0027Annual Interest Rates\u0027, \u0027Loan Account Statement\u0027, \u0027Direct Debit Payment\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.\",\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\": \"23653883476995\",\n \"annual_interest_rate\": \"2.500%\",\n \"outstanding_balance\": \"14966.52 DR\",\n \"statement_period\": \"10 August 2024 to 11 August 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.9272727272727272,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.3333333333333333,
"pattern_score": 0.2727272727272727,
"strong_indicators": true,
"total_score": 0.9272727272727272
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "loan_statement"
}
},
"page_number": 23,
"text_length": 1272
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as references to \u0027Direct Debit Payment,\u0027 \u0027Interest,\u0027 \u0027Closing Balance,\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.\",\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\": \"10833.49 DR\",\n \"statement_period\": \"17 Feb 2025 - 11 Aug 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EMYrFPghIGfIyNX8MHwIDl3Dlb\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as references to \\\u0027Direct Debit Payment,\\\u0027 \\\u0027Interest,\\\u0027 \\\u0027Closing Balance,\\\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.\",\\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\": \"10833.49 DR\",\\n \"statement_period\": \"17 Feb 2025 - 11 Aug 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138230, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=227, prompt_tokens=1206, total_tokens=1433, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_p"
},
"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,
"outstanding_balance": "10833.49 DR",
"seller_name": null,
"statement_period": "17 Feb 2025 - 11 Aug 2025",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as references to \u0027Direct Debit Payment,\u0027 \u0027Interest,\u0027 \u0027Closing Balance,\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as references to \u0027Direct Debit Payment,\u0027 \u0027Interest,\u0027 \u0027Closing Balance,\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.\",\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\": \"10833.49 DR\",\n \"statement_period\": \"17 Feb 2025 - 11 Aug 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"strong_indicators": true,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 24,
"text_length": 1598
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027mortgage account number\u0027, \u0027annual mortgage statement\u0027, \u0027interest-only mortgage\u0027, \u0027original amount borrowed\u0027, \u0027current interest rate\u0027, \u0027arrears balance\u0027, \u0027account balance\u0027, and \u0027cost to repay the loan\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.\",\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\": \"\u00a3804.94\",\n \"loan_tenure\": \"277 months (23 years and 1 month)\",\n \"loan_reference\": \"71019693\",\n \"annual_interest_rate\": \"3.59%\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EO0CVjvUqqGJslIvGVFbgye8aE\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \\\u0027mortgage account number\\\u0027, \\\u0027annual mortgage statement\\\u0027, \\\u0027interest-only mortgage\\\u0027, \\\u0027original amount borrowed\\\u0027, \\\u0027current interest rate\\\u0027, \\\u0027arrears balance\\\u0027, \\\u0027account balance\\\u0027, and \\\u0027cost to repay the loan\\\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.\",\\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\": \"\u00a3804.94\",\\n \"loan_tenure\": \"277 months (23 years and 1 month)\",\\n \"loan_reference\": \"71019693\",\\n \"annual_interest_rate\": \"3.59%\",\\n \"outstanding_balance\": \"\u00a3268,984.99\",\\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138232, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=240, prompt_tokens=1277, total_tokens=1517, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": "3.59%",
"invoice_date": null,
"invoice_number": null,
"loan_reference": "71019693",
"loan_tenure": "277 months (23 years and 1 month)",
"monthly_payment": "\u00a3804.94",
"outstanding_balance": "\u00a3268,984.99",
"seller_name": null,
"statement_period": "1 October 2023 to 30 September 2024",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as \u0027mortgage account number\u0027, \u0027annual mortgage statement\u0027, \u0027interest-only mortgage\u0027, \u0027original amount borrowed\u0027, \u0027current interest rate\u0027, \u0027arrears balance\u0027, \u0027account balance\u0027, and \u0027cost to repay the loan\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027mortgage account number\u0027, \u0027annual mortgage statement\u0027, \u0027interest-only mortgage\u0027, \u0027original amount borrowed\u0027, \u0027current interest rate\u0027, \u0027arrears balance\u0027, \u0027account balance\u0027, and \u0027cost to repay the loan\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.\",\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\": \"\u00a3804.94\",\n \"loan_tenure\": \"277 months (23 years and 1 month)\",\n \"loan_reference\": \"71019693\",\n \"annual_interest_rate\": \"3.59%\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 25,
"text_length": 2038
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Annual Statement\u0027 and includes key indicators of a loan statement such as \u0027Account number\u0027, \u0027Interest charge\u0027, \u0027Direct debit\u0027, \u0027Instalment due\u0027, \u0027Outstanding balance\u0027, and a \u0027Statement period\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment 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\": \"71019693\",\n \"annual_interest_rate\": null,\n \"outstanding_balance\": \"\u00a3268,999.95\",\n \"statement_period\": \"1 October 2023 - 30 September 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EQs8UPo6MrpnpN0nkoL0w0Pydf\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document is titled \\\u0027Annual Statement\\\u0027 and includes key indicators of a loan statement such as \\\u0027Account number\\\u0027, \\\u0027Interest charge\\\u0027, \\\u0027Direct debit\\\u0027, \\\u0027Instalment due\\\u0027, \\\u0027Outstanding balance\\\u0027, and a \\\u0027Statement period\\\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment 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\": \"71019693\",\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": \"\u00a3268,999.95\",\\n \"statement_period\": \"1 October 2023 - 30 September 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138234, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=225, prompt_tokens=1556, total_tokens=1781, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=Promp"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": "71019693",
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": "\u00a3268,999.95",
"seller_name": null,
"statement_period": "1 October 2023 - 30 September 2024",
"total_amount": null
},
"llm_reasoning": "The document is titled \u0027Annual Statement\u0027 and includes key indicators of a loan statement such as \u0027Account number\u0027, \u0027Interest charge\u0027, \u0027Direct debit\u0027, \u0027Instalment due\u0027, \u0027Outstanding balance\u0027, and a \u0027Statement period\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment statements.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Annual Statement\u0027 and includes key indicators of a loan statement such as \u0027Account number\u0027, \u0027Interest charge\u0027, \u0027Direct debit\u0027, \u0027Instalment due\u0027, \u0027Outstanding balance\u0027, and a \u0027Statement period\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment 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\": \"71019693\",\n \"annual_interest_rate\": null,\n \"outstanding_balance\": \"\u00a3268,999.95\",\n \"statement_period\": \"1 October 2023 - 30 September 2024\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.1411764705882353,
"features": {
"bank_statement": {
"keyword_score": 0.23529411764705882,
"pattern_score": 0.0,
"total_score": 0.1411764705882353
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 26,
"text_length": 2145
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027Direct debit\u0027, \u0027Interest charge\u0027, \u0027Instalment due\u0027, \u0027Closing balance\u0027, \u0027Total payments made\u0027, \u0027Total interest applied\u0027, and \u0027Interest rate summary\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.\",\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\": \"3.59% a year\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3ES9wq079ykACZckHtzNASJxBYA\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \\\u0027Direct debit\\\u0027, \\\u0027Interest charge\\\u0027, \\\u0027Instalment due\\\u0027, \\\u0027Closing balance\\\u0027, \\\u0027Total payments made\\\u0027, \\\u0027Total interest applied\\\u0027, and \\\u0027Interest rate summary\\\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.\",\\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\": \"3.59% a year\",\\n \"outstanding_balance\": \"\u00a3268,984.99\",\\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138236, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=221, prompt_tokens=926, total_tokens=1147, 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, cach"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": "3.59% a year",
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": "\u00a3268,984.99",
"seller_name": null,
"statement_period": "1 October 2023 to 30 September 2024",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as \u0027Direct debit\u0027, \u0027Interest charge\u0027, \u0027Instalment due\u0027, \u0027Closing balance\u0027, \u0027Total payments made\u0027, \u0027Total interest applied\u0027, and \u0027Interest rate summary\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027Direct debit\u0027, \u0027Interest charge\u0027, \u0027Instalment due\u0027, \u0027Closing balance\u0027, \u0027Total payments made\u0027, \u0027Total interest applied\u0027, and \u0027Interest rate summary\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.\",\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\": \"3.59% a year\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_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
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 27,
"text_length": 615
}
],
"start_page": 20
}
],
"page_classifications": [
{
"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 key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.\",\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\": \"01 JAN 2025 to 31 JAN 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Di4vPQbW5npZBl2tR6O0JLC1gG\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 key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\\\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.\",\\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\": \"01 JAN 2025 to 31 JAN 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138190, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=203, prompt_tokens=1853, total_tokens=2056, 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)), prompt_filter_results=[{\u0027prompt_index\u0027:"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": "01 JAN 2025 to 31 JAN 2025",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as account numbers, sort codes, transaction dates, descriptions, deposits, withdrawals, and balances. It also includes a summary of the account\u0027s previous balance, paid-in amounts, withdrawn amounts, and new balance, which are typical features of a bank statement.\",\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\": \"01 JAN 2025 to 31 JAN 2025\"\n }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.13333333333333333,
"pattern_score": 0.0,
"total_score": 0.08
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 1,
"text_length": 2962
},
{
"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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DkZkTzKrBxf0gCMb5cbCm6comI\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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138192, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1961, total_tokens=2158, 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)), prompt_filter_results="
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_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
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 2,
"text_length": 3154
},
{
"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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Dm5i6gWF2Sl8UP3G0uJHrcTGa8\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 key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138194, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1945, total_tokens=2142, 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)), prompt_filter_results="
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement and do not align with the structure or content of other document types like invoices, credit card statements, or loan 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.3,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.058823529411764705,
"pattern_score": 0.1,
"total_score": 0.0903529411764706
},
"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.2222222222222222,
"pattern_score": 0.0,
"total_score": 0.13333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.3333333333333333,
"pattern_score": 0.0,
"total_score": 0.3
}
},
"type": "trial_balance"
}
},
"page_number": 3,
"text_length": 3463
},
{
"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 key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DomvVevEQ7Ej8Wl41uo1qd4j2J\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 key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138196, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=200, prompt_tokens=2004, total_tokens=2204, 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)), prompt_"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction dates, descriptions, amounts paid in and withdrawn, and running balances. These are typical features of a bank statement. There is no evidence of credit card details, invoices, payroll information, hire purchase agreements, loan details, or financial 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.16666666666666666,
"pattern_score": 0.0,
"total_score": 0.09999999999999999
},
"loan_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
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 4,
"text_length": 3080
},
{
"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 key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \u0027charges\u0027 and \u0027bill payments,\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DpwFIGrM0EGAFXxXYwlRyblorv\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 key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \\\u0027charges\\\u0027 and \\\u0027bill payments,\\\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138197, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=206, prompt_tokens=1191, total_tokens=1397, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_token"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \u0027charges\u0027 and \u0027bill payments,\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as an account name, account number, sort code, transaction descriptions, dates, amounts paid in and withdrawn, and running balances. Additionally, it includes references to \u0027charges\u0027 and \u0027bill payments,\u0027 which are typical of bank statements. There is no evidence of invoice numbers, loan references, or other indicators of different document types.\",\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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 5,
"text_length": 1219
},
{
"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 key indicators of a bank statement, such as an account name (\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\u0027), account number (\u002794161356\u0027), sort code (\u002760-17-21\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Dr1cE0yYAscxufX3q6I83mxOy5\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 key indicators of a bank statement, such as an account name (\\\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\\\u0027), account number (\\\u002794161356\\\u0027), sort code (\\\u002760-17-21\\\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138199, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=205, prompt_tokens=1421, total_tokens=1626, 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)), prompt_filter_results=[{\u0027pro"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a bank statement, such as an account name (\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\u0027), account number (\u002794161356\u0027), sort code (\u002760-17-21\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank statements.",
"raw_response": "```json\n{\n \"document_type\": \"bank_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a bank statement, such as an account name (\u0027J \u0026 J MAINTENANCE (HOLDINGS) LTD\u0027), account number (\u002794161356\u0027), sort code (\u002760-17-21\u0027), and references to statements, transactions, and balances. Additionally, it includes information about paperless statements and financial services, which are typical of bank 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 }\n}\n```"
},
"type": "bank_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.03529411764705882,
"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.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"loan_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
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 6,
"text_length": 4017
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.\",\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\": \"1,081.76\",\n \"statement_period\": \"From 27 May to 26 June 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DtS6ZKujXp0g8kLssGaZEZcjIX\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.\",\\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\": \"1,081.76\",\\n \"statement_period\": \"From 27 May to 26 June 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138201, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=219, prompt_tokens=1216, total_tokens=1435, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_to"
},
"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,
"outstanding_balance": "1,081.76",
"seller_name": null,
"statement_period": "From 27 May to 26 June 2024",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a membership number, a spending limit, a payment due date, a statement period, and transaction details including a payment received. It also mentions a closing balance and a payment due amount, which are typical of credit card statements. There is no mention of loans, invoices, payroll, or other financial documents.\",\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\": \"1,081.76\",\n \"statement_period\": \"From 27 May to 26 June 2024\"\n }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.1411764705882353,
"features": {
"bank_statement": {
"keyword_score": 0.23529411764705882,
"pattern_score": 0.0,
"total_score": 0.1411764705882353
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.06666666666666667,
"pattern_score": 0.0,
"total_score": 0.04
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 7,
"text_length": 1691
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.\",\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\": \"26/06/24 to 26/07/24\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DvV4FDzLV7sauAAMoNos64b9iR\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.\",\\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\": \"26/06/24 to 26/07/24\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138203, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1629, total_tokens=1826, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_re"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": "26/06/24 to 26/07/24",
"total_amount": null
},
"llm_reasoning": "The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is a statement for an American Express Business Platinum Card, which includes details such as cardholder name, card number, transaction dates, transaction details, and amounts. It also includes payment instructions specific to a credit card account. These are key indicators of a credit card statement.\",\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\": \"26/06/24 to 26/07/24\"\n }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.19831932773109243,
"features": {
"bank_statement": {
"keyword_score": 0.23529411764705882,
"pattern_score": 0.14285714285714285,
"total_score": 0.19831932773109243
},
"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.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 8,
"text_length": 3498
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains references to a credit card statement, including a card type (\u0027American Express Business Platinum Card\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3Dxf1Nxe4V8Jjbl8tyXEqNzQaMk\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains references to a credit card statement, including a card type (\\\u0027American Express Business Platinum Card\\\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138205, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=180, prompt_tokens=869, total_tokens=1049, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027s"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains references to a credit card statement, including a card type (\u0027American Express Business Platinum Card\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains references to a credit card statement, including a card type (\u0027American Express Business Platinum Card\u0027), a membership number, a statement date, a next statement date, and transaction details with amounts. These are key indicators of a credit card statement.\",\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 }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.03529411764705882,
"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.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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 9,
"text_length": 401
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a card type (\u0027SBS Platinum Charge Card\u0027), card number, membership number, statement period (\u0027Period 20/05/24 to 19/06/24\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.\",\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\": \"20/05/24 to 19/06/24\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3DytGYktP5s0ZyVQaR1BLQJ3Qjt\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a card type (\\\u0027SBS Platinum Charge Card\\\u0027), card number, membership number, statement period (\\\u0027Period 20/05/24 to 19/06/24\\\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.\",\\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\": \"20/05/24 to 19/06/24\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138206, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=238, prompt_tokens=1271, total_tokens=1509, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tok"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": "20/05/24 to 19/06/24",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a credit card statement, such as a card type (\u0027SBS Platinum Charge Card\u0027), card number, membership number, statement period (\u0027Period 20/05/24 to 19/06/24\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a credit card statement, such as a card type (\u0027SBS Platinum Charge Card\u0027), card number, membership number, statement period (\u0027Period 20/05/24 to 19/06/24\u0027), and points earned. It also includes references to a next statement date and cardmember terms, which are typical of credit card statements. There is no mention of transactions, balances, or other indicators of a bank statement, invoice, or other document types.\",\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\": \"20/05/24 to 19/06/24\"\n }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.05263157894736842,
"pattern_score": 0.0,
"total_score": 0.03789473684210525
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 10,
"text_length": 2145
},
{
"confidence_score": 0.95,
"document_type": "credit_card",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document mentions \u0027American Express Business Platinum Card\u0027, \u0027Statement of Account\u0027, and includes details such as \u0027Membership Number\u0027, \u0027Next Statement Date\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E02cCwYuHIFfKUQ0WDFva4rq9V\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"credit_card\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document mentions \\\u0027American Express Business Platinum Card\\\u0027, \\\u0027Statement of Account\\\u0027, and includes details such as \\\u0027Membership Number\\\u0027, \\\u0027Next Statement Date\\\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138208, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=201, prompt_tokens=914, total_tokens=1115, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens="
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document mentions \u0027American Express Business Platinum Card\u0027, \u0027Statement of Account\u0027, and includes details such as \u0027Membership Number\u0027, \u0027Next Statement Date\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.",
"raw_response": "```json\n{\n \"document_type\": \"credit_card\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document mentions \u0027American Express Business Platinum Card\u0027, \u0027Statement of Account\u0027, and includes details such as \u0027Membership Number\u0027, \u0027Next Statement Date\u0027, and references to managing the card account online. These are key indicators of a credit card statement. There is no mention of transactions, balances, or other details that would classify it as a bank statement or loan statement.\",\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 }\n}\n```"
},
"type": "credit_card"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.03529411764705882,
"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.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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 11,
"text_length": 682
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement (Unregulated)\u0027, includes terms like \u0027amount financed\u0027, \u0027monthly payment\u0027, \u0027hire period\u0027, and \u0027balance to finance\u0027, which are key indicators of a hire purchase agreement.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null,\n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"10/7/2025\",\n \"amount_financed\": \"\u00a316,485.84\",\n \"monthly_payment\": \"\u00a3514.16\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E2UmwLqUm0u0u8W3CmQIOLTht7\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document explicitly mentions \\\u0027Hire Purchase Agreement (Unregulated)\\\u0027, includes terms like \\\u0027amount financed\\\u0027, \\\u0027monthly payment\\\u0027, \\\u0027hire period\\\u0027, and \\\u0027balance to finance\\\u0027, which are key indicators of a hire purchase agreement.\",\\n \"document_identifiers\": {\\n \"invoice_number\": null,\\n \"seller_name\": null,\\n \"invoice_date\": null,\\n \"total_amount\": null,\\n \"agreement_date\": \"10/7/2025\",\\n \"amount_financed\": \"\u00a316,485.84\",\\n \"monthly_payment\": \"\u00a3514.16\",\\n \"loan_tenure\": \"36 months\",\\n \"loan_reference\": null,\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": null,\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138210, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=191, prompt_tokens=1442, total_tokens=1633, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027jailbreak"
},
"document_identifiers": {
"agreement_date": "10/7/2025",
"amount_financed": "\u00a316,485.84",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "36 months",
"monthly_payment": "\u00a3514.16",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document explicitly mentions \u0027Hire Purchase Agreement (Unregulated)\u0027, includes terms like \u0027amount financed\u0027, \u0027monthly payment\u0027, \u0027hire period\u0027, and \u0027balance to finance\u0027, which are key indicators of a hire purchase agreement.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement (Unregulated)\u0027, includes terms like \u0027amount financed\u0027, \u0027monthly payment\u0027, \u0027hire period\u0027, and \u0027balance to finance\u0027, which are key indicators of a hire purchase agreement.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null,\n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"10/7/2025\",\n \"amount_financed\": \"\u00a316,485.84\",\n \"monthly_payment\": \"\u00a3514.16\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.11923076923076924,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.11538461538461539,
"pattern_score": 0.125,
"total_score": 0.11923076923076924
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "hp_agreement"
}
},
"page_number": 12,
"text_length": 4470
},
{
"confidence_score": 0.7,
"document_type": "unknown",
"features": {
"llm_based": {
"confidence": 0.7,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.7,\n \"reasoning\": \"The document mentions being \u0027authorised and regulated by the Financial Conduct Authority,\u0027 which is a common indicator of financial agreements such as hire purchase or finance agreements. However, the lack of specific details like \u0027amount financed\u0027 or \u0027monthly payment\u0027 reduces confidence.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E3GcqJ1gOfu5pMBUMzeVxDgHJW\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.7,\\n \"reasoning\": \"The document mentions being \\\u0027authorised and regulated by the Financial Conduct Authority,\\\u0027 which is a common indicator of financial agreements such as hire purchase or finance agreements. However, the lack of specific details like \\\u0027amount financed\\\u0027 or \\\u0027monthly payment\\\u0027 reduces confidence.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138211, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=181, prompt_tokens=784, total_tokens=965, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027se"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document mentions being \u0027authorised and regulated by the Financial Conduct Authority,\u0027 which is a common indicator of financial agreements such as hire purchase or finance agreements. However, the lack of specific details like \u0027amount financed\u0027 or \u0027monthly payment\u0027 reduces confidence.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.7,\n \"reasoning\": \"The document mentions being \u0027authorised and regulated by the Financial Conduct Authority,\u0027 which is a common indicator of financial agreements such as hire purchase or finance agreements. However, the lack of specific details like \u0027amount financed\u0027 or \u0027monthly payment\u0027 reduces confidence.\",\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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "uncertain",
"pattern_based": {
"confidence": 0.0,
"features": {
"bank_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 13,
"text_length": 176
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Hirer\u0027, \u0027finance agreement\u0027, \u0027payments\u0027, \u0027equipment\u0027, and terms like \u0027the Equipment will not become your property until you have made all the payments\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E5qlqD74RJIVxJELphS39mfHOs\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Hirer\\\u0027, \\\u0027finance agreement\\\u0027, \\\u0027payments\\\u0027, \\\u0027equipment\\\u0027, and terms like \\\u0027the Equipment will not become your property until you have made all the payments\\\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138213, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=205, prompt_tokens=1370, total_tokens=1575, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails("
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Hirer\u0027, \u0027finance agreement\u0027, \u0027payments\u0027, \u0027equipment\u0027, and terms like \u0027the Equipment will not become your property until you have made all the payments\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Hirer\u0027, \u0027finance agreement\u0027, \u0027payments\u0027, \u0027equipment\u0027, and terms like \u0027the Equipment will not become your property until you have made all the payments\u0027. Additionally, it includes sections discussing commission, customer declarations, and a checklist for business finance customers, which are typical of hire purchase agreements.\",\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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.11923076923076924,
"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.11538461538461539,
"pattern_score": 0.125,
"total_score": 0.11923076923076924
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "hp_agreement"
}
},
"page_number": 14,
"text_length": 4100
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement\u0027 and includes key details such as \u0027Agreement Number\u0027, \u0027Balance Financed\u0027, \u0027Monthly Payment\u0027, and \u0027Hire Period\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.\",\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\": \"54,256.58\",\n \"monthly_payment\": \"1,760.08\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E77oMc1ZWWMgLrT0gWB2bQyg5g\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document explicitly mentions \\\u0027Hire Purchase Agreement\\\u0027 and includes key details such as \\\u0027Agreement Number\\\u0027, \\\u0027Balance Financed\\\u0027, \\\u0027Monthly Payment\\\u0027, and \\\u0027Hire Period\\\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.\",\\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\": \"54,256.58\",\\n \"monthly_payment\": \"1,760.08\",\\n \"loan_tenure\": \"36 months\",\\n \"loan_reference\": null,\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": null,\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138215, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=214, prompt_tokens=1484, total_tokens=1698, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_t"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": "54,256.58",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "36 months",
"monthly_payment": "1,760.08",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document explicitly mentions \u0027Hire Purchase Agreement\u0027 and includes key details such as \u0027Agreement Number\u0027, \u0027Balance Financed\u0027, \u0027Monthly Payment\u0027, and \u0027Hire Period\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document explicitly mentions \u0027Hire Purchase Agreement\u0027 and includes key details such as \u0027Agreement Number\u0027, \u0027Balance Financed\u0027, \u0027Monthly Payment\u0027, and \u0027Hire Period\u0027. These are strong indicators of a hire purchase agreement. Additionally, the financial details section outlines the cash price, VAT, deposit, and balance financed, which are typical components of a hire purchase agreement.\",\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\": \"54,256.58\",\n \"monthly_payment\": \"1,760.08\",\n \"loan_tenure\": \"36 months\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.18653846153846151,
"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.2692307692307692,
"pattern_score": 0.0625,
"total_score": 0.18653846153846151
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "hp_agreement"
}
},
"page_number": 15,
"text_length": 2556
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027finance\u0027, \u0027Supplier\u0027, \u0027Equipment\u0027, and \u0027settlement amount\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3E9lOVcWJ7KV4yaHekvsha5LyHY\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Agreement\\\u0027, \\\u0027finance\\\u0027, \\\u0027Supplier\\\u0027, \\\u0027Equipment\\\u0027, and \\\u0027settlement amount\\\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138217, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=188, prompt_tokens=1355, total_tokens=1543, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_resul"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027finance\u0027, \u0027Supplier\u0027, \u0027Equipment\u0027, and \u0027settlement amount\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027finance\u0027, \u0027Supplier\u0027, \u0027Equipment\u0027, and \u0027settlement amount\u0027. Additionally, it includes terms related to financial arrangements, business purposes, and legal declarations, which are typical of hire purchase agreements.\",\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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"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.07692307692307693,
"pattern_score": 0.0,
"total_score": 0.046153846153846156
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 16,
"text_length": 4689
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027Hire\u0027, \u0027Equipment\u0027, \u0027Payment of Rentals\u0027, \u0027Direct Debit\u0027, \u0027amount financed\u0027, and \u0027monthly payment\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null, \n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"Not explicitly mentioned\",\n \"amount_financed\": \"Not explicitly mentioned\",\n \"monthly_payment\": \"Not explicitly mentioned\",\n \"loan_tenure\": \"Not explicitly mentioned\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EANVjYr65vBUZKJ2zv3Am0UXQM\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Agreement\\\u0027, \\\u0027Hire\\\u0027, \\\u0027Equipment\\\u0027, \\\u0027Payment of Rentals\\\u0027, \\\u0027Direct Debit\\\u0027, \\\u0027amount financed\\\u0027, and \\\u0027monthly payment\\\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.\",\\n \"document_identifiers\": {\\n \"invoice_number\": null,\\n \"seller_name\": null, \\n \"invoice_date\": null,\\n \"total_amount\": null,\\n \"agreement_date\": \"Not explicitly mentioned\",\\n \"amount_financed\": \"Not explicitly mentioned\",\\n \"monthly_payment\": \"Not explicitly mentioned\",\\n \"loan_tenure\": \"Not explicitly mentioned\",\\n \"loan_reference\": null,\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": null,\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138218, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=220, prompt_tokens=1407, total_tokens=1627, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, re"
},
"document_identifiers": {
"agreement_date": "Not explicitly mentioned",
"amount_financed": "Not explicitly mentioned",
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": "Not explicitly mentioned",
"monthly_payment": "Not explicitly mentioned",
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027Hire\u0027, \u0027Equipment\u0027, \u0027Payment of Rentals\u0027, \u0027Direct Debit\u0027, \u0027amount financed\u0027, and \u0027monthly payment\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Agreement\u0027, \u0027Hire\u0027, \u0027Equipment\u0027, \u0027Payment of Rentals\u0027, \u0027Direct Debit\u0027, \u0027amount financed\u0027, and \u0027monthly payment\u0027. These terms are specific to hire purchase or finance agreements. Additionally, the document outlines terms for equipment delivery, maintenance, and payment schedules, which are typical of hire purchase agreements.\",\n \"document_identifiers\": {\n \"invoice_number\": null,\n \"seller_name\": null, \n \"invoice_date\": null,\n \"total_amount\": null,\n \"agreement_date\": \"Not explicitly mentioned\",\n \"amount_financed\": \"Not explicitly mentioned\",\n \"monthly_payment\": \"Not explicitly mentioned\",\n \"loan_tenure\": \"Not explicitly mentioned\",\n \"loan_reference\": null,\n \"annual_interest_rate\": null,\n \"outstanding_balance\": null,\n \"statement_period\": null\n }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.2374736842105263,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.2631578947368421,
"pattern_score": 0.1,
"total_score": 0.2374736842105263
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "financial_statement"
}
},
"page_number": 17,
"text_length": 12322
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Equipment\u0027, \u0027Insurance monies\u0027, \u0027Total Loss\u0027, \u0027Rentals\u0027, and terms like \u0027hiring of the Equipment under this Agreement\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3ECuit8q6s5A4D3Qpots8iaonSH\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \\\u0027Equipment\\\u0027, \\\u0027Insurance monies\\\u0027, \\\u0027Total Loss\\\u0027, \\\u0027Rentals\\\u0027, and terms like \\\u0027hiring of the Equipment under this Agreement\\\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138220, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=208, prompt_tokens=1425, total_tokens=1633, 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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a hire purchase agreement, such as references to \u0027Equipment\u0027, \u0027Insurance monies\u0027, \u0027Total Loss\u0027, \u0027Rentals\u0027, and terms like \u0027hiring of the Equipment under this Agreement\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm this classification.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a hire purchase agreement, such as references to \u0027Equipment\u0027, \u0027Insurance monies\u0027, \u0027Total Loss\u0027, \u0027Rentals\u0027, and terms like \u0027hiring of the Equipment under this Agreement\u0027. These terms are specific to hire purchase or finance agreements, particularly for equipment or assets. Additionally, clauses related to termination, insurance, and payment obligations further confirm 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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"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.058823529411764705,
"pattern_score": 0.0,
"total_score": 0.042352941176470586
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.10526315789473684,
"pattern_score": 0.0,
"total_score": 0.0757894736842105
},
"hp_agreement": {
"keyword_score": 0.07692307692307693,
"pattern_score": 0.0625,
"total_score": 0.07115384615384615
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "invoice"
}
},
"page_number": 18,
"text_length": 11405
},
{
"confidence_score": 0.95,
"document_type": "hp_agreement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \u0027Option to Purchase,\u0027 \u0027Rentals,\u0027 \u0027Option to Purchase Fee,\u0027 and \u0027hiring of the Equipment.\u0027 Additionally, it mentions terms like \u0027termination of the hiring,\u0027 \u0027retaking possession,\u0027 and \u0027selling the Equipment,\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support 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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EEbQAjrp5zbxT3LcTNdOLRSXSo\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"hp_agreement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \\\u0027Option to Purchase,\\\u0027 \\\u0027Rentals,\\\u0027 \\\u0027Option to Purchase Fee,\\\u0027 and \\\u0027hiring of the Equipment.\\\u0027 Additionally, it mentions terms like \\\u0027termination of the hiring,\\\u0027 \\\u0027retaking possession,\\\u0027 and \\\u0027selling the Equipment,\\\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support 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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138222, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=227, prompt_tokens=1380, total_tokens=1607, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reason"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \u0027Option to Purchase,\u0027 \u0027Rentals,\u0027 \u0027Option to Purchase Fee,\u0027 and \u0027hiring of the Equipment.\u0027 Additionally, it mentions terms like \u0027termination of the hiring,\u0027 \u0027retaking possession,\u0027 and \u0027selling the Equipment,\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support this classification.",
"raw_response": "```json\n{\n \"document_type\": \"hp_agreement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to terms and conditions related to a hire purchase agreement, such as \u0027Option to Purchase,\u0027 \u0027Rentals,\u0027 \u0027Option to Purchase Fee,\u0027 and \u0027hiring of the Equipment.\u0027 Additionally, it mentions terms like \u0027termination of the hiring,\u0027 \u0027retaking possession,\u0027 and \u0027selling the Equipment,\u0027 which are indicative of a hire purchase or finance agreement. The presence of a company name (Aldermore) and references to financial obligations further support 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 }\n}\n```"
},
"type": "hp_agreement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.10526315789473684,
"pattern_score": 0.0,
"total_score": 0.0757894736842105
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 19,
"text_length": 10817
},
{
"confidence_score": 0.85,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.85,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains references to loan-related terms such as \u0027creditworthiness,\u0027 \u0027product suitability,\u0027 \u0027manage your account,\u0027 \u0027trace and recover debts,\u0027 and \u0027financial history.\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.\",\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 }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EGStN5uVkhV3C8dC7nYXpfOHVG\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.85,\\n \"reasoning\": \"The document contains references to loan-related terms such as \\\u0027creditworthiness,\\\u0027 \\\u0027product suitability,\\\u0027 \\\u0027manage your account,\\\u0027 \\\u0027trace and recover debts,\\\u0027 and \\\u0027financial history.\\\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.\",\\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 }\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138224, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=211, prompt_tokens=1333, total_tokens=1544, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejecte"
},
"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,
"outstanding_balance": null,
"seller_name": null,
"statement_period": null,
"total_amount": null
},
"llm_reasoning": "The document contains references to loan-related terms such as \u0027creditworthiness,\u0027 \u0027product suitability,\u0027 \u0027manage your account,\u0027 \u0027trace and recover debts,\u0027 and \u0027financial history.\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.85,\n \"reasoning\": \"The document contains references to loan-related terms such as \u0027creditworthiness,\u0027 \u0027product suitability,\u0027 \u0027manage your account,\u0027 \u0027trace and recover debts,\u0027 and \u0027financial history.\u0027 Additionally, it mentions interactions with Credit Reference Agencies (CRAs) and ongoing exchange of financial information, which are typical indicators of a loan statement. However, the document lacks specific transactional details or explicit loan account numbers, which slightly reduces confidence.\",\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 }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.07058823529411765,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"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
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.05,
"pattern_score": 0.0,
"total_score": 0.03
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 20,
"text_length": 7424
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027loan repayment\u0027, \u0027debit interest\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account 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\": \"12,233.97 DR\",\n \"statement_period\": \"21 May 2025 to 29 Aug 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EHK4peOZjSefWTcCmf4pXHdHpb\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \\\u0027loan repayment\\\u0027, \\\u0027debit interest\\\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account 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\": \"12,233.97 DR\",\\n \"statement_period\": \"21 May 2025 to 29 Aug 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138225, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=197, prompt_tokens=1124, total_tokens=1321, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, \u0027content_filter_results\u0027: {\u0027hate\u0027: {\u0027filte"
},
"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,
"outstanding_balance": "12,233.97 DR",
"seller_name": null,
"statement_period": "21 May 2025 to 29 Aug 2025",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as \u0027loan repayment\u0027, \u0027debit interest\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account statements.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027loan repayment\u0027, \u0027debit interest\u0027, and a running balance. It also includes specific details like transaction dates, amounts paid, and outstanding balances, which are typical of loan account 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\": \"12,233.97 DR\",\n \"statement_period\": \"21 May 2025 to 29 Aug 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.2181818181818182,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.36363636363636365,
"total_score": 0.2181818181818182
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "loan_statement"
}
},
"page_number": 21,
"text_length": 958
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to \u0027LOAN REPAYMENT\u0027 and \u0027DEBIT INTEREST\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.\",\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\": \"15,663.17 DR\",\n \"statement_period\": \"28 Aug 2024 to 22 Apr 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EJHge3XeGjUJBTenBlTVeAhmrV\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains multiple references to \\\u0027LOAN REPAYMENT\\\u0027 and \\\u0027DEBIT INTEREST\\\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.\",\\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\": \"15,663.17 DR\",\\n \"statement_period\": \"28 Aug 2024 to 22 Apr 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138227, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=210, prompt_tokens=1310, total_tokens=1520, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0, "
},
"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,
"outstanding_balance": "15,663.17 DR",
"seller_name": null,
"statement_period": "28 Aug 2024 to 22 Apr 2025",
"total_amount": null
},
"llm_reasoning": "The document contains multiple references to \u0027LOAN REPAYMENT\u0027 and \u0027DEBIT INTEREST\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains multiple references to \u0027LOAN REPAYMENT\u0027 and \u0027DEBIT INTEREST\u0027, which are key indicators of a loan statement. Additionally, it includes transaction dates, amounts, and balances, which are typical of loan account statements. There is no mention of invoices, payroll, or other document types.\",\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\": \"15,663.17 DR\",\n \"statement_period\": \"28 Aug 2024 to 22 Apr 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.2181818181818182,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.36363636363636365,
"total_score": 0.2181818181818182
},
"nominal_ledger": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "loan_statement"
}
},
"page_number": 22,
"text_length": 1421
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Loan Account Statement\u0027 and includes key indicators such as \u0027Barclayloan for Business\u0027, \u0027Annual Interest Rates\u0027, \u0027Loan Account Statement\u0027, \u0027Direct Debit Payment\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.\",\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\": \"23653883476995\",\n \"annual_interest_rate\": \"2.500%\",\n \"outstanding_balance\": \"14966.52 DR\",\n \"statement_period\": \"10 August 2024 to 11 August 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3ELRtpQ4DF9HcEM3GgFeqWr2TSd\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document is titled \\\u0027Loan Account Statement\\\u0027 and includes key indicators such as \\\u0027Barclayloan for Business\\\u0027, \\\u0027Annual Interest Rates\\\u0027, \\\u0027Loan Account Statement\\\u0027, \\\u0027Direct Debit Payment\\\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.\",\\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\": \"23653883476995\",\\n \"annual_interest_rate\": \"2.500%\",\\n \"outstanding_balance\": \"14966.52 DR\",\\n \"statement_period\": \"10 August 2024 to 11 August 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138229, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=210, prompt_tokens=1232, total_tokens=1442, 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)), prompt_filter_results=[{\u0027prompt_index\u0027: 0"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": "2.500%",
"invoice_date": null,
"invoice_number": null,
"loan_reference": "23653883476995",
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": "14966.52 DR",
"seller_name": null,
"statement_period": "10 August 2024 to 11 August 2025",
"total_amount": null
},
"llm_reasoning": "The document is titled \u0027Loan Account Statement\u0027 and includes key indicators such as \u0027Barclayloan for Business\u0027, \u0027Annual Interest Rates\u0027, \u0027Loan Account Statement\u0027, \u0027Direct Debit Payment\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Loan Account Statement\u0027 and includes key indicators such as \u0027Barclayloan for Business\u0027, \u0027Annual Interest Rates\u0027, \u0027Loan Account Statement\u0027, \u0027Direct Debit Payment\u0027, and a detailed list of transactions with balances. These are clear indicators of a loan statement.\",\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\": \"23653883476995\",\n \"annual_interest_rate\": \"2.500%\",\n \"outstanding_balance\": \"14966.52 DR\",\n \"statement_period\": \"10 August 2024 to 11 August 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "both_agree",
"pattern_based": {
"confidence": 0.9272727272727272,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"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.3333333333333333,
"pattern_score": 0.2727272727272727,
"strong_indicators": true,
"total_score": 0.9272727272727272
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "loan_statement"
}
},
"page_number": 23,
"text_length": 1272
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as references to \u0027Direct Debit Payment,\u0027 \u0027Interest,\u0027 \u0027Closing Balance,\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.\",\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\": \"10833.49 DR\",\n \"statement_period\": \"17 Feb 2025 - 11 Aug 2025\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EMYrFPghIGfIyNX8MHwIDl3Dlb\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as references to \\\u0027Direct Debit Payment,\\\u0027 \\\u0027Interest,\\\u0027 \\\u0027Closing Balance,\\\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.\",\\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\": \"10833.49 DR\",\\n \"statement_period\": \"17 Feb 2025 - 11 Aug 2025\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138230, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=227, prompt_tokens=1206, total_tokens=1433, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_p"
},
"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,
"outstanding_balance": "10833.49 DR",
"seller_name": null,
"statement_period": "17 Feb 2025 - 11 Aug 2025",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as references to \u0027Direct Debit Payment,\u0027 \u0027Interest,\u0027 \u0027Closing Balance,\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as references to \u0027Direct Debit Payment,\u0027 \u0027Interest,\u0027 \u0027Closing Balance,\u0027 and a running balance in debit (DR). Additionally, it mentions that the balance shown is not a settlement figure and provides contact information for obtaining a settlement figure, which is typical for loan statements. The document also references Barclays Bank, which is a financial institution that provides loans.\",\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\": \"10833.49 DR\",\n \"statement_period\": \"17 Feb 2025 - 11 Aug 2025\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.038461538461538464,
"pattern_score": 0.0,
"total_score": 0.023076923076923078
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"strong_indicators": true,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 24,
"text_length": 1598
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027mortgage account number\u0027, \u0027annual mortgage statement\u0027, \u0027interest-only mortgage\u0027, \u0027original amount borrowed\u0027, \u0027current interest rate\u0027, \u0027arrears balance\u0027, \u0027account balance\u0027, and \u0027cost to repay the loan\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.\",\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\": \"\u00a3804.94\",\n \"loan_tenure\": \"277 months (23 years and 1 month)\",\n \"loan_reference\": \"71019693\",\n \"annual_interest_rate\": \"3.59%\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EO0CVjvUqqGJslIvGVFbgye8aE\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \\\u0027mortgage account number\\\u0027, \\\u0027annual mortgage statement\\\u0027, \\\u0027interest-only mortgage\\\u0027, \\\u0027original amount borrowed\\\u0027, \\\u0027current interest rate\\\u0027, \\\u0027arrears balance\\\u0027, \\\u0027account balance\\\u0027, and \\\u0027cost to repay the loan\\\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.\",\\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\": \"\u00a3804.94\",\\n \"loan_tenure\": \"277 months (23 years and 1 month)\",\\n \"loan_reference\": \"71019693\",\\n \"annual_interest_rate\": \"3.59%\",\\n \"outstanding_balance\": \"\u00a3268,984.99\",\\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138232, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=240, prompt_tokens=1277, total_tokens=1517, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": "3.59%",
"invoice_date": null,
"invoice_number": null,
"loan_reference": "71019693",
"loan_tenure": "277 months (23 years and 1 month)",
"monthly_payment": "\u00a3804.94",
"outstanding_balance": "\u00a3268,984.99",
"seller_name": null,
"statement_period": "1 October 2023 to 30 September 2024",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as \u0027mortgage account number\u0027, \u0027annual mortgage statement\u0027, \u0027interest-only mortgage\u0027, \u0027original amount borrowed\u0027, \u0027current interest rate\u0027, \u0027arrears balance\u0027, \u0027account balance\u0027, and \u0027cost to repay the loan\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027mortgage account number\u0027, \u0027annual mortgage statement\u0027, \u0027interest-only mortgage\u0027, \u0027original amount borrowed\u0027, \u0027current interest rate\u0027, \u0027arrears balance\u0027, \u0027account balance\u0027, and \u0027cost to repay the loan\u0027. These terms are specific to loan or mortgage account statements and do not align with other document types.\",\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\": \"\u00a3804.94\",\n \"loan_tenure\": \"277 months (23 years and 1 month)\",\n \"loan_reference\": \"71019693\",\n \"annual_interest_rate\": \"3.59%\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.0975,
"features": {
"bank_statement": {
"keyword_score": 0.11764705882352941,
"pattern_score": 0.0,
"total_score": 0.07058823529411765
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.05555555555555555,
"pattern_score": 0.0,
"total_score": 0.03333333333333333
},
"loan_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "nominal_ledger"
}
},
"page_number": 25,
"text_length": 2038
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Annual Statement\u0027 and includes key indicators of a loan statement such as \u0027Account number\u0027, \u0027Interest charge\u0027, \u0027Direct debit\u0027, \u0027Instalment due\u0027, \u0027Outstanding balance\u0027, and a \u0027Statement period\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment 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\": \"71019693\",\n \"annual_interest_rate\": null,\n \"outstanding_balance\": \"\u00a3268,999.95\",\n \"statement_period\": \"1 October 2023 - 30 September 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3EQs8UPo6MrpnpN0nkoL0w0Pydf\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document is titled \\\u0027Annual Statement\\\u0027 and includes key indicators of a loan statement such as \\\u0027Account number\\\u0027, \\\u0027Interest charge\\\u0027, \\\u0027Direct debit\\\u0027, \\\u0027Instalment due\\\u0027, \\\u0027Outstanding balance\\\u0027, and a \\\u0027Statement period\\\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment 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\": \"71019693\",\\n \"annual_interest_rate\": null,\\n \"outstanding_balance\": \"\u00a3268,999.95\",\\n \"statement_period\": \"1 October 2023 - 30 September 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138234, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=225, prompt_tokens=1556, total_tokens=1781, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=Promp"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": null,
"invoice_date": null,
"invoice_number": null,
"loan_reference": "71019693",
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": "\u00a3268,999.95",
"seller_name": null,
"statement_period": "1 October 2023 - 30 September 2024",
"total_amount": null
},
"llm_reasoning": "The document is titled \u0027Annual Statement\u0027 and includes key indicators of a loan statement such as \u0027Account number\u0027, \u0027Interest charge\u0027, \u0027Direct debit\u0027, \u0027Instalment due\u0027, \u0027Outstanding balance\u0027, and a \u0027Statement period\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment statements.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document is titled \u0027Annual Statement\u0027 and includes key indicators of a loan statement such as \u0027Account number\u0027, \u0027Interest charge\u0027, \u0027Direct debit\u0027, \u0027Instalment due\u0027, \u0027Outstanding balance\u0027, and a \u0027Statement period\u0027. Additionally, it references a property address and includes a detailed breakdown of debits, credits, and balances, which are typical of loan repayment 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\": \"71019693\",\n \"annual_interest_rate\": null,\n \"outstanding_balance\": \"\u00a3268,999.95\",\n \"statement_period\": \"1 October 2023 - 30 September 2024\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.1411764705882353,
"features": {
"bank_statement": {
"keyword_score": 0.23529411764705882,
"pattern_score": 0.0,
"total_score": 0.1411764705882353
},
"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
},
"nominal_ledger": {
"keyword_score": 0.125,
"pattern_score": 0.0,
"total_score": 0.0975
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 26,
"text_length": 2145
},
{
"confidence_score": 0.95,
"document_type": "loan_statement",
"features": {
"llm_based": {
"confidence": 0.95,
"features": {
"api_response_debug": {
"content_preview": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027Direct debit\u0027, \u0027Interest charge\u0027, \u0027Instalment due\u0027, \u0027Closing balance\u0027, \u0027Total payments made\u0027, \u0027Total interest applied\u0027, and \u0027Interest rate summary\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.\",\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\": \"3.59% a year\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```",
"response_repr": "ChatCompletion(id=\u0027chatcmpl-Cg3ES9wq079ykACZckHtzNASJxBYA\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n \"document_type\": \"loan_statement\",\\n \"confidence\": 0.95,\\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \\\u0027Direct debit\\\u0027, \\\u0027Interest charge\\\u0027, \\\u0027Instalment due\\\u0027, \\\u0027Closing balance\\\u0027, \\\u0027Total payments made\\\u0027, \\\u0027Total interest applied\\\u0027, and \\\u0027Interest rate summary\\\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.\",\\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\": \"3.59% a year\",\\n \"outstanding_balance\": \"\u00a3268,984.99\",\\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\\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: {\u0027filtered\u0027: False, \u0027detected\u0027: False}, \u0027protected_material_text\u0027: {\u0027filtered\u0027: False, \u0027detected\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=1764138236, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=None, system_fingerprint=\u0027fp_b54fe76834\u0027, usage=CompletionUsage(completion_tokens=221, prompt_tokens=926, total_tokens=1147, 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, cach"
},
"document_identifiers": {
"agreement_date": null,
"amount_financed": null,
"annual_interest_rate": "3.59% a year",
"invoice_date": null,
"invoice_number": null,
"loan_reference": null,
"loan_tenure": null,
"monthly_payment": null,
"outstanding_balance": "\u00a3268,984.99",
"seller_name": null,
"statement_period": "1 October 2023 to 30 September 2024",
"total_amount": null
},
"llm_reasoning": "The document contains key indicators of a loan statement, such as \u0027Direct debit\u0027, \u0027Interest charge\u0027, \u0027Instalment due\u0027, \u0027Closing balance\u0027, \u0027Total payments made\u0027, \u0027Total interest applied\u0027, and \u0027Interest rate summary\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.",
"raw_response": "```json\n{\n \"document_type\": \"loan_statement\",\n \"confidence\": 0.95,\n \"reasoning\": \"The document contains key indicators of a loan statement, such as \u0027Direct debit\u0027, \u0027Interest charge\u0027, \u0027Instalment due\u0027, \u0027Closing balance\u0027, \u0027Total payments made\u0027, \u0027Total interest applied\u0027, and \u0027Interest rate summary\u0027. Additionally, it mentions an annual interest rate and an outstanding balance, which are typical elements of a loan statement.\",\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\": \"3.59% a year\",\n \"outstanding_balance\": \"\u00a3268,984.99\",\n \"statement_period\": \"1 October 2023 to 30 September 2024\"\n }\n}\n```"
},
"type": "loan_statement"
},
"method_used": "llm_preferred",
"pattern_based": {
"confidence": 0.10588235294117647,
"features": {
"bank_statement": {
"keyword_score": 0.17647058823529413,
"pattern_score": 0.0,
"total_score": 0.10588235294117647
},
"corporation_tax": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"credit_card": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"financial_statement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"hp_agreement": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"invoice": {
"keyword_score": 0.1111111111111111,
"pattern_score": 0.0,
"total_score": 0.06666666666666667
},
"loan_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
},
"payroll": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
},
"trial_balance": {
"keyword_score": 0.0,
"pattern_score": 0.0,
"total_score": 0.0
}
},
"type": "bank_statement"
}
},
"page_number": 27,
"text_length": 615
}
],
"processing_timestamp": "2025-11-26T06:23:57.057839"
}