Pattern matching, not a language model
DocAssessment runs six deterministic steps over your document's own text. Every fact is located by pattern, and no language model reads your document.
Most AI document tools send your raw document directly to a language model and ask it to summarize or interpret. That approach produces confident-sounding output that can invent facts, a failure mode known as hallucination. DocAssessment takes the opposite approach: no language model reads your document at all. For anyone reviewing a contract or agreement before signing, that means each payment term, deadline, and liability clause is located by deterministic pattern matching, and where a finding is tied to specific wording, it traces back to the exact clause that produced it. The six steps below describe how the report is produced.
Last reviewed: October 4, 2026
1. Text Extraction
The first step converts the uploaded file into plain text. The extractor selected depends on the file type:
- PDF: a native PDF text-extraction library handles text-based PDFs and preserves positional data that later feeds table parsing.
- Word documents: a dedicated
.docxconverter reduces the file to plain text while stripping styling artifacts. - Scanned images and image-only PDFs: an optical-character-recognition (OCR) engine reads the text and reports a scan-quality score that later gates the qualification step.
- Pasted text: the input is already plain text, so step 1 is skipped and the pipeline jumps to type detection.
No language model is involved in text extraction. Every character that continues into the pipeline came directly from the file or image the user uploaded.
2. Document Type Detection
Extracted text is classified as one of six supported types (residential lease, employment agreement, insurance policy, general contract, invoice, and quote) using keyword routing against a curated lexicon. The classifier is a short, auditable rules module, not a model. If no category scores high enough, the type returns unknown and the qualification gate refuses the document before payment is requested.
Keyword-based classification was chosen over statistical classifiers because it is deterministic: the same text always produces the same label, and each label is traceable to the token set that triggered it.
3. Content Segmentation
The document is split into labelled sections (header block, parties, term, payment, obligations, termination, references, signatures) using regex patterns tuned per document type. Section boundaries matter because downstream fact extraction weights the same token differently depending on which section it appears in. A dollar amount in a "payment" section, for example, is treated as rent or purchase price; the same amount in a "damages" section is treated as a risk signal.
When the structural pass finds fewer than three sections in certain agreement types, the segmenter falls back to paragraph-level splits so the downstream steps still have enough granularity to produce useful facts.
4. Fact Extraction
Parties, dates, money amounts, and places are extracted using a combination of regular expressions and an in-process natural-language library. That library runs entirely on our own servers, with no network calls and no AI model. It recognises entity suffixes like LLC and Inc., normalizes date strings, and tags money tokens with their currency.
Each candidate fact is scored for context validity (is it inside a plausible section, does it have the expected neighbours, is it a false positive such as an invoice number that looks like a dollar amount) and capped per category to prevent a noisy document from flooding the report.
5. Risk Scoring
A heuristic scorer inspects the extracted clauses and facts for flat, generic risk signals: automatic renewal, a non-compete clause, and indemnification that runs one-directional (each counts only when the clause's own heading says so), a security deposit is required, a late fee applies, and similar patterns. The score starts from a small baseline set by the document type and length, each signal that fires adds a fixed point weight on top of it, and the total is capped at 100. Because of that baseline, a document with no signals still carries a low non-zero score. The score is a relative indicator, not a count of problems found. The contributing tokens are stored, and where a risk flag is tied to specific wording, it traces back to the exact source text in the report.
The scorer is a pure function of the extracted data, not a model. The point weights are fixed configuration, and a risk flag that is tied to specific wording carries the source tokens that triggered it, so anyone reviewing that flag can trace why it fired back to the original text. A flag derived from an aggregate pattern rather than one clause carries no such citation, by design.
6. Building the Report
The last step turns the scored clauses into the cards you read. A card names a category only when the clause's own heading says so; a clause whose heading does not is shown without a category. A card shows the clause's wording only when the passage has a clear start and a clear end. Otherwise the card says "No excerpt shown for this item" rather than showing half a sentence.
Nothing in the report is written by a model. Structured data for this page and every published article follows the schema.org Article specification, with the DocAssessment organization as the declared author. There are no author-identity or personal-bio fields: the analysis is produced by the pipeline described above, not by a named individual.
What this means for you
Because no language model reads your document or writes any part of your report, a model cannot invent a fact in it. Because the extraction is deterministic, running the same document through the pipeline twice produces the same facts and the same risk score. Pattern matching can still misread a passage. Where a risk flag is tied to specific wording, it carries the source tokens that triggered it, so you can verify that flag against the original text before acting on it.
If you want to see the pipeline in action, head to the upload page. If you want to read more background on a specific document type, the articles library covers lease law, employment contracts, insurance, and related topics by jurisdiction.