Merged PDF Processing Results

Back to Dashboard
PDF Information
Original Filename: ilovepdf_merged_5.pdf
Upload Date: December 02, 2025 at 12:55 PM
Total Pages: 22
Processing Status: Partial
Extraction Summary
Total Documents: 5
Bank Statements: 1
Credit Cards: 1
Hp Agreements: 1
Mortgage Statements: 1
Loan Statements: 1
Page Classification Results
Page 1

Bank Statement

100%
Page 2

Bank Statement

100%
Page 3

Bank Statement

100%
Page 4

Bank Statement

100%
Page 5

Bank Statement

100%
Page 6

Bank Statement

98%
Page 7

Credit Card

100%
Page 8

Credit Card

100%
Page 9

Credit Card

98%
Page 10

Credit Card

98%
Page 11

Credit Card

98%
Page 12

Hp Agreement

100%
Page 13

Hp Agreement

95%
Page 14

Hp Agreement

98%
Page 15

Hp Agreement

95%
Page 16

Hp Agreement

95%
Page 17

Unknown

75%
Page 18

Mortgage Statement

100%
Page 19

Mortgage Statement

98%
Page 20

Mortgage Statement

98%
Page 21

Loan Statement

98%
Page 22

Loan Statement

95%
Extracted Documents 5
Document Type Pages Confidence Processing Status Created Actions
Bank Statement 1-6 (6 pages) 100% Failed 2025-12-02 12:56 Processing...
Credit Card 7-11 (5 pages) 99% Processed 2025-12-02 13:02 View
Hp Agreement 12-16 (5 pages) 97% Processed 2025-12-02 13:03 View
Mortgage Statement 18-20 (3 pages) 99% Processed 2025-12-02 13:03 View
Loan Statement 21-22 (2 pages) 96% Processed 2025-12-02 13:03 View
{
  "document_groups": [
    {
      "avg_confidence": 0.9966666666666667,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": null,
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": null,
        "statement_period": "01 JAN 2025 to 31 JAN 2025",
        "total_amount": null
      },
      "document_type": "bank_statement",
      "end_page": 6,
      "pages": [
        {
          "confidence_score": 1.0,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01WUe3apT1J1hy7gY1XNjjxV\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.\",\\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        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2225, output_tokens=327, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "01 JAN 2025 to 31 JAN 2025",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": 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.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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 1,
          "text_length": 2962
        },
        {
          "confidence_score": 1.0,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \u0027BROUGHT FORWARD\u0027 and running balances throughout the period from January 8-16.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_017wRGJ5kidU1aRk6Sh5g5c5\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \\\u0027BROUGHT FORWARD\\\u0027 and running balances throughout the period from January 8-16.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2289, output_tokens=320, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \u0027BROUGHT FORWARD\u0027 and running balances throughout the period from January 8-16.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \u0027BROUGHT FORWARD\u0027 and running balances throughout the period from January 8-16.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 2,
          "text_length": 3154
        },
        {
          "confidence_score": 1.0,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank 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\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_018ghcBLPVUHqs386AnLLcyp\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank 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\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2294, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank account statements.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank 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\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "bank_statement"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.13333333333333333,
              "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 3,
          "text_length": 3463
        },
        {
          "confidence_score": 1.0,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01CyMCZLiQWbu2B2uivE1WLi\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2352, output_tokens=334, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 4,
          "text_length": 3080
        },
        {
          "confidence_score": 1.0,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and \u0027BROUGHT FORWARD\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01YYc7iFLJkHjHscEYSMGRBt\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and \\\u0027BROUGHT FORWARD\\\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1474, output_tokens=297, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and \u0027BROUGHT FORWARD\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and \u0027BROUGHT FORWARD\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_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
                }
              },
              "type": "nominal_ledger"
            }
          },
          "page_number": 5,
          "text_length": 1219
        },
        {
          "confidence_score": 0.98,
          "document_type": "bank_statement",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \u0027BUSINESS CURRENT ACCOUNT\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01WFCdPYY5xNwDbQgUxR6WzX\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \\\u0027BUSINESS CURRENT ACCOUNT\\\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1736, output_tokens=301, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \u0027BUSINESS CURRENT ACCOUNT\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.",
                "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \u0027BUSINESS CURRENT ACCOUNT\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll": {
                  "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.9879999999999999,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": null,
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": null,
        "statement_period": "26/06/24",
        "total_amount": null
      },
      "document_type": "credit_card",
      "end_page": 11,
      "pages": [
        {
          "confidence_score": 1.0,
          "document_type": "credit_card",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01E7dpPiHHgtWBphxi55tP4k\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1503, output_tokens=307, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.",
                "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_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
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 7,
          "text_length": 1691
        },
        {
          "confidence_score": 1.0,
          "document_type": "credit_card",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01LPwumMGTAArS38EScjCXHD\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.\",\\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\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1951, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "26/06/24",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.",
                "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "credit_card"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 8,
          "text_length": 3498
        },
        {
          "confidence_score": 0.98,
          "document_type": "credit_card",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \u0027Total new spend transactions\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01NkXnJZu4QesBibp43qCpsj\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \\\u0027Total new spend transactions\\\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.\",\\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\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1105, output_tokens=301, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "26/06/24",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \u0027Total new spend transactions\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.",
                "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \u0027Total new spend transactions\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "credit_card"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.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
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 9,
          "text_length": 401
        },
        {
          "confidence_score": 0.98,
          "document_type": "credit_card",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01WvCU2WpwuzMZCQ2ztpuF6W\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.\",\\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        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1559, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "20/05/24 to 19/06/24",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.",
                "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "credit_card"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.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
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 10,
          "text_length": 2145
        },
        {
          "confidence_score": 0.98,
          "document_type": "credit_card",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, \u0027American Express Business Platinum Card\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01Y6rQomTgkAPnmHhBRtnk4t\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, \\\u0027American Express Business Platinum Card\\\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.\",\\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\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1164, output_tokens=310, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "26/06/24",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, \u0027American Express Business Platinum Card\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.",
                "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, \u0027American Express Business Platinum Card\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "credit_card"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.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
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll": {
                  "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.966,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": "54256.58",
        "annual_interest_rate": "Finance House Base Rate plus 5% per annum",
        "invoice_date": null,
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": "36 months",
        "monthly_payment": "1760.08",
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": "Aldermore",
        "statement_period": null,
        "total_amount": null
      },
      "document_type": "hp_agreement",
      "end_page": 16,
      "pages": [
        {
          "confidence_score": 1.0,
          "document_type": "hp_agreement",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \u0027Unregulated Hire Purchase (Fixed Rate)\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.\",\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\": \"54256.58\",\n        \"monthly_payment\": \"1760.08\",\n        \"loan_tenure\": \"36 months\",\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_019R2srsKkJRvFzHBQN3vk3Y\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \\\u0027Unregulated Hire Purchase (Fixed Rate)\\\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.\",\\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\": \"54256.58\",\\n        \"monthly_payment\": \"1760.08\",\\n        \"loan_tenure\": \"36 months\",\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1818, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\u0027))"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": "54256.58",
                  "annual_interest_rate": null,
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": "36 months",
                  "monthly_payment": "1760.08",
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \u0027Unregulated Hire Purchase (Fixed Rate)\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.",
                "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \u0027Unregulated Hire Purchase (Fixed Rate)\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.\",\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\": \"54256.58\",\n        \"monthly_payment\": \"1760.08\",\n        \"loan_tenure\": \"36 months\",\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_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
                }
              },
              "type": "hp_agreement"
            }
          },
          "page_number": 12,
          "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\": \"This document is clearly a hire purchase/finance agreement. Key indicators include: references to \u0027this Agreement\u0027, \u0027Terms of Agreement\u0027, \u0027Equipment\u0027, \u0027Supplier\u0027, \u0027Aldermore\u0027 as the finance provider, \u0027amount financed\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial 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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01So6ysDY6JSUZ2Ev9rTpsaQ\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This document is clearly a hire purchase/finance agreement. Key indicators include: references to \\\u0027this Agreement\\\u0027, \\\u0027Terms of Agreement\\\u0027, \\\u0027Equipment\\\u0027, \\\u0027Supplier\\\u0027, \\\u0027Aldermore\\\u0027 as the finance provider, \\\u0027amount financed\\\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial 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        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1642, output_tokens=340, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This document is clearly a hire purchase/finance agreement. Key indicators include: references to \u0027this Agreement\u0027, \u0027Terms of Agreement\u0027, \u0027Equipment\u0027, \u0027Supplier\u0027, \u0027Aldermore\u0027 as the finance provider, \u0027amount financed\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial hire purchase agreements.",
                "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This document is clearly a hire purchase/finance agreement. Key indicators include: references to \u0027this Agreement\u0027, \u0027Terms of Agreement\u0027, \u0027Equipment\u0027, \u0027Supplier\u0027, \u0027Aldermore\u0027 as the finance provider, \u0027amount financed\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial 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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": 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
                },
                "mortgage_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
                }
              },
              "type": "nominal_ledger"
            }
          },
          "page_number": 13,
          "text_length": 4689
        },
        {
          "confidence_score": 0.98,
          "document_type": "hp_agreement",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a hire purchase agreement. Key indicators include: \u0027Terms of Agreement\u0027, \u0027Commencement of Hire\u0027, \u0027Equipment described on page 1\u0027, \u0027Rentals\u0027 (typical HP terminology), \u0027Direct Debit\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\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\": \"Finance House Base Rate plus 5% per annum\",\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_018D7kcix7St3TDZaWu7chWr\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a hire purchase agreement. Key indicators include: \\\u0027Terms of Agreement\\\u0027, \\\u0027Commencement of Hire\\\u0027, \\\u0027Equipment described on page 1\\\u0027, \\\u0027Rentals\\\u0027 (typical HP terminology), \\\u0027Direct Debit\\\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldermore\",\\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\": \"Finance House Base Rate plus 5% per annum\",\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1702, output_tokens=317, server_tool_use=None, service_tier=\u0027standard\u0027))"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": "Finance House Base Rate plus 5% per annum",
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Aldermore",
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a hire purchase agreement. Key indicators include: \u0027Terms of Agreement\u0027, \u0027Commencement of Hire\u0027, \u0027Equipment described on page 1\u0027, \u0027Rentals\u0027 (typical HP terminology), \u0027Direct Debit\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.",
                "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a hire purchase agreement. Key indicators include: \u0027Terms of Agreement\u0027, \u0027Commencement of Hire\u0027, \u0027Equipment described on page 1\u0027, \u0027Rentals\u0027 (typical HP terminology), \u0027Direct Debit\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\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\": \"Finance House Base Rate plus 5% per annum\",\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "financial_statement"
            }
          },
          "page_number": 14,
          "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\": \"This document contains key indicators of a hire purchase agreement including: references to \u0027Equipment\u0027 being hired, \u0027Rentals\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \u0027Aldermore\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \u0027hiring of the Equipment under this Agreement\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01TjG9PMQmtuscCs1HSzeHg7\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This document contains key indicators of a hire purchase agreement including: references to \\\u0027Equipment\\\u0027 being hired, \\\u0027Rentals\\\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \\\u0027Aldermore\\\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \\\u0027hiring of the Equipment under this Agreement\\\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldermore\",\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1714, output_tokens=336, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Aldermore",
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This document contains key indicators of a hire purchase agreement including: references to \u0027Equipment\u0027 being hired, \u0027Rentals\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \u0027Aldermore\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \u0027hiring of the Equipment under this Agreement\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.",
                "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This document contains key indicators of a hire purchase agreement including: references to \u0027Equipment\u0027 being hired, \u0027Rentals\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \u0027Aldermore\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \u0027hiring of the Equipment under this Agreement\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "invoice"
            }
          },
          "page_number": 15,
          "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\": \"This document contains clear hire purchase agreement terminology including: \u0027Option to Purchase\u0027, \u0027Rentals\u0027, \u0027hiring of the Equipment\u0027, \u0027Option to Purchase Fee\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01LG9yvwXiB3UmjtT2mvTprG\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This document contains clear hire purchase agreement terminology including: \\\u0027Option to Purchase\\\u0027, \\\u0027Rentals\\\u0027, \\\u0027hiring of the Equipment\\\u0027, \\\u0027Option to Purchase Fee\\\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldermore\",\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1675, output_tokens=297, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": "Aldermore",
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "This document contains clear hire purchase agreement terminology including: \u0027Option to Purchase\u0027, \u0027Rentals\u0027, \u0027hiring of the Equipment\u0027, \u0027Option to Purchase Fee\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.",
                "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This document contains clear hire purchase agreement terminology including: \u0027Option to Purchase\u0027, \u0027Rentals\u0027, \u0027hiring of the Equipment\u0027, \u0027Option to Purchase Fee\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.05263157894736842,
                  "pattern_score": 0.0,
                  "total_score": 0.050526315789473676
                },
                "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
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 16,
          "text_length": 10817
        }
      ],
      "start_page": 12
    },
    {
      "avg_confidence": 0.9866666666666667,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": "3.59%",
        "invoice_date": null,
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": "\u00a3804.94",
        "mortgage_account_number": "71019693",
        "outstanding_balance": "\u00a3268,984.99",
        "property_address": "160, Humber Avenue, Coventry, CV1 2AR",
        "remaining_term_months": "277",
        "seller_name": null,
        "statement_period": "1 October 2023 to 30 September 2024",
        "total_amount": null
      },
      "document_type": "mortgage_statement",
      "end_page": 20,
      "pages": [
        {
          "confidence_score": 1.0,
          "document_type": "mortgage_statement",
          "features": {
            "llm_based": {
              "confidence": 1.0,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \u0027annual mortgage statement\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.\",\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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"1 October 2023 to 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": \"277\",\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_016v73unnb6io3vL6MvXxfta\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"mortgage_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \\\u0027annual mortgage statement\\\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.\",\\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%\",\\n        \"outstanding_balance\": \"\u00a3268,984.99\",\\n        \"statement_period\": \"1 October 2023 to 30 September 2024\",\\n        \"mortgage_account_number\": \"71019693\",\\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\\n        \"remaining_term_months\": \"277\",\\n        \"monthly_payment_amount\": \"\u00a3804.94\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1611, output_tokens=373, server_tool_use=None, service_tier=\u0027standard\u0027))"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": "3.59%",
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": "\u00a3804.94",
                  "mortgage_account_number": "71019693",
                  "outstanding_balance": "\u00a3268,984.99",
                  "property_address": "160, Humber Avenue, Coventry, CV1 2AR",
                  "remaining_term_months": "277",
                  "seller_name": null,
                  "statement_period": "1 October 2023 to 30 September 2024",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \u0027annual mortgage statement\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.",
                "raw_response": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \u0027annual mortgage statement\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.\",\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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"1 October 2023 to 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": \"277\",\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```"
              },
              "type": "mortgage_statement"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.4912280701754386,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.11764705882352941,
                  "pattern_score": 0.0,
                  "total_score": 0.07058823529411765
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.0,
                  "total_score": 0.03333333333333333
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.2894736842105263,
                  "pattern_score": 0.3333333333333333,
                  "total_score": 0.4912280701754386
                },
                "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
                }
              },
              "type": "mortgage_statement"
            }
          },
          "page_number": 18,
          "text_length": 2038
        },
        {
          "confidence_score": 0.98,
          "document_type": "mortgage_statement",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.\",\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\": \"\u00a3268,999.95\",\n        \"statement_period\": \"1 October 2023 - 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_016E5X5hb7DzByW7JY6QED1d\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"mortgage_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.\",\\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\": \"\u00a3268,999.95\",\\n        \"statement_period\": \"1 October 2023 - 30 September 2024\",\\n        \"mortgage_account_number\": \"71019693\",\\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": \"\u00a3804.94\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1842, output_tokens=389, server_tool_use=None, service_tier=\u0027standard\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,
                  "monthly_payment_amount": "\u00a3804.94",
                  "mortgage_account_number": "71019693",
                  "outstanding_balance": "\u00a3268,999.95",
                  "property_address": "160, Humber Avenue, Coventry, CV1 2AR",
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "1 October 2023 - 30 September 2024",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.",
                "raw_response": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.\",\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\": \"\u00a3268,999.95\",\n        \"statement_period\": \"1 October 2023 - 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```"
              },
              "type": "mortgage_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
                },
                "mortgage_statement": {
                  "keyword_score": 0.07894736842105263,
                  "pattern_score": 0.09523809523809523,
                  "total_score": 0.13674185463659147
                },
                "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
                }
              },
              "type": "bank_statement"
            }
          },
          "page_number": 19,
          "text_length": 2145
        },
        {
          "confidence_score": 0.98,
          "document_type": "mortgage_statement",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \u0027Direct debit\u0027 and \u0027Interest charge\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \u0027Instalment due \u00a3804.94\u0027 which is a mortgage payment, (3) Includes \u0027Total payments made for the period covered by this annual statement\u0027 and \u0027Total interest applied for the period covered by this annual statement\u0027, (4) Contains \u0027Interest rate summary during statement period\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \u0027Your property may be repossessed if you don\u0027t keep up repayments on your mortgage.\u0027 This is a definitive indicator of a mortgage 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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"Period ending 30/09/2024\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01NStP4DVm4JaEvsBYiETMYs\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"mortgage_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \\\u0027Direct debit\\\u0027 and \\\u0027Interest charge\\\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \\\u0027Instalment due \u00a3804.94\\\u0027 which is a mortgage payment, (3) Includes \\\u0027Total payments made for the period covered by this annual statement\\\u0027 and \\\u0027Total interest applied for the period covered by this annual statement\\\u0027, (4) Contains \\\u0027Interest rate summary during statement period\\\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \\\u0027Your property may be repossessed if you don\\\u0027t keep up repayments on your mortgage.\\\u0027 This is a definitive indicator of a mortgage 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%\",\\n        \"outstanding_balance\": \"\u00a3268,984.99\",\\n        \"statement_period\": \"Period ending 30/09/2024\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": \"\u00a3804.94\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1172, output_tokens=399, server_tool_use=None, service_tier=\u0027standard\u0027))"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": "3.59%",
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": "\u00a3804.94",
                  "mortgage_account_number": null,
                  "outstanding_balance": "\u00a3268,984.99",
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "Period ending 30/09/2024",
                  "total_amount": null
                },
                "llm_reasoning": "This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \u0027Direct debit\u0027 and \u0027Interest charge\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \u0027Instalment due \u00a3804.94\u0027 which is a mortgage payment, (3) Includes \u0027Total payments made for the period covered by this annual statement\u0027 and \u0027Total interest applied for the period covered by this annual statement\u0027, (4) Contains \u0027Interest rate summary during statement period\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \u0027Your property may be repossessed if you don\u0027t keep up repayments on your mortgage.\u0027 This is a definitive indicator of a mortgage statement.",
                "raw_response": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \u0027Direct debit\u0027 and \u0027Interest charge\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \u0027Instalment due \u00a3804.94\u0027 which is a mortgage payment, (3) Includes \u0027Total payments made for the period covered by this annual statement\u0027 and \u0027Total interest applied for the period covered by this annual statement\u0027, (4) Contains \u0027Interest rate summary during statement period\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \u0027Your property may be repossessed if you don\u0027t keep up repayments on your mortgage.\u0027 This is a definitive indicator of a mortgage 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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"Period ending 30/09/2024\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```"
              },
              "type": "mortgage_statement"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.10626566416040101,
              "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
                },
                "mortgage_statement": {
                  "keyword_score": 0.07894736842105263,
                  "pattern_score": 0.047619047619047616,
                  "total_score": 0.10626566416040101
                },
                "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
                }
              },
              "type": "mortgage_statement"
            }
          },
          "page_number": 20,
          "text_length": 615
        }
      ],
      "start_page": 18
    },
    {
      "avg_confidence": 0.965,
      "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,
        "monthly_payment_amount": "\u00a3857-863 (variable)",
        "mortgage_account_number": null,
        "outstanding_balance": "14966.52",
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": null,
        "statement_period": "10 August 2024 to 11 August 2025",
        "total_amount": null
      },
      "document_type": "loan_statement",
      "end_page": 22,
      "pages": [
        {
          "confidence_score": 0.98,
          "document_type": "loan_statement",
          "features": {
            "llm_based": {
              "confidence": 0.98,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"loan_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \u0027Loan Account Statement\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.\",\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\",\n        \"statement_period\": \"10 August 2024 to 11 August 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01UXAqsRkiVfqZkosv4GJx32\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"loan_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \\\u0027Loan Account Statement\\\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.\",\\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\",\\n        \"statement_period\": \"10 August 2024 to 11 August 2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1544, output_tokens=356, server_tool_use=None, service_tier=\u0027standard\u0027))"
                },
                "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,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": "14966.52",
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "10 August 2024 to 11 August 2025",
                  "total_amount": null
                },
                "llm_reasoning": "This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \u0027Loan Account Statement\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.",
                "raw_response": "```json\n{\n    \"document_type\": \"loan_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \u0027Loan Account Statement\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.\",\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\",\n        \"statement_period\": \"10 August 2024 to 11 August 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\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
                },
                "mortgage_statement": {
                  "keyword_score": 0.05263157894736842,
                  "pattern_score": 0.0,
                  "total_score": 0.050526315789473676
                },
                "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
                }
              },
              "type": "loan_statement"
            }
          },
          "page_number": 21,
          "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\": \"This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \u0027HPREGSMT\u0027 and reference \u0027CSID/6283263439\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.\",\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\": \"CSID/6283263439\",\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": \"\u00a310,833.49\",\n        \"statement_period\": \"17 Feb 2025 to 11 Aug 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3857-863 (variable)\"\n    }\n}\n```",
                  "response_repr": "Message(id=\u0027msg_01R3f7mQCCfbBiY2AeWvtrof\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"loan_statement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \\\u0027HPREGSMT\\\u0027 and reference \\\u0027CSID/6283263439\\\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.\",\\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\": \"CSID/6283263439\",\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": \"\u00a310,833.49\",\\n        \"statement_period\": \"17 Feb 2025 to 11 Aug 2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": \"\u00a3857-863 (variable)\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1515, output_tokens=390, server_tool_use=None, service_tier=\u0027standard\u0027))"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": "CSID/6283263439",
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": "\u00a3857-863 (variable)",
                  "mortgage_account_number": null,
                  "outstanding_balance": "\u00a310,833.49",
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": "17 Feb 2025 to 11 Aug 2025",
                  "total_amount": null
                },
                "llm_reasoning": "This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \u0027HPREGSMT\u0027 and reference \u0027CSID/6283263439\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.",
                "raw_response": "```json\n{\n    \"document_type\": \"loan_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \u0027HPREGSMT\u0027 and reference \u0027CSID/6283263439\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.\",\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\": \"CSID/6283263439\",\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": \"\u00a310,833.49\",\n        \"statement_period\": \"17 Feb 2025 to 11 Aug 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3857-863 (variable)\"\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
                },
                "mortgage_statement": {
                  "keyword_score": 0.02631578947368421,
                  "pattern_score": 0.0,
                  "total_score": 0.025263157894736838
                },
                "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
                }
              },
              "type": "nominal_ledger"
            }
          },
          "page_number": 22,
          "text_length": 1598
        }
      ],
      "start_page": 21
    }
  ],
  "page_classifications": [
    {
      "confidence_score": 1.0,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01WUe3apT1J1hy7gY1XNjjxV\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.\",\\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        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2225, output_tokens=327, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "01 JAN 2025 to 31 JAN 2025",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a NatWest Business Current Account statement showing account number (94161356), sort code (60-17-21), statement period (01 JAN 2025 to 31 JAN 2025), opening balance (\u00a3635,169.14), closing balance (\u00a3677,740.73), and detailed transaction history with dates, descriptions, paid in/withdrawn amounts, and running balances. Contains typical bank statement elements including automated credits, direct debits, and bill payments.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": 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.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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 1,
      "text_length": 2962
    },
    {
      "confidence_score": 1.0,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \u0027BROUGHT FORWARD\u0027 and running balances throughout the period from January 8-16.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_017wRGJ5kidU1aRk6Sh5g5c5\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \\\u0027BROUGHT FORWARD\\\u0027 and running balances throughout the period from January 8-16.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2289, output_tokens=320, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \u0027BROUGHT FORWARD\u0027 and running balances throughout the period from January 8-16.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and various transaction types (Automated Credit, Bill Payment, Direct Debit). The document shows daily transactions with opening balance \u0027BROUGHT FORWARD\u0027 and running balances throughout the period from January 8-16.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 2,
      "text_length": 3154
    },
    {
      "confidence_score": 1.0,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank 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\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_018ghcBLPVUHqs386AnLLcyp\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank 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\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2294, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank account statements.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Automated Credits, Bill Payments, Direct Debits, and Online Transactions. The format and structure are consistent with standard bank 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\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "bank_statement"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.13333333333333333,
          "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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 3,
      "text_length": 3463
    },
    {
      "confidence_score": 1.0,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01CyMCZLiQWbu2B2uivE1WLi\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=2352, output_tokens=334, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account for J \u0026 J MAINTENANCE (HOLDINGS) LTD. Key indicators include: account number (94161356), sort code (60-17-21), page numbering (4 of 6), transaction dates, descriptions of payments and credits, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and typical banking transactions like Direct Debits, Automated Credits, and Bill Payments. The document shows daily transactions from January 28-31 with a brought forward balance and running balances after each transaction.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 4,
      "text_length": 3080
    },
    {
      "confidence_score": 1.0,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and \u0027BROUGHT FORWARD\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01YYc7iFLJkHjHscEYSMGRBt\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \\\u0027Paid In\\\u0027 and \\\u0027Withdrawn\\\u0027 columns, running balance column, and \\\u0027BROUGHT FORWARD\\\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1474, output_tokens=297, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and \u0027BROUGHT FORWARD\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account number (94161356), sort code (60-17-21), transaction dates, descriptions of automated credits and bill payments, \u0027Paid In\u0027 and \u0027Withdrawn\u0027 columns, running balance column, and \u0027BROUGHT FORWARD\u0027 balance. The document shows typical banking transactions with credits from various businesses and a debit for charges.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_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
            }
          },
          "type": "nominal_ledger"
        }
      },
      "page_number": 5,
      "text_length": 1219
    },
    {
      "confidence_score": 0.98,
      "document_type": "bank_statement",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \u0027BUSINESS CURRENT ACCOUNT\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01WFCdPYY5xNwDbQgUxR6WzX\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"bank_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \\\u0027BUSINESS CURRENT ACCOUNT\\\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1736, output_tokens=301, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \u0027BUSINESS CURRENT ACCOUNT\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.",
            "raw_response": "```json\n{\n    \"document_type\": \"bank_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a bank statement from NatWest showing a Business Current Account. Key indicators include: account name (J \u0026 J MAINTENANCE (HOLDINGS) LTD), account number (94161356), sort code (60-17-21), page numbering (6 of 6), and the header \u0027BUSINESS CURRENT ACCOUNT\u0027. The document contains typical bank statement elements including statement abbreviations, contact information, and FSCS compensation scheme information.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 6,
      "text_length": 4017
    },
    {
      "confidence_score": 1.0,
      "document_type": "credit_card",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01E7dpPiHHgtWBphxi55tP4k\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1503, output_tokens=307, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.",
            "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership/card number (xxxx-xxxxxx-52001), billing period (27 May to 26 June 2024), previous closing balance, new charges, closing balance, payment due date (22 July 2024), spending limit of \u00a31,500.00, and transaction details showing payment received. The document structure and terminology are typical of credit card statements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_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
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 7,
      "text_length": 1691
    },
    {
      "confidence_score": 1.0,
      "document_type": "credit_card",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01LPwumMGTAArS38EScjCXHD\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.\",\\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\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1951, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "26/06/24",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.",
            "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card number (xxxx-xxxxxx-52001), membership number, statement date (26/06/24), next statement date (26/07/24), list of transactions with dates and amounts, merchant names, and payment instructions including Direct Debit and debit card payment options. The document shows typical credit card transaction details with purchase dates, merchant locations, and amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "credit_card"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 8,
      "text_length": 3498
    },
    {
      "confidence_score": 0.98,
      "document_type": "credit_card",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \u0027Total new spend transactions\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01NkXnJZu4QesBibp43qCpsj\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \\\u0027Total new spend transactions\\\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.\",\\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\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1105, output_tokens=301, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "26/06/24",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \u0027Total new spend transactions\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.",
            "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), transaction details with process dates and amounts, and \u0027Total new spend transactions\u0027 summary. The document shows credit card purchases including a hotel booking with foreign spend amounts in GBP.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "credit_card"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.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
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 9,
      "text_length": 401
    },
    {
      "confidence_score": 0.98,
      "document_type": "credit_card",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01WvCU2WpwuzMZCQ2ztpuF6W\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.\",\\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        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1559, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "20/05/24 to 19/06/24",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.",
            "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, card membership number (xxxx-xxxxxx-52001), statement period (20/05/24 to 19/06/24), next statement date (26/07/24), Membership Rewards points balance and tracking, and card-specific information including travel insurance benefits. The document shows typical credit card statement features including points earned based on spending.\",\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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "credit_card"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.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
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 10,
      "text_length": 2145
    },
    {
      "confidence_score": 0.98,
      "document_type": "credit_card",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, \u0027American Express Business Platinum Card\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01Y6rQomTgkAPnmHhBRtnk4t\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"credit_card\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \\\u0027Statement of Account\\\u0027 header, \\\u0027American Express Business Platinum Card\\\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.\",\\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\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1164, output_tokens=310, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "26/06/24",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, \u0027American Express Business Platinum Card\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.",
            "raw_response": "```json\n{\n    \"document_type\": \"credit_card\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly an American Express Business Platinum Card statement. Key indicators include: \u0027Statement of Account\u0027 header, \u0027American Express Business Platinum Card\u0027 branding, membership number (xxxx-xxxxxx-52001), statement date (26/06/24), next statement date (26/07/24), and references to Card Account management. The document is page 5 of 5 of a credit card statement prepared for Christina Brooks at RUEBIK LIMITED.\",\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\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "credit_card"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.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
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 11,
      "text_length": 682
    },
    {
      "confidence_score": 1.0,
      "document_type": "hp_agreement",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \u0027Unregulated Hire Purchase (Fixed Rate)\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.\",\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\": \"54256.58\",\n        \"monthly_payment\": \"1760.08\",\n        \"loan_tenure\": \"36 months\",\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_019R2srsKkJRvFzHBQN3vk3Y\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \\\u0027Unregulated Hire Purchase (Fixed Rate)\\\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.\",\\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\": \"54256.58\",\\n        \"monthly_payment\": \"1760.08\",\\n        \"loan_tenure\": \"36 months\",\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1818, output_tokens=315, server_tool_use=None, service_tier=\u0027standard\u0027))"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": "54256.58",
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": "36 months",
              "monthly_payment": "1760.08",
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \u0027Unregulated Hire Purchase (Fixed Rate)\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.",
            "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly an Unregulated Hire Purchase (Fixed Rate) agreement. Key indicators include: explicit title \u0027Unregulated Hire Purchase (Fixed Rate)\u0027, agreement structure between Aldermore Bank PLC and customer, equipment financing details, balance financed amount, finance charges, monthly rental payments, hire period of 36 months, and option to purchase fee. The document contains all standard HP agreement elements including customer details, equipment details, supplier information, and comprehensive financial terms.\",\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\": \"54256.58\",\n        \"monthly_payment\": \"1760.08\",\n        \"loan_tenure\": \"36 months\",\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_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
            }
          },
          "type": "hp_agreement"
        }
      },
      "page_number": 12,
      "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\": \"This document is clearly a hire purchase/finance agreement. Key indicators include: references to \u0027this Agreement\u0027, \u0027Terms of Agreement\u0027, \u0027Equipment\u0027, \u0027Supplier\u0027, \u0027Aldermore\u0027 as the finance provider, \u0027amount financed\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial 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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01So6ysDY6JSUZ2Ev9rTpsaQ\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This document is clearly a hire purchase/finance agreement. Key indicators include: references to \\\u0027this Agreement\\\u0027, \\\u0027Terms of Agreement\\\u0027, \\\u0027Equipment\\\u0027, \\\u0027Supplier\\\u0027, \\\u0027Aldermore\\\u0027 as the finance provider, \\\u0027amount financed\\\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial 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        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1642, output_tokens=340, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This document is clearly a hire purchase/finance agreement. Key indicators include: references to \u0027this Agreement\u0027, \u0027Terms of Agreement\u0027, \u0027Equipment\u0027, \u0027Supplier\u0027, \u0027Aldermore\u0027 as the finance provider, \u0027amount financed\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial hire purchase agreements.",
            "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This document is clearly a hire purchase/finance agreement. Key indicators include: references to \u0027this Agreement\u0027, \u0027Terms of Agreement\u0027, \u0027Equipment\u0027, \u0027Supplier\u0027, \u0027Aldermore\u0027 as the finance provider, \u0027amount financed\u0027, customer declarations about entering the agreement for business purposes, exemption declarations relating to Financial Services and Markets Act 2000 and Consumer Credit Act 1974, and specific mention of clause 9 (Warranties and Exclusion of Liability). The document contains standard HP agreement language about the relationship between supplier, customer, and finance provider, and includes business exemption declarations typical of commercial 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        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": 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
            },
            "mortgage_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
            }
          },
          "type": "nominal_ledger"
        }
      },
      "page_number": 13,
      "text_length": 4689
    },
    {
      "confidence_score": 0.98,
      "document_type": "hp_agreement",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a hire purchase agreement. Key indicators include: \u0027Terms of Agreement\u0027, \u0027Commencement of Hire\u0027, \u0027Equipment described on page 1\u0027, \u0027Rentals\u0027 (typical HP terminology), \u0027Direct Debit\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\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\": \"Finance House Base Rate plus 5% per annum\",\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_018D7kcix7St3TDZaWu7chWr\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a hire purchase agreement. Key indicators include: \\\u0027Terms of Agreement\\\u0027, \\\u0027Commencement of Hire\\\u0027, \\\u0027Equipment described on page 1\\\u0027, \\\u0027Rentals\\\u0027 (typical HP terminology), \\\u0027Direct Debit\\\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldermore\",\\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\": \"Finance House Base Rate plus 5% per annum\",\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1702, output_tokens=317, server_tool_use=None, service_tier=\u0027standard\u0027))"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": "Finance House Base Rate plus 5% per annum",
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Aldermore",
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a hire purchase agreement. Key indicators include: \u0027Terms of Agreement\u0027, \u0027Commencement of Hire\u0027, \u0027Equipment described on page 1\u0027, \u0027Rentals\u0027 (typical HP terminology), \u0027Direct Debit\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.",
            "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a hire purchase agreement. Key indicators include: \u0027Terms of Agreement\u0027, \u0027Commencement of Hire\u0027, \u0027Equipment described on page 1\u0027, \u0027Rentals\u0027 (typical HP terminology), \u0027Direct Debit\u0027 payment terms, references to Aldermore (a known finance company), and the structure of a finance agreement for equipment hire. The document outlines terms for hiring equipment with rental payments, which is characteristic of hire purchase agreements.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\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\": \"Finance House Base Rate plus 5% per annum\",\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "financial_statement"
        }
      },
      "page_number": 14,
      "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\": \"This document contains key indicators of a hire purchase agreement including: references to \u0027Equipment\u0027 being hired, \u0027Rentals\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \u0027Aldermore\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \u0027hiring of the Equipment under this Agreement\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01TjG9PMQmtuscCs1HSzeHg7\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This document contains key indicators of a hire purchase agreement including: references to \\\u0027Equipment\\\u0027 being hired, \\\u0027Rentals\\\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \\\u0027Aldermore\\\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \\\u0027hiring of the Equipment under this Agreement\\\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldermore\",\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1714, output_tokens=336, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Aldermore",
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This document contains key indicators of a hire purchase agreement including: references to \u0027Equipment\u0027 being hired, \u0027Rentals\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \u0027Aldermore\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \u0027hiring of the Equipment under this Agreement\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.",
            "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This document contains key indicators of a hire purchase agreement including: references to \u0027Equipment\u0027 being hired, \u0027Rentals\u0027 (hire payments), termination clauses, insurance requirements for the equipment, Total Loss provisions, and references to \u0027Aldermore\u0027 as the finance provider. The document discusses the hiring of equipment, payment terms, breach conditions, and repossession rights - all characteristic of hire purchase/finance agreements. The language about \u0027hiring of the Equipment under this Agreement\u0027 and clauses about termination, insurance monies, and equipment loss are definitive indicators of an HP agreement rather than a loan statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 15,
      "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\": \"This document contains clear hire purchase agreement terminology including: \u0027Option to Purchase\u0027, \u0027Rentals\u0027, \u0027hiring of the Equipment\u0027, \u0027Option to Purchase Fee\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01LG9yvwXiB3UmjtT2mvTprG\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This document contains clear hire purchase agreement terminology including: \\\u0027Option to Purchase\\\u0027, \\\u0027Rentals\\\u0027, \\\u0027hiring of the Equipment\\\u0027, \\\u0027Option to Purchase Fee\\\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": \"Aldermore\",\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1675, output_tokens=297, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": "Aldermore",
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This document contains clear hire purchase agreement terminology including: \u0027Option to Purchase\u0027, \u0027Rentals\u0027, \u0027hiring of the Equipment\u0027, \u0027Option to Purchase Fee\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.",
            "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This document contains clear hire purchase agreement terminology including: \u0027Option to Purchase\u0027, \u0027Rentals\u0027, \u0027hiring of the Equipment\u0027, \u0027Option to Purchase Fee\u0027, references to termination of equipment hiring, repossession and sale of equipment, and Aldermore as the finance provider. The structure and legal clauses are typical of hire purchase/finance agreements where equipment is hired with an option to purchase at the end of the term.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": \"Aldermore\",\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "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
            },
            "mortgage_statement": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.050526315789473676
            },
            "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
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 16,
      "text_length": 10817
    },
    {
      "confidence_score": 0.75,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.75,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.75,\n    \"reasoning\": \"This document is a data protection statement that appears to be part of a financial services application or agreement. Key indicators include references to \u0027assess any applications\u0027, \u0027provide the services requested\u0027, \u0027creditworthiness and product suitability\u0027, and \u0027manage your account\u0027. The document mentions Credit Reference Agencies (CRAs), fraud prevention, Anti-Money Laundering checks, and ongoing exchange of information typical of credit/finance agreements. While it doesn\u0027t contain the actual agreement terms, this type of privacy notice is commonly included with HP agreements and other finance contracts. However, no specific HP agreement details (amount financed, monthly payments, etc.) are visible in this excerpt.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01XUjjXZn12HsBDxtme2geVz\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"hp_agreement\",\\n    \"confidence\": 0.75,\\n    \"reasoning\": \"This document is a data protection statement that appears to be part of a financial services application or agreement. Key indicators include references to \\\u0027assess any applications\\\u0027, \\\u0027provide the services requested\\\u0027, \\\u0027creditworthiness and product suitability\\\u0027, and \\\u0027manage your account\\\u0027. The document mentions Credit Reference Agencies (CRAs), fraud prevention, Anti-Money Laundering checks, and ongoing exchange of information typical of credit/finance agreements. While it doesn\\\u0027t contain the actual agreement terms, this type of privacy notice is commonly included with HP agreements and other finance contracts. However, no specific HP agreement details (amount financed, monthly payments, etc.) are visible in this excerpt.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1590, output_tokens=344, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "This document is a data protection statement that appears to be part of a financial services application or agreement. Key indicators include references to \u0027assess any applications\u0027, \u0027provide the services requested\u0027, \u0027creditworthiness and product suitability\u0027, and \u0027manage your account\u0027. The document mentions Credit Reference Agencies (CRAs), fraud prevention, Anti-Money Laundering checks, and ongoing exchange of information typical of credit/finance agreements. While it doesn\u0027t contain the actual agreement terms, this type of privacy notice is commonly included with HP agreements and other finance contracts. However, no specific HP agreement details (amount financed, monthly payments, etc.) are visible in this excerpt.",
            "raw_response": "```json\n{\n    \"document_type\": \"hp_agreement\",\n    \"confidence\": 0.75,\n    \"reasoning\": \"This document is a data protection statement that appears to be part of a financial services application or agreement. Key indicators include references to \u0027assess any applications\u0027, \u0027provide the services requested\u0027, \u0027creditworthiness and product suitability\u0027, and \u0027manage your account\u0027. The document mentions Credit Reference Agencies (CRAs), fraud prevention, Anti-Money Laundering checks, and ongoing exchange of information typical of credit/finance agreements. While it doesn\u0027t contain the actual agreement terms, this type of privacy notice is commonly included with HP agreements and other finance contracts. However, no specific HP agreement details (amount financed, monthly payments, etc.) are visible in this excerpt.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "hp_agreement"
        },
        "method_used": "uncertain",
        "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
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll": {
              "keyword_score": 0.05,
              "pattern_score": 0.0,
              "total_score": 0.03
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 17,
      "text_length": 7424
    },
    {
      "confidence_score": 1.0,
      "document_type": "mortgage_statement",
      "features": {
        "llm_based": {
          "confidence": 1.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \u0027annual mortgage statement\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.\",\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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"1 October 2023 to 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": \"277\",\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_016v73unnb6io3vL6MvXxfta\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"mortgage_statement\",\\n    \"confidence\": 1.0,\\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \\\u0027annual mortgage statement\\\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.\",\\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%\",\\n        \"outstanding_balance\": \"\u00a3268,984.99\",\\n        \"statement_period\": \"1 October 2023 to 30 September 2024\",\\n        \"mortgage_account_number\": \"71019693\",\\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\\n        \"remaining_term_months\": \"277\",\\n        \"monthly_payment_amount\": \"\u00a3804.94\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1611, output_tokens=373, server_tool_use=None, service_tier=\u0027standard\u0027))"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": "3.59%",
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": "\u00a3804.94",
              "mortgage_account_number": "71019693",
              "outstanding_balance": "\u00a3268,984.99",
              "property_address": "160, Humber Avenue, Coventry, CV1 2AR",
              "remaining_term_months": "277",
              "seller_name": null,
              "statement_period": "1 October 2023 to 30 September 2024",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \u0027annual mortgage statement\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.",
            "raw_response": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 1.0,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance/OneSavings Bank. Key indicators include: \u0027annual mortgage statement\u0027, mortgage account number (71019693), property address (160, Humber Avenue, Coventry), remaining term (277 months), monthly payment (\u00a3804.94), interest-only mortgage type, current interest rate (3.59%), and account balance (\u00a3268,984.99). The document explicitly states it is an annual mortgage statement for the period 1 October 2023 to 30 September 2024.\",\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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"1 October 2023 to 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": \"277\",\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```"
          },
          "type": "mortgage_statement"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.4912280701754386,
          "features": {
            "bank_statement": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.0,
              "total_score": 0.07058823529411765
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.2894736842105263,
              "pattern_score": 0.3333333333333333,
              "total_score": 0.4912280701754386
            },
            "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
            }
          },
          "type": "mortgage_statement"
        }
      },
      "page_number": 18,
      "text_length": 2038
    },
    {
      "confidence_score": 0.98,
      "document_type": "mortgage_statement",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.\",\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\": \"\u00a3268,999.95\",\n        \"statement_period\": \"1 October 2023 - 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_016E5X5hb7DzByW7JY6QED1d\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"mortgage_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.\",\\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\": \"\u00a3268,999.95\",\\n        \"statement_period\": \"1 October 2023 - 30 September 2024\",\\n        \"mortgage_account_number\": \"71019693\",\\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": \"\u00a3804.94\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1842, output_tokens=389, server_tool_use=None, service_tier=\u0027standard\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,
              "monthly_payment_amount": "\u00a3804.94",
              "mortgage_account_number": "71019693",
              "outstanding_balance": "\u00a3268,999.95",
              "property_address": "160, Humber Avenue, Coventry, CV1 2AR",
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "1 October 2023 - 30 September 2024",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.",
            "raw_response": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a mortgage statement from Kent Reliance showing: (1) Annual Statement header for period 1 October 2023 - 30 September 2024, (2) Property address listed (160, Humber Avenue, Coventry, CV1 2AR), (3) Regular monthly direct debit payments of \u00a3804.94, (4) Monthly interest charges, (5) Account balance tracking showing outstanding mortgage balance starting at \u00a3269,000.03, (6) Mortgage account number 71019693. The document shows typical mortgage statement features including property address, account holder, regular installment payments, interest charges, and outstanding balance.\",\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\": \"\u00a3268,999.95\",\n        \"statement_period\": \"1 October 2023 - 30 September 2024\",\n        \"mortgage_account_number\": \"71019693\",\n        \"property_address\": \"160, Humber Avenue, Coventry, CV1 2AR\",\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```"
          },
          "type": "mortgage_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
            },
            "mortgage_statement": {
              "keyword_score": 0.07894736842105263,
              "pattern_score": 0.09523809523809523,
              "total_score": 0.13674185463659147
            },
            "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
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 19,
      "text_length": 2145
    },
    {
      "confidence_score": 0.98,
      "document_type": "mortgage_statement",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \u0027Direct debit\u0027 and \u0027Interest charge\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \u0027Instalment due \u00a3804.94\u0027 which is a mortgage payment, (3) Includes \u0027Total payments made for the period covered by this annual statement\u0027 and \u0027Total interest applied for the period covered by this annual statement\u0027, (4) Contains \u0027Interest rate summary during statement period\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \u0027Your property may be repossessed if you don\u0027t keep up repayments on your mortgage.\u0027 This is a definitive indicator of a mortgage 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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"Period ending 30/09/2024\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01NStP4DVm4JaEvsBYiETMYs\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"mortgage_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \\\u0027Direct debit\\\u0027 and \\\u0027Interest charge\\\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \\\u0027Instalment due \u00a3804.94\\\u0027 which is a mortgage payment, (3) Includes \\\u0027Total payments made for the period covered by this annual statement\\\u0027 and \\\u0027Total interest applied for the period covered by this annual statement\\\u0027, (4) Contains \\\u0027Interest rate summary during statement period\\\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \\\u0027Your property may be repossessed if you don\\\u0027t keep up repayments on your mortgage.\\\u0027 This is a definitive indicator of a mortgage 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%\",\\n        \"outstanding_balance\": \"\u00a3268,984.99\",\\n        \"statement_period\": \"Period ending 30/09/2024\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": \"\u00a3804.94\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1172, output_tokens=399, server_tool_use=None, service_tier=\u0027standard\u0027))"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": "3.59%",
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": "\u00a3804.94",
              "mortgage_account_number": null,
              "outstanding_balance": "\u00a3268,984.99",
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "Period ending 30/09/2024",
              "total_amount": null
            },
            "llm_reasoning": "This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \u0027Direct debit\u0027 and \u0027Interest charge\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \u0027Instalment due \u00a3804.94\u0027 which is a mortgage payment, (3) Includes \u0027Total payments made for the period covered by this annual statement\u0027 and \u0027Total interest applied for the period covered by this annual statement\u0027, (4) Contains \u0027Interest rate summary during statement period\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \u0027Your property may be repossessed if you don\u0027t keep up repayments on your mortgage.\u0027 This is a definitive indicator of a mortgage statement.",
            "raw_response": "```json\n{\n    \"document_type\": \"mortgage_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This document is clearly a mortgage statement based on several key indicators: (1) Contains transaction entries showing \u0027Direct debit\u0027 and \u0027Interest charge\u0027 with large balances typical of mortgage accounts (\u00a3268,195.01), (2) Shows \u0027Instalment due \u00a3804.94\u0027 which is a mortgage payment, (3) Includes \u0027Total payments made for the period covered by this annual statement\u0027 and \u0027Total interest applied for the period covered by this annual statement\u0027, (4) Contains \u0027Interest rate summary during statement period\u0027 with annual interest rate of 3.59%, (5) Most importantly, includes the standard mortgage warning text: \u0027Your property may be repossessed if you don\u0027t keep up repayments on your mortgage.\u0027 This is a definitive indicator of a mortgage 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%\",\n        \"outstanding_balance\": \"\u00a3268,984.99\",\n        \"statement_period\": \"Period ending 30/09/2024\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3804.94\"\n    }\n}\n```"
          },
          "type": "mortgage_statement"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.10626566416040101,
          "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
            },
            "mortgage_statement": {
              "keyword_score": 0.07894736842105263,
              "pattern_score": 0.047619047619047616,
              "total_score": 0.10626566416040101
            },
            "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
            }
          },
          "type": "mortgage_statement"
        }
      },
      "page_number": 20,
      "text_length": 615
    },
    {
      "confidence_score": 0.98,
      "document_type": "loan_statement",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"loan_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \u0027Loan Account Statement\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.\",\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\",\n        \"statement_period\": \"10 August 2024 to 11 August 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01UXAqsRkiVfqZkosv4GJx32\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"loan_statement\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \\\u0027Loan Account Statement\\\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.\",\\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\",\\n        \"statement_period\": \"10 August 2024 to 11 August 2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1544, output_tokens=356, server_tool_use=None, service_tier=\u0027standard\u0027))"
            },
            "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,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": "14966.52",
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "10 August 2024 to 11 August 2025",
              "total_amount": null
            },
            "llm_reasoning": "This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \u0027Loan Account Statement\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.",
            "raw_response": "```json\n{\n    \"document_type\": \"loan_statement\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"This is clearly a Barclayloan for Business Loan Account Statement from Barclays Bank. Key indicators include: \u0027Loan Account Statement\u0027 header, account reference number (23653883476995), statement period (10 August 2024 to 11 August 2025), annual interest rate (2.500%), transaction history showing regular Direct Debit Payments and interest charges, and DR (debit) balances throughout. The document shows loan repayment activity with decreasing balance from \u00a320,833.45 to approximately \u00a314,966.52.\",\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\",\n        \"statement_period\": \"10 August 2024 to 11 August 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\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
            },
            "mortgage_statement": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.050526315789473676
            },
            "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
            }
          },
          "type": "loan_statement"
        }
      },
      "page_number": 21,
      "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\": \"This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \u0027HPREGSMT\u0027 and reference \u0027CSID/6283263439\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.\",\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\": \"CSID/6283263439\",\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": \"\u00a310,833.49\",\n        \"statement_period\": \"17 Feb 2025 to 11 Aug 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3857-863 (variable)\"\n    }\n}\n```",
              "response_repr": "Message(id=\u0027msg_01R3f7mQCCfbBiY2AeWvtrof\u0027, content=[TextBlock(citations=None, text=\u0027```json\\n{\\n    \"document_type\": \"loan_statement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \\\u0027HPREGSMT\\\u0027 and reference \\\u0027CSID/6283263439\\\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.\",\\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\": \"CSID/6283263439\",\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": \"\u00a310,833.49\",\\n        \"statement_period\": \"17 Feb 2025 to 11 Aug 2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": \"\u00a3857-863 (variable)\"\\n    }\\n}\\n```\u0027, type=\u0027text\u0027)], model=\u0027claude-sonnet-4-5-20250929\u0027, role=\u0027assistant\u0027, stop_reason=\u0027end_turn\u0027, stop_sequence=None, type=\u0027message\u0027, usage=Usage(cache_creation=CacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, input_tokens=1515, output_tokens=390, server_tool_use=None, service_tier=\u0027standard\u0027))"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": "CSID/6283263439",
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": "\u00a3857-863 (variable)",
              "mortgage_account_number": null,
              "outstanding_balance": "\u00a310,833.49",
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "17 Feb 2025 to 11 Aug 2025",
              "total_amount": null
            },
            "llm_reasoning": "This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \u0027HPREGSMT\u0027 and reference \u0027CSID/6283263439\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.",
            "raw_response": "```json\n{\n    \"document_type\": \"loan_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"This is a loan account statement from Barclays Bank UK PLC showing regular direct debit payments, interest charges, and declining debit (DR) balances. Key indicators include: recurring monthly direct debit payments (ranging from \u00a3857-863), monthly interest charges, declining outstanding balance from \u00a315,000.14 DR to \u00a310,833.49 DR, statement period from Feb 2025 to Aug 2025, and the note about settlement figures. The document code \u0027HPREGSMT\u0027 and reference \u0027CSID/6283263439\u0027 suggest this is a loan repayment statement. The format shows typical loan statement characteristics with payments reducing the principal balance over time.\",\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\": \"CSID/6283263439\",\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": \"\u00a310,833.49\",\n        \"statement_period\": \"17 Feb 2025 to 11 Aug 2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": \"\u00a3857-863 (variable)\"\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
            },
            "mortgage_statement": {
              "keyword_score": 0.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "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
            }
          },
          "type": "nominal_ledger"
        }
      },
      "page_number": 22,
      "text_length": 1598
    }
  ],
  "processing_timestamp": "2025-12-02T12:55:58.964089"
}