Merged PDF Processing Results

Back to Dashboard
PDF Information
Original Filename: TND_Real_Estate_Accounts_and_Corp_Tax_2025_signed_1776082535.pdf
Upload Date: April 13, 2026 at 12:19 PM
Total Pages: 44
Processing Status: Completed
Extraction Summary
Total Documents: 2
Financial Statements: 2
Page Classification Results
Page 1

Financial Statement

95%
Page 2

Financial Statement

90%
Page 3

Unknown

60%
Page 4

Corporation Tax

95%
Page 5

Corporation Tax

95%
Page 6

Corporation Tax

95%
Page 7

Corporation Tax

95%
Page 8

Corporation Tax

95%
Page 9

Corporation Tax

95%
Page 10

Corporation Tax

95%
Page 11

Corporation Tax

95%
Page 12

Corporation Tax

95%
Page 13

Corporation Tax

95%
Page 14

Corporation Tax

98%
Page 15

Corporation Tax

95%
Page 16

Corporation Tax

95%
Page 17

Corporation Tax

95%
Page 18

Corporation Tax

95%
Page 19

Corporation Tax

95%
Page 20

Corporation Tax

95%
Page 21

Corporation Tax

95%
Page 22

Corporation Tax

95%
Page 23

Corporation Tax

95%
Page 24

Corporation Tax

95%
Page 25

Corporation Tax

95%
Page 26

Corporation Tax

95%
Page 27

Corporation Tax

95%
Page 28

Corporation Tax

95%
Page 29

Corporation Tax

95%
Page 30

Corporation Tax

95%
Page 31

Corporation Tax

95%
Page 32

Corporation Tax

95%
Page 33

Corporation Tax

98%
Page 34

Corporation Tax

95%
Page 35

Corporation Tax

95%
Page 36

Corporation Tax

95%
Page 37

Corporation Tax

95%
Page 38

Corporation Tax

95%
Page 39

Corporation Tax

95%
Page 40

Corporation Tax

95%
Page 41

Corporation Tax

95%
Page 42

Corporation Tax

95%
Page 43

Corporation Tax

95%
Page 44

Unknown

