pdftract/profiles/builtin/bank_statement/profile.yaml
jedarden 80dbf0f703 feat(profiles): add profile infrastructure and initial fixtures
- Add profile source modules: apply_profile, extraction, extraction_loader, field_extractor, match_eval
- Add profiles CLI subcommand (profiles_cmd.rs)
- Update all 9 built-in profile YAMLs (invoice, receipt, contract, scientific_paper, slide_deck, form, bank_statement, legal_filing, book_chapter)
- Add 50 invoice fixture PDFs
- Add 2 receipt fixture PDFs

Part of: pdftract-3a310 (Phase 7.10 coordinator)
2026-05-31 15:10:51 -04:00

75 lines
1.8 KiB
YAML

# Bank Statement extraction profile
# Matches bank statements with account info, period, balances, transactions
name: bank_statement
description: Bank statement with account info, period, balances, transactions
priority: 42
match:
all:
- any:
- text_contains:
patterns: ["statement of account", "bank statement", "account statement", "transaction history"]
- text_contains:
patterns: ["opening balance", "closing balance", "statement period"]
- structural:
has_table: true
has_form_field: false
has_math: false
page_count:
min: 1
max: 10
extraction:
reading_order: line_dominant
table_detection: default
readability_threshold: 0.5
include_invisible: false
include_headers_footers: false
force_ocr: false
min_block_chars: 0
fields:
account_number:
type: string
extraction:
regex: "account\\s*(?:number|#|no)?\\s*:?,?\\s*(\\*?\\d[\\d\\*]{3,})"
parse: string
statement_period:
type: string
extraction:
near: ["Statement Period", "Period"]
parse: string
opening_balance:
type: decimal
extraction:
near: ["Opening Balance", "Beginning Balance"]
regex: "([\\d,]+\\.\\d{2})"
parse: decimal
closing_balance:
type: decimal
extraction:
near: ["Closing Balance", "Ending Balance", "Current Balance"]
regex: "([\\d,]+\\.\\d{2})"
parse: decimal
transactions:
type: array
extraction:
table_region: largest_table
schema:
- name: date
type: date
required: true
- name: description
type: string
required: true
- name: amount
type: decimal
required: false
- name: balance
type: decimal
required: false
fallback: []