How kyotofin/tax-doc-classifier works
tax-doc-classifier is a TypeScript library that classifies tax-document pages into IRS forms and page kinds, returning probabilities and confidence gating. Its main workflow extracts one PDF page to text, sends text-derived state and form/kind criteria to Jev, optionally asks a second question for selected form families, then returns the result. It also exposes form-ID utilities and strict evaluation scoring. The criteria JSON is generated from IRS materials; the generator and evaluation runners are omitted as tooling. Runtime links are grounded in README usage or the cited source; unsampled integrations are not inferred.
Main entry points: classify.ts Page classifier · state.ts PDF page text · backend.ts Jev backend · criteria.json Form criteria
Components 10
Page input
- PDF page text
src/state.ts - Page state
src/state.ts
Classification runtime
- Page classifier
src/classify.ts - Jev backend
src/backend.ts - TypeSafe Jev
Forms and criteria
- Form criteria
data/criteria.json - Form ID utilities
src/ids.ts
Results and utilities
- Classification result
src/classify.ts - Strict scoring
src/score.ts
Other components
- Library caller
Connections 12
- Library caller → PDF page text: extracts page
README.md - PDF page text → Page state: builds state
src/state.ts - Library caller → Page classifier: classifies text
README.md - Library caller → Form criteria: supplies criteria
README.md - Page classifier → Page state: builds state
src/classify.ts - Page classifier → Form criteria: selects options
src/classify.ts - Page classifier → Jev backend: asks questions
src/classify.ts - Jev backend → TypeSafe Jev: posts request
src/backend.ts - Page classifier → Classification result: returns result
src/classify.ts - Classification result → Library caller: returns result
README.md - Library caller → Form ID utilities: uses ID utilities
README.md - Library caller → Strict scoring: scores result
README.md