2%
Extracted Documents 2
Document Type Pages Confidence Processing Status Created Actions
Financial Statement 1 (1 page) 95% Processed 2026-04-13 12:19 No view available
Financial Statement 2 (1 page) 95% Processed 2026-04-13 12:19 No view available
{
  "document_groups": [
    {
      "avg_confidence": 0.925,
      "document_identifiers": {
        "agreement_date": null,
        "amount_financed": null,
        "annual_interest_rate": null,
        "invoice_date": null,
        "invoice_number": null,
        "loan_reference": null,
        "loan_tenure": null,
        "monthly_payment": null,
        "monthly_payment_amount": null,
        "mortgage_account_number": null,
        "outstanding_balance": null,
        "property_address": null,
        "remaining_term_months": null,
        "seller_name": null,
        "statement_period": null,
        "total_amount": null
      },
      "document_type": "financial_statement",
      "end_page": 2,
      "pages": [
        {
          "confidence_score": 0.95,
          "document_type": "financial_statement",
          "features": {
            "llm_based": {
              "confidence": 0.95,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\u0027 regime, which are key indicators of a financial statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWo3dBl44hY0pFR17h0TT6ECpjB\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"financial_statement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\\\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\\\u0027 regime, which are key indicators of a financial statement.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082682, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=216, prompt_tokens=1294, total_tokens=1510, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_de"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\u0027 regime, which are key indicators of a financial statement.",
                "raw_response": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\u0027 regime, which are key indicators of a financial statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "financial_statement"
            },
            "method_used": "both_agree",
            "pattern_based": {
              "confidence": 0.12378947368421052,
              "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.10526315789473684,
                  "pattern_score": 0.1,
                  "total_score": 0.12378947368421052
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.05555555555555555,
                  "pattern_score": 0.0,
                  "total_score": 0.03333333333333333
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.041666666666666664,
                  "pattern_score": 0.030303030303030304,
                  "total_score": 0.06681818181818183
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "financial_statement"
            }
          },
          "page_number": 1,
          "text_length": 1108
        },
        {
          "confidence_score": 0.9,
          "document_type": "financial_statement",
          "features": {
            "llm_based": {
              "confidence": 0.9,
              "features": {
                "api_response_debug": {
                  "content_preview": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
                  "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWqhNEeREH8bReAexfaruwholoP\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"financial_statement\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082684, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=230, prompt_tokens=1394, total_tokens=1624, completion_tokens_details=CompletionTokensDetails(ac"
                },
                "document_identifiers": {
                  "agreement_date": null,
                  "amount_financed": null,
                  "annual_interest_rate": null,
                  "invoice_date": null,
                  "invoice_number": null,
                  "loan_reference": null,
                  "loan_tenure": null,
                  "monthly_payment": null,
                  "monthly_payment_amount": null,
                  "mortgage_account_number": null,
                  "outstanding_balance": null,
                  "property_address": null,
                  "remaining_term_months": null,
                  "seller_name": null,
                  "statement_period": null,
                  "total_amount": null
                },
                "llm_reasoning": "The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.",
                "raw_response": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
              },
              "type": "financial_statement"
            },
            "method_used": "llm_preferred",
            "pattern_based": {
              "confidence": 0.06681818181818183,
              "features": {
                "bank_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "corporation_tax": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "credit_card": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "financial_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "hp_agreement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "invoice": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "loan_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "mortgage_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "nominal_ledger": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "p32_payroll": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                },
                "payroll_statement": {
                  "keyword_score": 0.041666666666666664,
                  "pattern_score": 0.030303030303030304,
                  "total_score": 0.06681818181818183
                },
                "property_statement": {
                  "keyword_score": 0.0,
                  "pattern_score": 0.0,
                  "total_score": 0.0
                }
              },
              "type": "payroll_statement"
            }
          },
          "page_number": 2,
          "text_length": 1628
        }
      ],
      "start_page": 1
    }
  ],
  "page_classifications": [
    {
      "confidence_score": 0.95,
      "document_type": "financial_statement",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\u0027 regime, which are key indicators of a financial statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWo3dBl44hY0pFR17h0TT6ECpjB\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"financial_statement\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\\\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\\\u0027 regime, which are key indicators of a financial statement.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082682, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=216, prompt_tokens=1294, total_tokens=1510, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_de"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\u0027 regime, which are key indicators of a financial statement.",
            "raw_response": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains a balance sheet with details such as cash at bank, net assets, issued share capital, and shareholders\u0027 funds. It also references compliance with the Companies Act 2006 and mentions the small companies\u0027 regime, which are key indicators of a financial statement.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "financial_statement"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.12378947368421052,
          "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.10526315789473684,
              "pattern_score": 0.1,
              "total_score": 0.12378947368421052
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.041666666666666664,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.06681818181818183
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "financial_statement"
        }
      },
      "page_number": 1,
      "text_length": 1108
    },
    {
      "confidence_score": 0.9,
      "document_type": "financial_statement",
      "features": {
        "llm_based": {
          "confidence": 0.9,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWqhNEeREH8bReAexfaruwholoP\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"financial_statement\",\\n    \"confidence\": 0.9,\\n    \"reasoning\": \"The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082684, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=230, prompt_tokens=1394, total_tokens=1624, completion_tokens_details=CompletionTokensDetails(ac"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.",
            "raw_response": "```json\n{\n    \"document_type\": \"financial_statement\",\n    \"confidence\": 0.9,\n    \"reasoning\": \"The document contains references to statutory accounts, financial periods, dormant accounts, and compliance with the Companies Act 2006. These are key indicators of a financial statement, specifically related to the preparation and approval of company accounts. There are no indicators of transactions, loans, mortgages, or other financial products that would classify it under other categories.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "financial_statement"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.06681818181818183,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.041666666666666664,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.06681818181818183
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "payroll_statement"
        }
      },
      "page_number": 2,
      "text_length": 1628
    },
    {
      "confidence_score": 0.6,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.6,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.6,\n    \"reasoning\": \"The document contains references to a signature, a date, and a document group ID, which are common in invoices. However, there is no explicit mention of key invoice-specific identifiers such as an invoice number, seller name, or total amount, which reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": \"08/12/2025\",\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWseu78Yf3uJcXGeYsZgyCtNU2S\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"invoice\",\\n    \"confidence\": 0.6,\\n    \"reasoning\": \"The document contains references to a signature, a date, and a document group ID, which are common in invoices. However, there is no explicit mention of key invoice-specific identifiers such as an invoice number, seller name, or total amount, which reduces confidence.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": \"08/12/2025\",\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082686, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=219, prompt_tokens=1074, total_tokens=1293, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDet"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": "08/12/2025",
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to a signature, a date, and a document group ID, which are common in invoices. However, there is no explicit mention of key invoice-specific identifiers such as an invoice number, seller name, or total amount, which reduces confidence.",
            "raw_response": "```json\n{\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.6,\n    \"reasoning\": \"The document contains references to a signature, a date, and a document group ID, which are common in invoices. However, there is no explicit mention of key invoice-specific identifiers such as an invoice number, seller name, or total amount, which reduces confidence.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": \"08/12/2025\",\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "invoice"
        },
        "method_used": "uncertain",
        "pattern_based": {
          "confidence": 0.0,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "bank_statement"
        }
      },
      "page_number": 3,
      "text_length": 171
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return for Period ending 29/03/2025,\u0027 references HM Revenue \u0026 Customs (HMRC), and discusses tax return preparation and filing responsibilities. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWtKUYOySIlxwo4OBv9Bi6sYGcn\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document explicitly mentions \\\u0027Corporation Tax Return for Period ending 29/03/2025,\\\u0027 references HM Revenue \u0026 Customs (HMRC), and discusses tax return preparation and filing responsibilities. These are clear indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082687, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=212, prompt_tokens=1305, total_tokens=1517, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_to"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document explicitly mentions \u0027Corporation Tax Return for Period ending 29/03/2025,\u0027 references HM Revenue \u0026 Customs (HMRC), and discusses tax return preparation and filing responsibilities. These are clear indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return for Period ending 29/03/2025,\u0027 references HM Revenue \u0026 Customs (HMRC), and discusses tax return preparation and filing responsibilities. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.22305882352941178,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.2,
              "total_score": 0.22305882352941178
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.1,
              "total_score": 0.08589473684210526
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.041666666666666664,
              "pattern_score": 0.0,
              "total_score": 0.045
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 4,
      "text_length": 1214
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document mentions \u0027Adjustment of Profits Computation,\u0027 \u0027Turnover from Trade or Profession,\u0027 and \u0027Profit Per Accounts,\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWuNkiG6gw1XxXWW16Eiu2OThz4\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document mentions \\\u0027Adjustment of Profits Computation,\\\u0027 \\\u0027Turnover from Trade or Profession,\\\u0027 and \\\u0027Profit Per Accounts,\\\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082688, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=229, prompt_tokens=1075, total_tokens=1304, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoni"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document mentions \u0027Adjustment of Profits Computation,\u0027 \u0027Turnover from Trade or Profession,\u0027 and \u0027Profit Per Accounts,\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document mentions \u0027Adjustment of Profits Computation,\u0027 \u0027Turnover from Trade or Profession,\u0027 and \u0027Profit Per Accounts,\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.042352941176470586,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 5,
      "text_length": 234
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains key indicators such as \u0027Corporation Tax Calculation,\u0027 \u0027Profits Chargeable to Corporation Tax,\u0027 \u0027Group Relief,\u0027 and references to specific tax periods (e.g., \u0027For period 30/03/2024 to 29/03/2025\u0027). These terms are strongly associated with corporation tax documents, particularly CT600 forms or related tax computations.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWwgAbZf3dXdB6UXC4dRphb2bZI\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains key indicators such as \\\u0027Corporation Tax Calculation,\\\u0027 \\\u0027Profits Chargeable to Corporation Tax,\\\u0027 \\\u0027Group Relief,\\\u0027 and references to specific tax periods (e.g., \\\u0027For period 30/03/2024 to 29/03/2025\\\u0027). These terms are strongly associated with corporation tax documents, particularly CT600 forms or related tax computations.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082690, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=238, prompt_tokens=1342, total_tokens=1580, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reason"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains key indicators such as \u0027Corporation Tax Calculation,\u0027 \u0027Profits Chargeable to Corporation Tax,\u0027 \u0027Group Relief,\u0027 and references to specific tax periods (e.g., \u0027For period 30/03/2024 to 29/03/2025\u0027). These terms are strongly associated with corporation tax documents, particularly CT600 forms or related tax computations.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains key indicators such as \u0027Corporation Tax Calculation,\u0027 \u0027Profits Chargeable to Corporation Tax,\u0027 \u0027Group Relief,\u0027 and references to specific tax periods (e.g., \u0027For period 30/03/2024 to 29/03/2025\u0027). These terms are strongly associated with corporation tax documents, particularly CT600 forms or related tax computations.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.0757894736842105,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.047368421052631574
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "financial_statement"
        }
      },
      "page_number": 6,
      "text_length": 1165
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax, such as \u0027Corporation Tax Payable,\u0027 \u0027Rate of tax,\u0027 \u0027Marginal relief,\u0027 and \u0027Corporation Tax Chargeable.\u0027 It also includes terms like \u0027Losses Memorandum,\u0027 \u0027Group Relief,\u0027 and \u0027CT600,\u0027 which are specific to corporation tax computations. Additionally, the document mentions a specific tax period (\u0027For period 30/03/2024 to 29/03/2025\u0027) and is prepared by a business adviser, further confirming its classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAWyqUCg0axRffR4npXJ1pdg7VN6\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax, such as \\\u0027Corporation Tax Payable,\\\u0027 \\\u0027Rate of tax,\\\u0027 \\\u0027Marginal relief,\\\u0027 and \\\u0027Corporation Tax Chargeable.\\\u0027 It also includes terms like \\\u0027Losses Memorandum,\\\u0027 \\\u0027Group Relief,\\\u0027 and \\\u0027CT600,\\\u0027 which are specific to corporation tax computations. Additionally, the document mentions a specific tax period (\\\u0027For period 30/03/2024 to 29/03/2025\\\u0027) and is prepared by a business adviser, further confirming its classification.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082692, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=267, prompt_tokens"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax, such as \u0027Corporation Tax Payable,\u0027 \u0027Rate of tax,\u0027 \u0027Marginal relief,\u0027 and \u0027Corporation Tax Chargeable.\u0027 It also includes terms like \u0027Losses Memorandum,\u0027 \u0027Group Relief,\u0027 and \u0027CT600,\u0027 which are specific to corporation tax computations. Additionally, the document mentions a specific tax period (\u0027For period 30/03/2024 to 29/03/2025\u0027) and is prepared by a business adviser, further confirming its classification.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax, such as \u0027Corporation Tax Payable,\u0027 \u0027Rate of tax,\u0027 \u0027Marginal relief,\u0027 and \u0027Corporation Tax Chargeable.\u0027 It also includes terms like \u0027Losses Memorandum,\u0027 \u0027Group Relief,\u0027 and \u0027CT600,\u0027 which are specific to corporation tax computations. Additionally, the document mentions a specific tax period (\u0027For period 30/03/2024 to 29/03/2025\u0027) and is prepared by a business adviser, further confirming its classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.13270588235294117,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.1,
              "total_score": 0.13270588235294117
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.047368421052631574
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.03681818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 7,
      "text_length": 921
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027UTR\u0027 (Unique Taxpayer Reference), \u0027IRmark\u0027, \u0027Marginal Relief Calculation\u0027, and a financial period. These are key indicators of a corporation tax document, specifically related to HMRC filings like CT600 forms or tax computations.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAX0hw4maV6ICGJkYJAI8bohS80K\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027UTR\\\u0027 (Unique Taxpayer Reference), \\\u0027IRmark\\\u0027, \\\u0027Marginal Relief Calculation\\\u0027, and a financial period. These are key indicators of a corporation tax document, specifically related to HMRC filings like CT600 forms or tax computations.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082694, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=224, prompt_tokens=1146, total_tokens=1370, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_toke"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027UTR\u0027 (Unique Taxpayer Reference), \u0027IRmark\u0027, \u0027Marginal Relief Calculation\u0027, and a financial period. These are key indicators of a corporation tax document, specifically related to HMRC filings like CT600 forms or tax computations.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027UTR\u0027 (Unique Taxpayer Reference), \u0027IRmark\u0027, \u0027Marginal Relief Calculation\u0027, and a financial period. These are key indicators of a corporation tax document, specifically related to HMRC filings like CT600 forms or tax computations.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.0903529411764706,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 8,
      "text_length": 392
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027Qualifying profits\u0027, \u0027Deductions allowance\u0027, \u0027Relevant profits\u0027, \u0027brought forward losses\u0027, and \u0027corporation tax\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific period for tax calculations, which are strong indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAX1bNMbM8kb7lIv80dejmFd9Hz6\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \\\u0027Qualifying profits\\\u0027, \\\u0027Deductions allowance\\\u0027, \\\u0027Relevant profits\\\u0027, \\\u0027brought forward losses\\\u0027, and \\\u0027corporation tax\\\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific period for tax calculations, which are strong indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082695, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=234, prompt_tokens=1251, total_tokens=1485, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0,"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-specific terms such as \u0027Qualifying profits\u0027, \u0027Deductions allowance\u0027, \u0027Relevant profits\u0027, \u0027brought forward losses\u0027, and \u0027corporation tax\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific period for tax calculations, which are strong indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027Qualifying profits\u0027, \u0027Deductions allowance\u0027, \u0027Relevant profits\u0027, \u0027brought forward losses\u0027, and \u0027corporation tax\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific period for tax calculations, which are strong indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.13270588235294117,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.1,
              "total_score": 0.13270588235294117
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 9,
      "text_length": 760
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Company Tax Return,\u0027 \u0027CT600,\u0027 \u0027HM Revenue \u0026 Customs,\u0027 and \u0027corporation tax,\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAX3fHfmU7CeP00SZbVd5LPn1fYg\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document explicitly mentions \\\u0027Company Tax Return,\\\u0027 \\\u0027CT600,\\\u0027 \\\u0027HM Revenue \u0026 Customs,\\\u0027 and \\\u0027corporation tax,\\\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082697, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=225, prompt_tokens=1463, total_tokens=1688, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_predi"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document explicitly mentions \u0027Company Tax Return,\u0027 \u0027CT600,\u0027 \u0027HM Revenue \u0026 Customs,\u0027 and \u0027corporation tax,\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Company Tax Return,\u0027 \u0027CT600,\u0027 \u0027HM Revenue \u0026 Customs,\u0027 and \u0027corporation tax,\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.403764705882353,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.29411764705882354,
              "pattern_score": 0.4,
              "total_score": 0.403764705882353
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 10,
      "text_length": 1776
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains multiple references to CT600 forms, tax calculations, and corporation tax-related terms such as \u0027turnover,\u0027 \u0027trading profits,\u0027 and \u0027tax computation.\u0027 These are strong indicators of a corporation tax return document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAX4Pfvhdkov3TvZuRDK7rkSiSxE\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains multiple references to CT600 forms, tax calculations, and corporation tax-related terms such as \\\u0027turnover,\\\u0027 \\\u0027trading profits,\\\u0027 and \\\u0027tax computation.\\\u0027 These are strong indicators of a corporation tax return document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082698, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=209, prompt_tokens=1496, total_tokens=1705, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, ca"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains multiple references to CT600 forms, tax calculations, and corporation tax-related terms such as \u0027turnover,\u0027 \u0027trading profits,\u0027 and \u0027tax computation.\u0027 These are strong indicators of a corporation tax return document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains multiple references to CT600 forms, tax calculations, and corporation tax-related terms such as \u0027turnover,\u0027 \u0027trading profits,\u0027 and \u0027tax computation.\u0027 These are strong indicators of a corporation tax return document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.17505882352941174,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.1,
              "total_score": 0.17505882352941174
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 11,
      "text_length": 1898
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to Corporation Tax-related terms such as \u0027Annual payments not otherwise charged to Corporation Tax,\u0027 \u0027Non-exempt dividends,\u0027 \u0027Chargeable gains,\u0027 \u0027Profits before deductions and reliefs,\u0027 and \u0027Deductions and reliefs.\u0027 Additionally, it mentions a UTR (Unique Taxpayer Reference) and a specific accounting period, which are typical in corporation tax documents.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2024 to 29/03/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": "ChatCompletion(id=\u0027chatcmpl-DUAX7zCiO8j4LyvQCzpj1Zxhb8iHE\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to Corporation Tax-related terms such as \\\u0027Annual payments not otherwise charged to Corporation Tax,\\\u0027 \\\u0027Non-exempt dividends,\\\u0027 \\\u0027Chargeable gains,\\\u0027 \\\u0027Profits before deductions and reliefs,\\\u0027 and \\\u0027Deductions and reliefs.\\\u0027 Additionally, it mentions a UTR (Unique Taxpayer Reference) and a specific accounting period, which are typical in corporation tax documents.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": \"30/03/2024 to 29/03/2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082701, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=255, prompt_tokens=1357, total_tokens=1612, completion_tokens_details=Co"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "30/03/2024 to 29/03/2025",
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to Corporation Tax-related terms such as \u0027Annual payments not otherwise charged to Corporation Tax,\u0027 \u0027Non-exempt dividends,\u0027 \u0027Chargeable gains,\u0027 \u0027Profits before deductions and reliefs,\u0027 and \u0027Deductions and reliefs.\u0027 Additionally, it mentions a UTR (Unique Taxpayer Reference) and a specific accounting period, which are typical in corporation tax documents.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to Corporation Tax-related terms such as \u0027Annual payments not otherwise charged to Corporation Tax,\u0027 \u0027Non-exempt dividends,\u0027 \u0027Chargeable gains,\u0027 \u0027Profits before deductions and reliefs,\u0027 and \u0027Deductions and reliefs.\u0027 Additionally, it mentions a UTR (Unique Taxpayer Reference) and a specific accounting period, which are typical in corporation tax documents.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2024 to 29/03/2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.21741176470588236,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.23529411764705882,
              "pattern_score": 0.1,
              "total_score": 0.21741176470588236
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.21052631578947367,
              "pattern_score": 0.0,
              "total_score": 0.151578947368421
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 12,
      "text_length": 1454
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Corporation Tax,\u0027 \u0027profits chargeable to Corporation Tax,\u0027 \u0027qualifying donations,\u0027 \u0027group relief,\u0027 and \u0027CT600-like structure.\u0027 It also includes tax calculation details, associated companies, and financial periods, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAX9kTPasz5kk3Mx0KJ72LDtynio\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027Corporation Tax,\\\u0027 \\\u0027profits chargeable to Corporation Tax,\\\u0027 \\\u0027qualifying donations,\\\u0027 \\\u0027group relief,\\\u0027 and \\\u0027CT600-like structure.\\\u0027 It also includes tax calculation details, associated companies, and financial periods, which are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082703, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=228, prompt_tokens=1421, total_tokens=1649, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, "
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027Corporation Tax,\u0027 \u0027profits chargeable to Corporation Tax,\u0027 \u0027qualifying donations,\u0027 \u0027group relief,\u0027 and \u0027CT600-like structure.\u0027 It also includes tax calculation details, associated companies, and financial periods, which are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Corporation Tax,\u0027 \u0027profits chargeable to Corporation Tax,\u0027 \u0027qualifying donations,\u0027 \u0027group relief,\u0027 and \u0027CT600-like structure.\u0027 It also includes tax calculation details, associated companies, and financial periods, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.12705882352941175,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.0,
              "total_score": 0.12705882352941175
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.15789473684210525,
              "pattern_score": 0.0,
              "total_score": 0.11368421052631578
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.1111111111111111,
              "pattern_score": 0.125,
              "total_score": 0.11666666666666667
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.047368421052631574
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 13,
      "text_length": 1548
    },
    {
      "confidence_score": 0.98,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"The document contains multiple references to corporation tax-related terms such as \u0027Corporation Tax chargeable,\u0027 \u0027CT600,\u0027 \u0027Marginal relief,\u0027 \u0027Double Taxation Relief,\u0027 and \u0027Tax calculation.\u0027 Additionally, it includes specific tax-related boxes and calculations, as well as references to the \u0027Coronavirus Job Retention Scheme\u0027 and \u0027Energy levies,\u0027 which are specific to corporation tax filings.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXB496JMRkoaoe6aaYfTiBLDbMO\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"The document contains multiple references to corporation tax-related terms such as \\\u0027Corporation Tax chargeable,\\\u0027 \\\u0027CT600,\\\u0027 \\\u0027Marginal relief,\\\u0027 \\\u0027Double Taxation Relief,\\\u0027 and \\\u0027Tax calculation.\\\u0027 Additionally, it includes specific tax-related boxes and calculations, as well as references to the \\\u0027Coronavirus Job Retention Scheme\\\u0027 and \\\u0027Energy levies,\\\u0027 which are specific to corporation tax filings.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082705, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=241, prompt_tokens=1420, total_tokens=1661, completion_tokens_details=CompletionTokensDe"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains multiple references to corporation tax-related terms such as \u0027Corporation Tax chargeable,\u0027 \u0027CT600,\u0027 \u0027Marginal relief,\u0027 \u0027Double Taxation Relief,\u0027 and \u0027Tax calculation.\u0027 Additionally, it includes specific tax-related boxes and calculations, as well as references to the \u0027Coronavirus Job Retention Scheme\u0027 and \u0027Energy levies,\u0027 which are specific to corporation tax filings.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"The document contains multiple references to corporation tax-related terms such as \u0027Corporation Tax chargeable,\u0027 \u0027CT600,\u0027 \u0027Marginal relief,\u0027 \u0027Double Taxation Relief,\u0027 and \u0027Tax calculation.\u0027 Additionally, it includes specific tax-related boxes and calculations, as well as references to the \u0027Coronavirus Job Retention Scheme\u0027 and \u0027Energy levies,\u0027 which are specific to corporation tax filings.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.26541176470588235,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.23529411764705882,
              "pattern_score": 0.2,
              "total_score": 0.26541176470588235
            },
            "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.125,
              "total_score": 0.11666666666666667
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 14,
      "text_length": 1521
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027CT600\u0027, \u0027self-assessment of tax payable\u0027, \u0027Research and Development credit\u0027, \u0027tax reconciliation\u0027, and \u0027calculation of tax outstanding or overpaid\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific tax period, which are strong indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2024 to 29/03/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": "ChatCompletion(id=\u0027chatcmpl-DUAXCnuuPYB8j2dZA2yA9sRgIzNPb\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \\\u0027CT600\\\u0027, \\\u0027self-assessment of tax payable\\\u0027, \\\u0027Research and Development credit\\\u0027, \\\u0027tax reconciliation\\\u0027, and \\\u0027calculation of tax outstanding or overpaid\\\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific tax period, which are strong indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": \"30/03/2024 to 29/03/2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082706, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=252, prompt_tokens=1386, total_tokens=1638, completion_tokens_details=CompletionTok"
            },
            "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": "30/03/2024 to 29/03/2025",
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-specific terms such as \u0027CT600\u0027, \u0027self-assessment of tax payable\u0027, \u0027Research and Development credit\u0027, \u0027tax reconciliation\u0027, and \u0027calculation of tax outstanding or overpaid\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific tax period, which are strong indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027CT600\u0027, \u0027self-assessment of tax payable\u0027, \u0027Research and Development credit\u0027, \u0027tax reconciliation\u0027, and \u0027calculation of tax outstanding or overpaid\u0027. Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions a specific tax period, which are strong indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2024 to 29/03/2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.11666666666666667,
          "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.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.125,
              "total_score": 0.11666666666666667
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.03681818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 15,
      "text_length": 1446
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to Corporation Tax (e.g., \u0027Ring fence Corporation Tax\u0027, \u0027NI Corporation Tax\u0027, \u0027Corporation Tax (Instalment Payments) Regulations\u0027) and includes terms like \u0027CT600\u0027, \u0027tax reconciliation\u0027, and \u0027tax outstanding\u0027, which are key indicators of a corporation tax return. Additionally, it mentions a specific tax period (\u0027For period 30/03/2024 to 29/03/2025\u0027), which aligns with corporation tax documentation.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXE40eRzTR3OpcLL8JA7AHFj9KK\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to Corporation Tax (e.g., \\\u0027Ring fence Corporation Tax\\\u0027, \\\u0027NI Corporation Tax\\\u0027, \\\u0027Corporation Tax (Instalment Payments) Regulations\\\u0027) and includes terms like \\\u0027CT600\\\u0027, \\\u0027tax reconciliation\\\u0027, and \\\u0027tax outstanding\\\u0027, which are key indicators of a corporation tax return. Additionally, it mentions a specific tax period (\\\u0027For period 30/03/2024 to 29/03/2025\\\u0027), which aligns with corporation tax documentation.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082708, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=258, prompt_tokens=1448, total_tokens=1706, comp"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to Corporation Tax (e.g., \u0027Ring fence Corporation Tax\u0027, \u0027NI Corporation Tax\u0027, \u0027Corporation Tax (Instalment Payments) Regulations\u0027) and includes terms like \u0027CT600\u0027, \u0027tax reconciliation\u0027, and \u0027tax outstanding\u0027, which are key indicators of a corporation tax return. Additionally, it mentions a specific tax period (\u0027For period 30/03/2024 to 29/03/2025\u0027), which aligns with corporation tax documentation.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to Corporation Tax (e.g., \u0027Ring fence Corporation Tax\u0027, \u0027NI Corporation Tax\u0027, \u0027Corporation Tax (Instalment Payments) Regulations\u0027) and includes terms like \u0027CT600\u0027, \u0027tax reconciliation\u0027, and \u0027tax outstanding\u0027, which are key indicators of a corporation tax return. Additionally, it mentions a specific tax period (\u0027For period 30/03/2024 to 29/03/2025\u0027), which aligns with corporation tax documentation.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.13270588235294117,
          "features": {
            "bank_statement": {
              "keyword_score": 0.058823529411764705,
              "pattern_score": 0.0,
              "total_score": 0.03529411764705882
            },
            "corporation_tax": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.1,
              "total_score": 0.13270588235294117
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 16,
      "text_length": 1863
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027R\u0026D claim\u0027, \u0027capital allowances\u0027, \u0027trading profits and losses\u0027, and \u0027HMRC\u0027. Additionally, it includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXGoi6BnZJF4zI6FMj9wcS1y6uw\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027R\u0026D claim\\\u0027, \\\u0027capital allowances\\\u0027, \\\u0027trading profits and losses\\\u0027, and \\\u0027HMRC\\\u0027. Additionally, it includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082710, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=219, prompt_tokens=1453, total_tokens=1672, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prom"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027R\u0026D claim\u0027, \u0027capital allowances\u0027, \u0027trading profits and losses\u0027, and \u0027HMRC\u0027. Additionally, it includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027R\u0026D claim\u0027, \u0027capital allowances\u0027, \u0027trading profits and losses\u0027, and \u0027HMRC\u0027. Additionally, it includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.06666666666666667,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 17,
      "text_length": 1836
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to allowances, charges, and capital allowances related to trading profits and losses, which are typical components of corporation tax computations. Additionally, the presence of a UTR (Unique Taxpayer Reference) and terms like \u0027Enterprise zones,\u0027 \u0027Zero-emission cars,\u0027 and \u0027Annual investment allowance\u0027 strongly indicate a corporation tax document, likely part of a CT600 form or related tax computation.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXHl1HJoRkxxXkqZt9dL4As4LpH\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to allowances, charges, and capital allowances related to trading profits and losses, which are typical components of corporation tax computations. Additionally, the presence of a UTR (Unique Taxpayer Reference) and terms like \\\u0027Enterprise zones,\\\u0027 \\\u0027Zero-emission cars,\\\u0027 and \\\u0027Annual investment allowance\\\u0027 strongly indicate a corporation tax document, likely part of a CT600 form or related tax computation.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082711, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=244, prompt_tokens=1270, total_tokens=1514, complet"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to allowances, charges, and capital allowances related to trading profits and losses, which are typical components of corporation tax computations. Additionally, the presence of a UTR (Unique Taxpayer Reference) and terms like \u0027Enterprise zones,\u0027 \u0027Zero-emission cars,\u0027 and \u0027Annual investment allowance\u0027 strongly indicate a corporation tax document, likely part of a CT600 form or related tax computation.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to allowances, charges, and capital allowances related to trading profits and losses, which are typical components of corporation tax computations. Additionally, the presence of a UTR (Unique Taxpayer Reference) and terms like \u0027Enterprise zones,\u0027 \u0027Zero-emission cars,\u0027 and \u0027Annual investment allowance\u0027 strongly indicate a corporation tax document, likely part of a CT600 form or related tax computation.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.0903529411764706,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 18,
      "text_length": 958
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Qualifying expenditure,\u0027 \u0027Machinery and plant,\u0027 \u0027Losses, deficits and excess amounts,\u0027 \u0027group relief,\u0027 and \u0027UK property business losses.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and an IRmark, which are specific to UK tax documents, particularly corporation tax returns like the CT600 form.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXJcdCPVf0Xl0ptOIvIAebiB6zl\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027Qualifying expenditure,\\\u0027 \\\u0027Machinery and plant,\\\u0027 \\\u0027Losses, deficits and excess amounts,\\\u0027 \\\u0027group relief,\\\u0027 and \\\u0027UK property business losses.\\\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and an IRmark, which are specific to UK tax documents, particularly corporation tax returns like the CT600 form.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082713, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=1282, total_tokens=1524, completion_tokens_details=CompletionTokensDetails(accep"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027Qualifying expenditure,\u0027 \u0027Machinery and plant,\u0027 \u0027Losses, deficits and excess amounts,\u0027 \u0027group relief,\u0027 and \u0027UK property business losses.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and an IRmark, which are specific to UK tax documents, particularly corporation tax returns like the CT600 form.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Qualifying expenditure,\u0027 \u0027Machinery and plant,\u0027 \u0027Losses, deficits and excess amounts,\u0027 \u0027group relief,\u0027 and \u0027UK property business losses.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and an IRmark, which are specific to UK tax documents, particularly corporation tax returns like the CT600 form.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.11368421052631578,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.15789473684210525,
              "pattern_score": 0.0,
              "total_score": 0.11368421052631578
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "financial_statement"
        }
      },
      "page_number": 19,
      "text_length": 1135
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027Corporation Tax Return,\u0027 \u0027group relief,\u0027 \u0027repayments for the period,\u0027 \u0027Payable Research and Development tax credit,\u0027 and \u0027CT600.\u0027 These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXLTWQoJaQOKvVI808Fgq7gHizK\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \\\u0027Corporation Tax Return,\\\u0027 \\\u0027group relief,\\\u0027 \\\u0027repayments for the period,\\\u0027 \\\u0027Payable Research and Development tax credit,\\\u0027 and \\\u0027CT600.\\\u0027 These are clear indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082715, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=217, prompt_tokens=1337, total_tokens=1554, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTo"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-specific terms such as \u0027Corporation Tax Return,\u0027 \u0027group relief,\u0027 \u0027repayments for the period,\u0027 \u0027Payable Research and Development tax credit,\u0027 and \u0027CT600.\u0027 These are clear indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027Corporation Tax Return,\u0027 \u0027group relief,\u0027 \u0027repayments for the period,\u0027 \u0027Payable Research and Development tax credit,\u0027 and \u0027CT600.\u0027 These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.22305882352941178,
          "features": {
            "bank_statement": {
              "keyword_score": 0.058823529411764705,
              "pattern_score": 0.0,
              "total_score": 0.03529411764705882
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.2,
              "total_score": 0.22305882352941178
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 20,
      "text_length": 1468
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to a Company Tax Return, CT600, UTR (Unique Taxpayer Reference), and mentions tax-related declarations and repayment instructions, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXNU9Tv56kBx8v5j0XBP8PpFU3e\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to a Company Tax Return, CT600, UTR (Unique Taxpayer Reference), and mentions tax-related declarations and repayment instructions, which are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082717, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=204, prompt_tokens=1368, total_tokens=1572, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0)), prompt_"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to a Company Tax Return, CT600, UTR (Unique Taxpayer Reference), and mentions tax-related declarations and repayment instructions, which are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to a Company Tax Return, CT600, UTR (Unique Taxpayer Reference), and mentions tax-related declarations and repayment instructions, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.22305882352941178,
          "features": {
            "bank_statement": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.0,
              "total_score": 0.07058823529411765
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.2,
              "total_score": 0.22305882352941178
            },
            "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.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.14285714285714285,
              "total_score": 0.1392857142857143
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 21,
      "text_length": 1359
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return,\u0027 \u0027Corporation Tax Payment Schedule,\u0027 and includes details such as UTR, IRmark, and a tax period. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXOwOEbvXWrdqVB1nx4tXC4Twjr\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document explicitly mentions \\\u0027Corporation Tax Return,\\\u0027 \\\u0027Corporation Tax Payment Schedule,\\\u0027 and includes details such as UTR, IRmark, and a tax period. These are clear indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082718, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=207, prompt_tokens=1183, total_tokens=1390, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0)), prompt_fil"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document explicitly mentions \u0027Corporation Tax Return,\u0027 \u0027Corporation Tax Payment Schedule,\u0027 and includes details such as UTR, IRmark, and a tax period. These are clear indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return,\u0027 \u0027Corporation Tax Payment Schedule,\u0027 and includes details such as UTR, IRmark, and a tax period. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.26541176470588235,
          "features": {
            "bank_statement": {
              "keyword_score": 0.058823529411764705,
              "pattern_score": 0.0,
              "total_score": 0.03529411764705882
            },
            "corporation_tax": {
              "keyword_score": 0.23529411764705882,
              "pattern_score": 0.2,
              "total_score": 0.26541176470588235
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 22,
      "text_length": 540
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return for Period ending 31/03/2025\u0027, references HMRC, and discusses tax return entries and responsibilities. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXPhwuR4VrhpYkVV2NlDthVhyNS\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document explicitly mentions \\\u0027Corporation Tax Return for Period ending 31/03/2025\\\u0027, references HMRC, and discusses tax return entries and responsibilities. These are clear indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082719, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=206, prompt_tokens=1305, total_tokens=1511, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0)), prompt_"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document explicitly mentions \u0027Corporation Tax Return for Period ending 31/03/2025\u0027, references HMRC, and discusses tax return entries and responsibilities. These are clear indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return for Period ending 31/03/2025\u0027, references HMRC, and discusses tax return entries and responsibilities. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.22305882352941178,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.2,
              "total_score": 0.22305882352941178
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.1,
              "total_score": 0.08589473684210526
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.041666666666666664,
              "pattern_score": 0.0,
              "total_score": 0.045
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 23,
      "text_length": 1214
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to \u0027Adjustment of Profits Computation,\u0027 \u0027Turnover from Trade or Profession,\u0027 and \u0027Profit Per Accounts,\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXQFKDcZYdzwNxoEELH55gf1fvo\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to \\\u0027Adjustment of Profits Computation,\\\u0027 \\\u0027Turnover from Trade or Profession,\\\u0027 and \\\u0027Profit Per Accounts,\\\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082720, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=231, prompt_tokens=1075, total_tokens=1306, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tok"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to \u0027Adjustment of Profits Computation,\u0027 \u0027Turnover from Trade or Profession,\u0027 and \u0027Profit Per Accounts,\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to \u0027Adjustment of Profits Computation,\u0027 \u0027Turnover from Trade or Profession,\u0027 and \u0027Profit Per Accounts,\u0027 which are key indicators of a corporation tax document. Additionally, the presence of a UTR (Unique Taxpayer Reference) and an IRmark further supports this classification as a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.042352941176470586,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 24,
      "text_length": 234
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains key indicators such as \u0027Corporation Tax Calculation,\u0027 \u0027Profits Chargeable to Corporation Tax,\u0027 \u0027Group Relief,\u0027 and \u0027Losses/Deficits used in this Computation,\u0027 which are specific to corporation tax documents. Additionally, the period \u002730/03/2025 to 31/03/2025\u0027 aligns with a tax computation period, further confirming the classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXS7jMfWQktfxU65SucCCnhvOSx\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains key indicators such as \\\u0027Corporation Tax Calculation,\\\u0027 \\\u0027Profits Chargeable to Corporation Tax,\\\u0027 \\\u0027Group Relief,\\\u0027 and \\\u0027Losses/Deficits used in this Computation,\\\u0027 which are specific to corporation tax documents. Additionally, the period \\\u002730/03/2025 to 31/03/2025\\\u0027 aligns with a tax computation period, further confirming the classification.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082722, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=1342, total_tokens=1584, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, aud"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains key indicators such as \u0027Corporation Tax Calculation,\u0027 \u0027Profits Chargeable to Corporation Tax,\u0027 \u0027Group Relief,\u0027 and \u0027Losses/Deficits used in this Computation,\u0027 which are specific to corporation tax documents. Additionally, the period \u002730/03/2025 to 31/03/2025\u0027 aligns with a tax computation period, further confirming the classification.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains key indicators such as \u0027Corporation Tax Calculation,\u0027 \u0027Profits Chargeable to Corporation Tax,\u0027 \u0027Group Relief,\u0027 and \u0027Losses/Deficits used in this Computation,\u0027 which are specific to corporation tax documents. Additionally, the period \u002730/03/2025 to 31/03/2025\u0027 aligns with a tax computation period, further confirming the classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.0757894736842105,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.047368421052631574
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "financial_statement"
        }
      },
      "page_number": 25,
      "text_length": 1165
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains multiple references to corporation tax, including terms like \u0027Corporation Tax Payable,\u0027 \u0027Rate of tax,\u0027 \u0027Marginal relief,\u0027 \u0027Corporation Tax Chargeable,\u0027 and \u0027Losses Memorandum.\u0027 Additionally, it mentions a specific tax period (\u0027For period 30/03/2025 to 31/03/2025\u0027) and includes identifiers such as UTR and IRmark, which are commonly associated with corporation tax documents.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXTUGbQoRd1ecIFfVor1BZHtSH8\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains multiple references to corporation tax, including terms like \\\u0027Corporation Tax Payable,\\\u0027 \\\u0027Rate of tax,\\\u0027 \\\u0027Marginal relief,\\\u0027 \\\u0027Corporation Tax Chargeable,\\\u0027 and \\\u0027Losses Memorandum.\\\u0027 Additionally, it mentions a specific tax period (\\\u0027For period 30/03/2025 to 31/03/2025\\\u0027) and includes identifiers such as UTR and IRmark, which are commonly associated with corporation tax documents.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082723, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=254, prompt_tokens=1310, total_tokens=1564, completion_tokens_details=CompletionToken"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains multiple references to corporation tax, including terms like \u0027Corporation Tax Payable,\u0027 \u0027Rate of tax,\u0027 \u0027Marginal relief,\u0027 \u0027Corporation Tax Chargeable,\u0027 and \u0027Losses Memorandum.\u0027 Additionally, it mentions a specific tax period (\u0027For period 30/03/2025 to 31/03/2025\u0027) and includes identifiers such as UTR and IRmark, which are commonly associated with corporation tax documents.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains multiple references to corporation tax, including terms like \u0027Corporation Tax Payable,\u0027 \u0027Rate of tax,\u0027 \u0027Marginal relief,\u0027 \u0027Corporation Tax Chargeable,\u0027 and \u0027Losses Memorandum.\u0027 Additionally, it mentions a specific tax period (\u0027For period 30/03/2025 to 31/03/2025\u0027) and includes identifiers such as UTR and IRmark, which are commonly associated with corporation tax documents.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": 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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.13270588235294117,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.1,
              "total_score": 0.13270588235294117
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.047368421052631574
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.03681818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 26,
      "text_length": 905
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027UTR\u0027 (Unique Taxpayer Reference), \u0027Marginal Relief Calculation,\u0027 \u0027Financial years,\u0027 and \u0027Exempt dividends or distributions per accounts.\u0027 These are key indicators of a corporation tax document, specifically related to tax computations and reliefs. Additionally, the presence of an IRmark and references to financial periods further support this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXVfT9mxMJEqvLT2KgvH3Y3UDWf\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027UTR\\\u0027 (Unique Taxpayer Reference), \\\u0027Marginal Relief Calculation,\\\u0027 \\\u0027Financial years,\\\u0027 and \\\u0027Exempt dividends or distributions per accounts.\\\u0027 These are key indicators of a corporation tax document, specifically related to tax computations and reliefs. Additionally, the presence of an IRmark and references to financial periods further support this classification.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082725, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=1176, total_tokens=1418, complet"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027UTR\u0027 (Unique Taxpayer Reference), \u0027Marginal Relief Calculation,\u0027 \u0027Financial years,\u0027 and \u0027Exempt dividends or distributions per accounts.\u0027 These are key indicators of a corporation tax document, specifically related to tax computations and reliefs. Additionally, the presence of an IRmark and references to financial periods further support this classification.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027UTR\u0027 (Unique Taxpayer Reference), \u0027Marginal Relief Calculation,\u0027 \u0027Financial years,\u0027 and \u0027Exempt dividends or distributions per accounts.\u0027 These are key indicators of a corporation tax document, specifically related to tax computations and reliefs. Additionally, the presence of an IRmark and references to financial periods further support this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.042352941176470586,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 27,
      "text_length": 450
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax, such as \u0027Qualifying profits: Post 1 April 2017 profits chargeable to corporation tax,\u0027 \u0027Deductions allowance,\u0027 and \u0027brought forward losses.\u0027 Additionally, it includes terms like \u0027IRmark,\u0027 \u0027UTR,\u0027 and \u0027Prepared by,\u0027 which are commonly associated with corporation tax returns and computations.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXXS6lHEGtfI090G9r2OCtW3xg5\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax, such as \\\u0027Qualifying profits: Post 1 April 2017 profits chargeable to corporation tax,\\\u0027 \\\u0027Deductions allowance,\\\u0027 and \\\u0027brought forward losses.\\\u0027 Additionally, it includes terms like \\\u0027IRmark,\\\u0027 \\\u0027UTR,\\\u0027 and \\\u0027Prepared by,\\\u0027 which are commonly associated with corporation tax returns and computations.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082727, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=236, prompt_tokens=1242, total_tokens=1478, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0,"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax, such as \u0027Qualifying profits: Post 1 April 2017 profits chargeable to corporation tax,\u0027 \u0027Deductions allowance,\u0027 and \u0027brought forward losses.\u0027 Additionally, it includes terms like \u0027IRmark,\u0027 \u0027UTR,\u0027 and \u0027Prepared by,\u0027 which are commonly associated with corporation tax returns and computations.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax, such as \u0027Qualifying profits: Post 1 April 2017 profits chargeable to corporation tax,\u0027 \u0027Deductions allowance,\u0027 and \u0027brought forward losses.\u0027 Additionally, it includes terms like \u0027IRmark,\u0027 \u0027UTR,\u0027 and \u0027Prepared by,\u0027 which are commonly associated with corporation tax returns and computations.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.13270588235294117,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.1,
              "total_score": 0.13270588235294117
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 28,
      "text_length": 744
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Company Tax Return,\u0027 \u0027CT600,\u0027 \u0027HM Revenue \u0026 Customs,\u0027 and \u0027Corporation Tax Return,\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXYLUDLVea5dVoTegEyqLbbqULi\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document explicitly mentions \\\u0027Company Tax Return,\\\u0027 \\\u0027CT600,\\\u0027 \\\u0027HM Revenue \u0026 Customs,\\\u0027 and \\\u0027Corporation Tax Return,\\\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082728, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=226, prompt_tokens=1468, total_tokens=1694, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejecte"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document explicitly mentions \u0027Company Tax Return,\u0027 \u0027CT600,\u0027 \u0027HM Revenue \u0026 Customs,\u0027 and \u0027Corporation Tax Return,\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Company Tax Return,\u0027 \u0027CT600,\u0027 \u0027HM Revenue \u0026 Customs,\u0027 and \u0027Corporation Tax Return,\u0027 which are clear indicators of a corporation tax document. Additionally, it includes details such as the company name, tax reference, and accounting period, which are typical of corporation tax returns.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.403764705882353,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.29411764705882354,
              "pattern_score": 0.4,
              "total_score": 0.403764705882353
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 29,
      "text_length": 1779
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains multiple references to CT600 forms, corporation tax calculations, and tax-related information such as trading profits, turnover, and supplementary pages for tax purposes. These are clear indicators of a corporation tax return document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXagMN3YNnUI9z2OP4TJDZeU4UB\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains multiple references to CT600 forms, corporation tax calculations, and tax-related information such as trading profits, turnover, and supplementary pages for tax purposes. These are clear indicators of a corporation tax return document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082730, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=206, prompt_tokens=1526, total_tokens=1732, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains multiple references to CT600 forms, corporation tax calculations, and tax-related information such as trading profits, turnover, and supplementary pages for tax purposes. These are clear indicators of a corporation tax return document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains multiple references to CT600 forms, corporation tax calculations, and tax-related information such as trading profits, turnover, and supplementary pages for tax purposes. These are clear indicators of a corporation tax return document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.17505882352941174,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.1,
              "total_score": 0.17505882352941174
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 30,
      "text_length": 1957
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027Corporation Tax,\u0027 \u0027Chargeable gains,\u0027 \u0027Profits before deductions and reliefs,\u0027 \u0027Deductions and reliefs,\u0027 and \u0027CT600-like structure.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions income categories and tax-related computations, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXbEKl4qqfO2gd9LUoWJB8IQETY\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \\\u0027Corporation Tax,\\\u0027 \\\u0027Chargeable gains,\\\u0027 \\\u0027Profits before deductions and reliefs,\\\u0027 \\\u0027Deductions and reliefs,\\\u0027 and \\\u0027CT600-like structure.\\\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions income categories and tax-related computations, which are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082731, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=241, prompt_tokens=1327, total_tokens=1568, completion_tokens_details=CompletionTokensDetails(accep"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-specific terms such as \u0027Corporation Tax,\u0027 \u0027Chargeable gains,\u0027 \u0027Profits before deductions and reliefs,\u0027 \u0027Deductions and reliefs,\u0027 and \u0027CT600-like structure.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions income categories and tax-related computations, which are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-specific terms such as \u0027Corporation Tax,\u0027 \u0027Chargeable gains,\u0027 \u0027Profits before deductions and reliefs,\u0027 \u0027Deductions and reliefs,\u0027 and \u0027CT600-like structure.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) and mentions income categories and tax-related computations, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.21741176470588236,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.23529411764705882,
              "pattern_score": 0.1,
              "total_score": 0.21741176470588236
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.21052631578947367,
              "pattern_score": 0.0,
              "total_score": 0.151578947368421
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.0,
              "total_score": 0.03
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 31,
      "text_length": 1395
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to Corporation Tax-specific terms such as \u0027Profits chargeable to Corporation Tax,\u0027 \u0027Group relief,\u0027 \u0027Qualifying donations,\u0027 and \u0027CT600.\u0027 Additionally, it includes tax calculations, associated companies, and financial year details, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXdtkDsmPdng2q4sMYSTUQhP4Pl\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to Corporation Tax-specific terms such as \\\u0027Profits chargeable to Corporation Tax,\\\u0027 \\\u0027Group relief,\\\u0027 \\\u0027Qualifying donations,\\\u0027 and \\\u0027CT600.\\\u0027 Additionally, it includes tax calculations, associated companies, and financial year details, which are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082733, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=223, prompt_tokens=1396, total_tokens=1619, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to Corporation Tax-specific terms such as \u0027Profits chargeable to Corporation Tax,\u0027 \u0027Group relief,\u0027 \u0027Qualifying donations,\u0027 and \u0027CT600.\u0027 Additionally, it includes tax calculations, associated companies, and financial year details, which are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to Corporation Tax-specific terms such as \u0027Profits chargeable to Corporation Tax,\u0027 \u0027Group relief,\u0027 \u0027Qualifying donations,\u0027 and \u0027CT600.\u0027 Additionally, it includes tax calculations, associated companies, and financial year details, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.17505882352941174,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.1,
              "total_score": 0.17505882352941174
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.15789473684210525,
              "pattern_score": 0.0,
              "total_score": 0.11368421052631578
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.1111111111111111,
              "pattern_score": 0.125,
              "total_score": 0.11666666666666667
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.05263157894736842,
              "pattern_score": 0.0,
              "total_score": 0.047368421052631574
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 32,
      "text_length": 1492
    },
    {
      "confidence_score": 0.98,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.98,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"The document contains multiple references to corporation tax-specific terms such as \u0027Corporation Tax chargeable,\u0027 \u0027CT600,\u0027 \u0027Marginal relief,\u0027 \u0027Double Taxation Relief,\u0027 and \u0027Net Corporation Tax liability.\u0027 Additionally, it includes tax-related calculations and references to HMRC forms, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXfEf0JZKkm1B3sdHQqp0HdA1ar\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.98,\\n    \"reasoning\": \"The document contains multiple references to corporation tax-specific terms such as \\\u0027Corporation Tax chargeable,\\\u0027 \\\u0027CT600,\\\u0027 \\\u0027Marginal relief,\\\u0027 \\\u0027Double Taxation Relief,\\\u0027 and \\\u0027Net Corporation Tax liability.\\\u0027 Additionally, it includes tax-related calculations and references to HMRC forms, which are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082735, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=229, prompt_tokens=1393, total_tokens=1622, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, rea"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains multiple references to corporation tax-specific terms such as \u0027Corporation Tax chargeable,\u0027 \u0027CT600,\u0027 \u0027Marginal relief,\u0027 \u0027Double Taxation Relief,\u0027 and \u0027Net Corporation Tax liability.\u0027 Additionally, it includes tax-related calculations and references to HMRC forms, which are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.98,\n    \"reasoning\": \"The document contains multiple references to corporation tax-specific terms such as \u0027Corporation Tax chargeable,\u0027 \u0027CT600,\u0027 \u0027Marginal relief,\u0027 \u0027Double Taxation Relief,\u0027 and \u0027Net Corporation Tax liability.\u0027 Additionally, it includes tax-related calculations and references to HMRC forms, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.26541176470588235,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.23529411764705882,
              "pattern_score": 0.2,
              "total_score": 0.26541176470588235
            },
            "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.125,
              "total_score": 0.11666666666666667
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 33,
      "text_length": 1463
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027CFC tax,\u0027 \u0027bank levy,\u0027 \u0027self-assessment of tax payable,\u0027 \u0027Research and Development credit,\u0027 and \u0027CT600-like calculations.\u0027 Additionally, it includes a specific tax period (\u0027For period 30/03/2025 to 31/03/2025\u0027) and mentions tax reconciliation, which are strong indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXhGnKpLWbX2JIyVYXd9s4cyb67\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027CFC tax,\\\u0027 \\\u0027bank levy,\\\u0027 \\\u0027self-assessment of tax payable,\\\u0027 \\\u0027Research and Development credit,\\\u0027 and \\\u0027CT600-like calculations.\\\u0027 Additionally, it includes a specific tax period (\\\u0027For period 30/03/2025 to 31/03/2025\\\u0027) and mentions tax reconciliation, which are strong indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082737, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=246, prompt_tokens=1410, total_tokens=1656, completion_tokens_details=CompletionTokensDetails(accepted_pre"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027CFC tax,\u0027 \u0027bank levy,\u0027 \u0027self-assessment of tax payable,\u0027 \u0027Research and Development credit,\u0027 and \u0027CT600-like calculations.\u0027 Additionally, it includes a specific tax period (\u0027For period 30/03/2025 to 31/03/2025\u0027) and mentions tax reconciliation, which are strong indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027CFC tax,\u0027 \u0027bank levy,\u0027 \u0027self-assessment of tax payable,\u0027 \u0027Research and Development credit,\u0027 and \u0027CT600-like calculations.\u0027 Additionally, it includes a specific tax period (\u0027For period 30/03/2025 to 31/03/2025\u0027) and mentions tax reconciliation, which are strong indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.11666666666666667,
          "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.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.125,
              "total_score": 0.11666666666666667
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.0,
              "total_score": 0.065
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.03681818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "invoice"
        }
      },
      "page_number": 34,
      "text_length": 1502
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Corporation Tax\u0027, \u0027CT600\u0027, \u0027tax reconciliation\u0027, \u0027tax outstanding\u0027, and \u0027tax overpaid\u0027. Additionally, it includes specific tax-related computations and references to HMRC regulations, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXiOmR7ZZ7xYVkqkTAA0eAHqzmI\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027Corporation Tax\\\u0027, \\\u0027CT600\\\u0027, \\\u0027tax reconciliation\\\u0027, \\\u0027tax outstanding\\\u0027, and \\\u0027tax overpaid\\\u0027. Additionally, it includes specific tax-related computations and references to HMRC regulations, which are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082738, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=223, prompt_tokens=1448, total_tokens=1671, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_p"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027Corporation Tax\u0027, \u0027CT600\u0027, \u0027tax reconciliation\u0027, \u0027tax outstanding\u0027, and \u0027tax overpaid\u0027. Additionally, it includes specific tax-related computations and references to HMRC regulations, which are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Corporation Tax\u0027, \u0027CT600\u0027, \u0027tax reconciliation\u0027, \u0027tax outstanding\u0027, and \u0027tax overpaid\u0027. Additionally, it includes specific tax-related computations and references to HMRC regulations, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.13270588235294117,
          "features": {
            "bank_statement": {
              "keyword_score": 0.058823529411764705,
              "pattern_score": 0.0,
              "total_score": 0.03529411764705882
            },
            "corporation_tax": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.1,
              "total_score": 0.13270588235294117
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 35,
      "text_length": 1863
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027R\u0026D claim,\u0027 \u0027capital allowances,\u0027 \u0027trading profits and losses,\u0027 and \u0027CT600-like structure.\u0027 It also includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXk1OQfLUmSH9Eu01cVqfX3LRaj\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027R\u0026D claim,\\\u0027 \\\u0027capital allowances,\\\u0027 \\\u0027trading profits and losses,\\\u0027 and \\\u0027CT600-like structure.\\\u0027 It also includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082740, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=220, prompt_tokens=1473, total_tokens=1693, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027R\u0026D claim,\u0027 \u0027capital allowances,\u0027 \u0027trading profits and losses,\u0027 and \u0027CT600-like structure.\u0027 It also includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027R\u0026D claim,\u0027 \u0027capital allowances,\u0027 \u0027trading profits and losses,\u0027 and \u0027CT600-like structure.\u0027 It also includes specific tax-related boxes and calculations, which are indicative of a corporation tax return or related document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.0903529411764706,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 36,
      "text_length": 1889
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027UTR\u0027, \u0027IRmark\u0027, \u0027trading profits and losses\u0027, \u0027capital allowances\u0027, and specific tax-related categories like \u0027Enterprise zones\u0027, \u0027Zero-emission goods vehicles\u0027, and \u0027Annual investment allowance\u0027. Additionally, the presence of a specific period (\u0027For period 30/03/2025 to 31/03/2025\u0027) aligns with tax reporting periods.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2025 to 31/03/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": "ChatCompletion(id=\u0027chatcmpl-DUAXlq2nHkjnMN6IS0BWntU0dYnDs\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027UTR\\\u0027, \\\u0027IRmark\\\u0027, \\\u0027trading profits and losses\\\u0027, \\\u0027capital allowances\\\u0027, and specific tax-related categories like \\\u0027Enterprise zones\\\u0027, \\\u0027Zero-emission goods vehicles\\\u0027, and \\\u0027Annual investment allowance\\\u0027. Additionally, the presence of a specific period (\\\u0027For period 30/03/2025 to 31/03/2025\\\u0027) aligns with tax reporting periods.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": \"30/03/2025 to 31/03/2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082741, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=264, prompt_tokens=1239, total_tokens=1503, completion_tokens_d"
            },
            "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": "30/03/2025 to 31/03/2025",
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027UTR\u0027, \u0027IRmark\u0027, \u0027trading profits and losses\u0027, \u0027capital allowances\u0027, and specific tax-related categories like \u0027Enterprise zones\u0027, \u0027Zero-emission goods vehicles\u0027, and \u0027Annual investment allowance\u0027. Additionally, the presence of a specific period (\u0027For period 30/03/2025 to 31/03/2025\u0027) aligns with tax reporting periods.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027UTR\u0027, \u0027IRmark\u0027, \u0027trading profits and losses\u0027, \u0027capital allowances\u0027, and specific tax-related categories like \u0027Enterprise zones\u0027, \u0027Zero-emission goods vehicles\u0027, and \u0027Annual investment allowance\u0027. Additionally, the presence of a specific period (\u0027For period 30/03/2025 to 31/03/2025\u0027) aligns with tax reporting periods.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2025 to 31/03/2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.0903529411764706,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 37,
      "text_length": 896
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Qualifying expenditure,\u0027 \u0027Losses, deficits and excess amounts,\u0027 \u0027group relief,\u0027 \u0027UK property business losses,\u0027 and \u0027For period 30/03/2025 to 31/03/2025.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) number, which is commonly associated with corporation tax filings. The structure and terminology align with a CT600 form or similar corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXn9Ox1UxKmdSgjTNTc2hT2T9NK\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027Qualifying expenditure,\\\u0027 \\\u0027Losses, deficits and excess amounts,\\\u0027 \\\u0027group relief,\\\u0027 \\\u0027UK property business losses,\\\u0027 and \\\u0027For period 30/03/2025 to 31/03/2025.\\\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) number, which is commonly associated with corporation tax filings. The structure and terminology align with a CT600 form or similar corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082743, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=258, prompt_tokens=1310, total_tokens=1"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027Qualifying expenditure,\u0027 \u0027Losses, deficits and excess amounts,\u0027 \u0027group relief,\u0027 \u0027UK property business losses,\u0027 and \u0027For period 30/03/2025 to 31/03/2025.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) number, which is commonly associated with corporation tax filings. The structure and terminology align with a CT600 form or similar corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Qualifying expenditure,\u0027 \u0027Losses, deficits and excess amounts,\u0027 \u0027group relief,\u0027 \u0027UK property business losses,\u0027 and \u0027For period 30/03/2025 to 31/03/2025.\u0027 Additionally, it includes a UTR (Unique Taxpayer Reference) number, which is commonly associated with corporation tax filings. The structure and terminology align with a CT600 form or similar corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "llm_preferred",
        "pattern_based": {
          "confidence": 0.11368421052631578,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.15789473684210525,
              "pattern_score": 0.0,
              "total_score": 0.11368421052631578
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "financial_statement"
        }
      },
      "page_number": 38,
      "text_length": 1194
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Corporation Tax Return\u0027, \u0027Repayment of Corporation Tax\u0027, \u0027Payable Research and Development tax credit\u0027, \u0027Payable creatives tax credit\u0027, and \u0027Surrender of tax refund within group\u0027. Additionally, it mentions a UTR (Unique Taxpayer Reference) number and a specific tax period, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2025 to 31/03/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": "ChatCompletion(id=\u0027chatcmpl-DUAXoOltokNAyzmey0YQF3NzV0uR3\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \\\u0027Corporation Tax Return\\\u0027, \\\u0027Repayment of Corporation Tax\\\u0027, \\\u0027Payable Research and Development tax credit\\\u0027, \\\u0027Payable creatives tax credit\\\u0027, and \\\u0027Surrender of tax refund within group\\\u0027. Additionally, it mentions a UTR (Unique Taxpayer Reference) number and a specific tax period, which are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": \"30/03/2025 to 31/03/2025\",\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082744, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=257, prompt_tokens=1363, total_tokens=1620, completion_toke"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": "30/03/2025 to 31/03/2025",
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to corporation tax-related terms such as \u0027Corporation Tax Return\u0027, \u0027Repayment of Corporation Tax\u0027, \u0027Payable Research and Development tax credit\u0027, \u0027Payable creatives tax credit\u0027, and \u0027Surrender of tax refund within group\u0027. Additionally, it mentions a UTR (Unique Taxpayer Reference) number and a specific tax period, which are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to corporation tax-related terms such as \u0027Corporation Tax Return\u0027, \u0027Repayment of Corporation Tax\u0027, \u0027Payable Research and Development tax credit\u0027, \u0027Payable creatives tax credit\u0027, and \u0027Surrender of tax refund within group\u0027. Additionally, it mentions a UTR (Unique Taxpayer Reference) number and a specific tax period, which are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": \"30/03/2025 to 31/03/2025\",\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.22305882352941178,
          "features": {
            "bank_statement": {
              "keyword_score": 0.058823529411764705,
              "pattern_score": 0.0,
              "total_score": 0.03529411764705882
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.2,
              "total_score": 0.22305882352941178
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 39,
      "text_length": 1526
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to a Company Tax Return, CT600 Guide, UTR (Unique Taxpayer Reference), and mentions tax-related details such as repayment, declaration, and company profits. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXqqjIFAqdvw2E0R1fT519sEZ6u\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to a Company Tax Return, CT600 Guide, UTR (Unique Taxpayer Reference), and mentions tax-related details such as repayment, declaration, and company profits. These are clear indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082746, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=211, prompt_tokens=1371, total_tokens=1582, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to a Company Tax Return, CT600 Guide, UTR (Unique Taxpayer Reference), and mentions tax-related details such as repayment, declaration, and company profits. These are clear indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to a Company Tax Return, CT600 Guide, UTR (Unique Taxpayer Reference), and mentions tax-related details such as repayment, declaration, and company profits. These are clear indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.22305882352941178,
          "features": {
            "bank_statement": {
              "keyword_score": 0.11764705882352941,
              "pattern_score": 0.0,
              "total_score": 0.07058823529411765
            },
            "corporation_tax": {
              "keyword_score": 0.17647058823529413,
              "pattern_score": 0.2,
              "total_score": 0.22305882352941178
            },
            "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.02631578947368421,
              "pattern_score": 0.0,
              "total_score": 0.025263157894736838
            },
            "nominal_ledger": {
              "keyword_score": 0.08333333333333333,
              "pattern_score": 0.14285714285714285,
              "total_score": 0.1392857142857143
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 40,
      "text_length": 1360
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return\u0027, \u0027Corporation Tax Payment Schedule\u0027, and includes details such as UTR, IRmark, tax due, tax credits, tax already paid, tax outstanding, and a balancing payment date. These are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXr24SvEY6pQ1iBqrBtccndg7GZ\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document explicitly mentions \\\u0027Corporation Tax Return\\\u0027, \\\u0027Corporation Tax Payment Schedule\\\u0027, and includes details such as UTR, IRmark, tax due, tax credits, tax already paid, tax outstanding, and a balancing payment date. These are key indicators of a corporation tax document.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082747, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=221, prompt_tokens=1183, total_tokens=1404, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_detail"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document explicitly mentions \u0027Corporation Tax Return\u0027, \u0027Corporation Tax Payment Schedule\u0027, and includes details such as UTR, IRmark, tax due, tax credits, tax already paid, tax outstanding, and a balancing payment date. These are key indicators of a corporation tax document.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document explicitly mentions \u0027Corporation Tax Return\u0027, \u0027Corporation Tax Payment Schedule\u0027, and includes details such as UTR, IRmark, tax due, tax credits, tax already paid, tax outstanding, and a balancing payment date. These are key indicators of a corporation tax document.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.26541176470588235,
          "features": {
            "bank_statement": {
              "keyword_score": 0.058823529411764705,
              "pattern_score": 0.0,
              "total_score": 0.03529411764705882
            },
            "corporation_tax": {
              "keyword_score": 0.23529411764705882,
              "pattern_score": 0.2,
              "total_score": 0.26541176470588235
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.027777777777777776,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.05181818181818182
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 41,
      "text_length": 539
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to \u0027Corporation Tax Return\u0027, \u0027CT600\u0027, and \u0027TND REAL ESTATE LTD\u0027, which are clear indicators of corporation tax documents. Additionally, the presence of UTR (Unique Taxpayer Reference) numbers and references to tax return dates further confirm this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXt6adcdiENyqTCPHdxZ6RBByzf\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to \\\u0027Corporation Tax Return\\\u0027, \\\u0027CT600\\\u0027, and \\\u0027TND REAL ESTATE LTD\\\u0027, which are clear indicators of corporation tax documents. Additionally, the presence of UTR (Unique Taxpayer Reference) numbers and references to tax return dates further confirm this classification.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null, \\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082749, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=222, prompt_tokens=2122, total_tokens=2344, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), p"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to \u0027Corporation Tax Return\u0027, \u0027CT600\u0027, and \u0027TND REAL ESTATE LTD\u0027, which are clear indicators of corporation tax documents. Additionally, the presence of UTR (Unique Taxpayer Reference) numbers and references to tax return dates further confirm this classification.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to \u0027Corporation Tax Return\u0027, \u0027CT600\u0027, and \u0027TND REAL ESTATE LTD\u0027, which are clear indicators of corporation tax documents. Additionally, the presence of UTR (Unique Taxpayer Reference) numbers and references to tax return dates further confirm this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null, \n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.0903529411764706,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.05555555555555555,
              "pattern_score": 0.125,
              "total_score": 0.08333333333333334
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.030303030303030304,
              "total_score": 0.021818181818181823
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 42,
      "text_length": 3228
    },
    {
      "confidence_score": 0.95,
      "document_type": "corporation_tax",
      "features": {
        "llm_based": {
          "confidence": 0.95,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to \u0027Corporation Tax Return\u0027, \u0027CT600\u0027, and \u0027Annual Accounts\u0027, which are key indicators of corporation tax documents. Additionally, the presence of terms like \u0027TND REAL ESTATE LTD\u0027, \u0027Annual Accounts to 31.03.2025\u0027, and \u002710312280_31-03-2025_CorporationTaxReturn\u0027 further supports this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXvDpnW4tSQRYR2yBJ12HyBkoWr\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"corporation_tax\",\\n    \"confidence\": 0.95,\\n    \"reasoning\": \"The document contains references to \\\u0027Corporation Tax Return\\\u0027, \\\u0027CT600\\\u0027, and \\\u0027Annual Accounts\\\u0027, which are key indicators of corporation tax documents. Additionally, the presence of terms like \\\u0027TND REAL ESTATE LTD\\\u0027, \\\u0027Annual Accounts to 31.03.2025\\\u0027, and \\\u002710312280_31-03-2025_CorporationTaxReturn\\\u0027 further supports this classification.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082751, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=242, prompt_tokens=2185, total_tokens=2427, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tok"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document contains references to \u0027Corporation Tax Return\u0027, \u0027CT600\u0027, and \u0027Annual Accounts\u0027, which are key indicators of corporation tax documents. Additionally, the presence of terms like \u0027TND REAL ESTATE LTD\u0027, \u0027Annual Accounts to 31.03.2025\u0027, and \u002710312280_31-03-2025_CorporationTaxReturn\u0027 further supports this classification.",
            "raw_response": "```json\n{\n    \"document_type\": \"corporation_tax\",\n    \"confidence\": 0.95,\n    \"reasoning\": \"The document contains references to \u0027Corporation Tax Return\u0027, \u0027CT600\u0027, and \u0027Annual Accounts\u0027, which are key indicators of corporation tax documents. Additionally, the presence of terms like \u0027TND REAL ESTATE LTD\u0027, \u0027Annual Accounts to 31.03.2025\u0027, and \u002710312280_31-03-2025_CorporationTaxReturn\u0027 further supports this classification.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```"
          },
          "type": "corporation_tax"
        },
        "method_used": "both_agree",
        "pattern_based": {
          "confidence": 0.0903529411764706,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "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.05555555555555555,
              "pattern_score": 0.0,
              "total_score": 0.03333333333333333
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "corporation_tax"
        }
      },
      "page_number": 43,
      "text_length": 5134
    },
    {
      "confidence_score": 0.015,
      "document_type": "unknown",
      "features": {
        "llm_based": {
          "confidence": 0.0,
          "features": {
            "api_response_debug": {
              "content_preview": "```json\n{\n    \"document_type\": \"unknown\",\n    \"confidence\": 0.2,\n    \"reasoning\": \"The document appears to be a log of actions taken on a digital document using the SignNow Web Application. It includes timestamps, email addresses, IP addresses, and actions such as uploading, viewing, and signing the document. However, it does not contain any financial or business-specific information such as transactions, balances, invoices, payroll details, loan or mortgage information, or property-related data. Therefore, it does not fit into any of the specified categories.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_payment\": null,\n        \"loan_tenure\": null,\n        \"loan_reference\": null,\n        \"annual_interest_rate\": null,\n        \"outstanding_balance\": null,\n        \"statement_period\": null,\n        \"mortgage_account_number\": null,\n        \"property_address\": null,\n        \"remaining_term_months\": null,\n        \"monthly_payment_amount\": null\n    }\n}\n```",
              "response_repr": "ChatCompletion(id=\u0027chatcmpl-DUAXxpSWQ0moI6CcnQpwbmI0NLHGJ\u0027, choices=[Choice(finish_reason=\u0027stop\u0027, index=0, logprobs=None, message=ChatCompletionMessage(content=\u0027```json\\n{\\n    \"document_type\": \"unknown\",\\n    \"confidence\": 0.2,\\n    \"reasoning\": \"The document appears to be a log of actions taken on a digital document using the SignNow Web Application. It includes timestamps, email addresses, IP addresses, and actions such as uploading, viewing, and signing the document. However, it does not contain any financial or business-specific information such as transactions, balances, invoices, payroll details, loan or mortgage information, or property-related data. Therefore, it does not fit into any of the specified categories.\",\\n    \"document_identifiers\": {\\n        \"invoice_number\": null,\\n        \"seller_name\": null,\\n        \"invoice_date\": null,\\n        \"total_amount\": null,\\n        \"agreement_date\": null,\\n        \"amount_financed\": null,\\n        \"monthly_payment\": null,\\n        \"loan_tenure\": null,\\n        \"loan_reference\": null,\\n        \"annual_interest_rate\": null,\\n        \"outstanding_balance\": null,\\n        \"statement_period\": null,\\n        \"mortgage_account_number\": null,\\n        \"property_address\": null,\\n        \"remaining_term_months\": null,\\n        \"monthly_payment_amount\": null\\n    }\\n}\\n```\u0027, refusal=None, role=\u0027assistant\u0027, annotations=[], audio=None, function_call=None, tool_calls=None), content_filter_results={\u0027hate\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027protected_material_code\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027protected_material_text\u0027: {\u0027detected\u0027: False, \u0027filtered\u0027: False}, \u0027self_harm\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027sexual\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}, \u0027violence\u0027: {\u0027filtered\u0027: False, \u0027severity\u0027: \u0027safe\u0027}})], created=1776082753, model=\u0027gpt-4o-2024-11-20\u0027, object=\u0027chat.completion\u0027, service_tier=\u0027default\u0027, system_fingerprint=\u0027fp_af7f7349a4\u0027, usage=CompletionUsage(completion_tokens=251, prompt_tokens=15"
            },
            "document_identifiers": {
              "agreement_date": null,
              "amount_financed": null,
              "annual_interest_rate": null,
              "invoice_date": null,
              "invoice_number": null,
              "loan_reference": null,
              "loan_tenure": null,
              "monthly_payment": null,
              "monthly_payment_amount": null,
              "mortgage_account_number": null,
              "outstanding_balance": null,
              "property_address": null,
              "remaining_term_months": null,
              "seller_name": null,
              "statement_period": null,
              "total_amount": null
            },
            "llm_reasoning": "The document appears to be a log of actions taken on a digital document using the SignNow Web Application. It includes timestamps, email addresses, IP addresses, and actions such as uploading, viewing, and signing the document. However, it does not contain any financial or business-specific information such as transactions, balances, invoices, payroll details, loan or mortgage information, or property-related data. Therefore, it does not fit into any of the specified categories.",
            "raw_response": "```json\n{\n    \"document_type\": \"unknown\",\n    \"confidence\": 0.2,\n    \"reasoning\": \"The document appears to be a log of actions taken on a digital document using the SignNow Web Application. It includes timestamps, email addresses, IP addresses, and actions such as uploading, viewing, and signing the document. However, it does not contain any financial or business-specific information such as transactions, balances, invoices, payroll details, loan or mortgage information, or property-related data. Therefore, it does not fit into any of the specified categories.\",\n    \"document_identifiers\": {\n        \"invoice_number\": null,\n        \"seller_name\": null,\n        \"invoice_date\": null,\n        \"total_amount\": null,\n        \"agreement_date\": null,\n        \"amount_financed\": null,\n        \"monthly_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": "unknown"
        },
        "method_used": "pattern_only",
        "pattern_based": {
          "confidence": 0.015,
          "features": {
            "bank_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "corporation_tax": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "credit_card": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "financial_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "hp_agreement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "invoice": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "loan_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "mortgage_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "nominal_ledger": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "p32_payroll": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            },
            "payroll_statement": {
              "keyword_score": 0.013888888888888888,
              "pattern_score": 0.0,
              "total_score": 0.015
            },
            "property_statement": {
              "keyword_score": 0.0,
              "pattern_score": 0.0,
              "total_score": 0.0
            }
          },
          "type": "payroll_statement"
        }
      },
      "page_number": 44,
      "text_length": 1306
    }
  ],
  "processing_timestamp": "2026-04-13T12:19:14.927694"
}