Datasets:
|
Download README.md from finipher/finipher-us-tax-document-classifier: direct link, hf CLI and curl.
- Browser
- Download file 10.9 kB
-
https://huggingface.co/datasets/finipher/finipher-us-tax-document-classifier/resolve/main/README.md
- Command line
-
hf download hf://datasets/finipher/finipher-us-tax-document-classifier/README.md
-
curl -L -o README.md https://huggingface.co/datasets/finipher/finipher-us-tax-document-classifier/resolve/main/README.md
10.9 kB
| language: | |
| - en | |
| license: cc-by-4.0 | |
| task_categories: | |
| - text-classification | |
| tags: | |
| - finance | |
| - document-classification | |
| - synthetic | |
| - ai-labeled | |
| - programmatic-labels | |
| pretty_name: Finipher Document Classifier Dataset v1.1.0 | |
| configs: | |
| - config_name: document_type | |
| data_files: | |
| - split: train | |
| path: data/document_type/train.parquet | |
| - split: validation | |
| path: data/document_type/validation.parquet | |
| - split: test | |
| path: data/document_type/test.parquet | |
| - config_name: document_type_ids | |
| data_files: | |
| - split: train | |
| path: data/document_type_ids/train.parquet | |
| - split: validation | |
| path: data/document_type_ids/validation.parquet | |
| - split: test | |
| path: data/document_type_ids/test.parquet | |
| - config_name: document_family | |
| data_files: | |
| - split: train | |
| path: data/document_family/train.parquet | |
| - split: validation | |
| path: data/document_family/validation.parquet | |
| - split: test | |
| path: data/document_family/test.parquet | |
| - config_name: document_family_ids | |
| data_files: | |
| - split: train | |
| path: data/document_family_ids/train.parquet | |
| - split: validation | |
| path: data/document_family_ids/validation.parquet | |
| - split: test | |
| path: data/document_family_ids/test.parquet | |
| # Finipher Document Classifier Dataset | |
| Version 1.1.0. A flat supervised text-classification dataset with **13,911 unique synthetic observations**, **95 fine labels** and **49 family labels**. It adds 7,271 programmatically generated rows to the unchanged 6,640 rows of v1.0.0. | |
| ## Why v1.1.0 | |
| The v1.0.0 head (`tax-document-head-20261017-v1`) read a mortgage statement as Form 1098 at 0.86 confidence. The cause was the data, not the encoder: | |
| - No account-statement classes. Mortgage, loan, brokerage, retirement and HSA statements, paystubs, insurance documents, crypto reports, property tax bills and P&L statements had no label, so the softmax had to pick the nearest tax form. | |
| - One template style. Every v1.0 row is about 35 words in a "Form X: Title / Calendar year / fields" pattern. Real extracted text is longer, laid out in many ways and often noisy. | |
| - No hard negatives. Nothing taught the head that a statement which *mentions* Form 1098 is not Form 1098. | |
| - No route for unseen forms. A real tax form outside the vocabulary (SSA-1099, 3921, a state return) could only land on a wrong known form. | |
| ## What changed | |
| | Area | v1.0.0 | v1.1.0 | | |
| | --- | --- | --- | | |
| | Rows | 6,640 | 13,911 (v1.0 rows kept as is) | | |
| | Fine / family labels | 83 / 42 | 95 / 49 (new IDs appended; v1.0 IDs unchanged) | | |
| | Mean words per row | 34.5 | 84.4 for new rows (p90 151) | | |
| | Layouts | 1 template family | stacked, inline, two-column, boxed, flat (pdftotext-like), markdown (Docling-like), CSV export | | |
| | Title position | always first | top 70%, bottom 15%, removed 15% | | |
| | OCR noise | none | about 20% of new rows (glyph swaps, merged words, `$`→`S`) | | |
| | Label source | single AI annotation | programmatic ground truth from the generator (new rows) | | |
| **New fine labels (IDs 83–94):** MORTGAGE_STATEMENT, LOAN_STATEMENT, BROKERAGE_STATEMENT, RETIREMENT_ACCOUNT_STATEMENT, HSA_ACCOUNT_STATEMENT, PAYSTUB, INSURANCE_DOCUMENT, CRYPTO_TAX_REPORT, PROPERTY_TAX_BILL, PROFIT_AND_LOSS_STATEMENT, CONSOLIDATED_1099 and OTHER_TAX_FORM. | |
| **New families (IDs 42–48):** LOAN_STATEMENT, INVESTMENT_STATEMENT, PAYSTUB, INSURANCE_DOCUMENT, CRYPTO_TAX_REPORT, PROPERTY_TAX_BILL and OTHER_TAX_FORM. PROFIT_AND_LOSS_STATEMENT maps to BUSINESS_RECORD and CONSOLIDATED_1099 maps to 1099. | |
| **Realistic rows for existing labels.** Real IRS box labels, OMB numbers, copy lines and payer/recipient blocks, for: | |
| - W-2, W-2C and W-2G | |
| - 1099-INT/DIV/B/R/NEC/MISC/G/K/SA/Q/S/C/DA | |
| - 1098, 1098-T/E/C | |
| - 5498, 5498-SA/ESA | |
| - 1095-A/B/C | |
| - 1040, 1040-X, 1040-ES | |
| - the three K-1s, W-9, 8949, 8283, Schedule C and Schedule E | |
| Statement-style rows were added for: | |
| - bank and card statements | |
| - giving statements and donation appeals | |
| - charity event, medical and purchase receipts | |
| - estimated-tax payment confirmations and tax instructions | |
| - unknown documents | |
| A quarter of form rows are compact snippets with a title line and one to four boxes. A quarter of statement rows are raw account exports: a header row and data rows, with no title. | |
| **Hard negatives.** These pairs share vocabulary by design: | |
| | Document | Easily confused with | | |
| | --- | --- | | |
| | Mortgage statement (and escrow analysis, payoff letter) | 1098 | | |
| | Bank interest summary | 1099-INT | | |
| | Brokerage statement | 1099-DIV, 1099-B, consolidated 1099 | | |
| | Retirement statement | 5498, 1099-R | | |
| | HSA statement | 5498-SA, 1099-SA | | |
| | Paystub, including the final one of the year | W-2 | | |
| | Student loan statement | 1098-E | | |
| | Crypto gain/loss report | 1099-DA, 8949 | | |
| | Property tax bill | 1098 box 10 | | |
| | EOB or declarations page | 1095 | | |
| | P&L | Schedule C | | |
| | Card year-end summary | 1099-K | | |
| | Payment confirmation | 1040-ES voucher | | |
| About half of the statements also carry a line such as "Your Form 1098 will be available by January 31". The label is what the document is, not which forms it mentions. | |
| **UNKNOWN_DOCUMENT** now covers 26 everyday kinds instead of one "illegible fragment" template, for example: utility and phone bills, a lease, vehicle registration, a jury summons, an offer letter, a credit report, a bank ad, a tax-prep flyer, HOA notices, parking tickets, recipes, contact and gradebook CSVs, timesheets and sensor logs. | |
| **OTHER_TAX_FORM** holds 16 real forms outside the vocabulary, for example SSA-1099, RRB-1099, 1099-LTC, 1099-PATR, 1042-S, 3921, 3922, 2439, 8606, the ABLE forms, and IL-1040 / CA 540 / NY IT-201. | |
| ## Files and splits | |
| | Split | Rows | v1.0 rows | v1.1 rows | | |
| | --- | ---: | ---: | ---: | | |
| | Train | 8,864 | 3,984 | 4,880 | | |
| | Validation | 2,516 | 1,328 | 1,188 | | |
| | Test | 2,531 | 1,328 | 1,203 | | |
| - **Held-out layouts.** For every generated label, one of its six layouts appears only in test and another only in validation. The test measures new-layout generalization, not memorized layout. | |
| - **Held-out kinds.** OTHER_TAX_FORM and UNKNOWN_DOCUMENT are split by form or kind. Test contains 3922 and 1098-Q, and school newsletters, insurance letters and résumés, none of which appear in training. | |
| - **Leak checks.** 0 cross-split group leaks, 0 exact-text leaks and 0 digit-normalized leaks (`reports/data-quality.json`). Within-generator near-duplicates were removed: 39 instruction rows and 10 unknown rows. | |
| - **Configs.** `data/<configuration>/<split>.{parquet,jsonl,csv}` holds the four configurations as before. The `*_ids` Parquet files embed Hugging Face ClassLabel names. | |
| - **New metadata columns:** `layout`, `title_mode`, `ocr_noise` and `sub_kind`. Use them for slicing only, never as model input. | |
| - **Two-column CSVs.** `simple_csv/<target>/<split>.csv` has exactly `text,label`. | |
| - **`robustness_views/test_header_masked_v1_1.{parquet,jsonl}`:** every generated test row re-rendered with all title lines removed. It is a paired stress view, not an independent split. The v1.0 view `test_header_masked.parquet` is unchanged. | |
| - **`robustness_views/external_probes_v1_1.jsonl`:** 130 texts outside the generator, each with an `accept` list: | |
| - 66 Finipher platform test fixtures (synthetic PDFs and CSVs) plus 31 hand-written snippets, marked `dev_used_to_find_gaps`; | |
| - 33 hand-written snippets written before the final evaluation was run, marked `blind_written_before_eval`. | |
| - `scripts/v1_1/`: the generator (`specs.py`, `render.py`, `docs.py`, `build.py`), `baseline.py` and `minilm_probe.py`. | |
| - `python scripts/v1_1/build.py` rebuilds the release deterministically, reading v1.0.0 from commit `cad7079`. | |
| ## Measured results | |
| **Character TF-IDF + logistic regression** (`reports/baseline-metrics.json`, train-only fit): | |
| | Target | Test acc. | Test acc., v1.1 rows | Header-masked v1.1 | | |
| | --- | ---: | ---: | ---: | | |
| | Fine type | 99.6% | 99.1% | 97.9% | | |
| | Family | 99.7% | 99.3% | 97.9% | | |
| **Frozen all-MiniLM-L6-v2 with a linear head**, using the production settings (mean pooling, L2 normalization, 128 tokens) (`reports/minilm-probe-metrics.json`). No checkpoint is shipped. | |
| | Evaluation | v1.0 production head | Linear head refit on v1.1 train | | |
| | --- | ---: | ---: | | |
| | v1.0 test rows | 100% | 100% | | |
| | v1.1 test rows, existing labels | 58.1% | 97.2% (all v1.1 test rows) | | |
| | v1.1 header-masked test | — | 94.1% | | |
| | External probes, dev (97) | 40 / 97 | 80 / 97 | | |
| | External probes, blind (33) | 14 / 33 | 29 / 33 | | |
| | Blind probes with confidence ≥ 0.7 | 5 / 6 correct | 22 / 22 correct | | |
| The mortgage statement that started this release goes from **1098 (0.86) to MORTGAGE_STATEMENT (0.99)**. | |
| Remaining errors are concentrated where text alone is ambiguous: | |
| - Loan and mortgage CSV exports that share an identical header with no type word. | |
| - IRA, HSA and 401(k) exports with the same columns as brokerage holdings. | |
| - A Dutch-language bank export. | |
| - 1099-MISC vs 1099-NEC once the title is removed. | |
| The first two are still correct at the family level. Use the file name or account metadata as an extra signal there rather than expecting the text model to guess. | |
| ## Recommended use | |
| 1. **Fine-tune or refit with abstention.** Route anything below a validated confidence threshold, or predicted as UNKNOWN_DOCUMENT or OTHER_TAX_FORM, to review instead of a bucket. On the blind probes every error had confidence < 0.6. | |
| 2. **Calibrate on real documents.** Synthetic test accuracy is an upper bound. Before relying on the threshold, measure it on consented, independently labeled real documents. | |
| 3. **Keep IDs fixed.** IDs 0–82 and 0–41 are the v1.0 IDs. A v1.0 checkpoint loads, but it cannot output the new labels until it is retrained. | |
| 4. **Mind the token budget.** New rows average about 84 words. At 128 tokens, rows whose title sits at the bottom are classified from content alone, which is intended and mirrors real extraction order. | |
| ## Scope, provenance and limits | |
| All rows are synthetic. Names, institutions, amounts and IDs are invented. No private taxpayer documents, production extraction or production model outputs were used. v1.0.0 rows keep their single-AI annotation and lineage. v1.1.0 rows carry generator ground truth and `fgen-*` lineage in `metadata/provenance.jsonl`, including generator hash and seed key. | |
| Programmatic labels are exact with respect to the generator, but the generator is a model of real documents, not real documents. The dataset is US-federal-first and English only. High synthetic scores do not establish real-world, OCR or unseen-layout accuracy, and an UNKNOWN_DOCUMENT or OTHER_TAX_FORM class does not guarantee rejection of every unseen document. A recognized form does not establish receipt, taxability or completeness. **Not production-validated real-document data.** No independent CPA review has been done. | |
| Original synthetic text and annotations use CC BY 4.0. No upload has been performed. | |