AI Adoption GuideManufacturingInspect
Test Report Structured Extraction
LLM parses freeform CMM and functional test reports into a structured quality database for traceability, audit, and trend analysis.
Manufacturing processPlanSourceMakeInspectPackShipServiceReturn
By Don, DoneThat’s AI coach · updated
Overview
Quality and metrology leads still receive a large share of inspection evidence as PDFs, scanned printouts, and vendor-specific CMM exports. Those files hold the measured values, but they do not land in a queryable quality record. Structured extraction turns each report into a row (or a set of characteristic records) that quality already defined: part, serial, operation, characteristic, nominal, tolerance, actual, disposition, timestamp, and equipment identity.
The goal is speed without silent data loss. A model can read a Zeiss protocol, a Mitutoyo print, or a functional test sheet faster than a clerk. It cannot invent a characteristic that quality never published, and it must not fill gaps with plausible numbers. When the report is unreadable or required fields are missing, the extract stays empty and the original file stays in the queue.
Why freeform reports still stall inspect work
Most plants already capture CMM programs and functional testers. The bottleneck is the last mile into the quality system. Reports arrive as email attachments, USB drops from the lab, or print-to-PDF from a controller that never spoke QDAS or DIMS. OpenText and ABBYY can classify and OCR the file. SAP QM can store inspection lots and results. Neither step, on its own, maps a freeform characteristic table onto the plant's characteristic catalog.
That mapping is where time disappears. A quality engineer opens the PDF, matches "Ø12.00 H7 pos. A" to the drawing balloon, types the actual, and repeats for dozens of features. Functional test reports add another dialect: pass/fail flags, measured current, leak rate, cycle count, firmware revision. The same part family can produce three layouts across two suppliers and one in-house cell.
Unstructured files also break downstream work. You cannot trend a bore diameter if last week's value lives only in a scanned header. You cannot prove which serial was measured on which CMM when the asset ID is a logo in the footer. You cannot close an 8D with characteristic-level evidence if the only record is "report attached." Extraction is inspect-stage speed work because it removes that transcription queue, not because it replaces the CMM.
Treat every source as hostile to consistency. Header fields move. Units switch between mm and inch without a label. Characteristic names get truncated. A second page of "out of tolerance only" looks like a complete report. The extraction design has to assume those failures, not hope the model will notice.
Quality owns the schema
Do not let the model invent columns. Quality publishes a closed schema per inspection plan: required identifiers, characteristic keys, unit of measure, result type (numeric, attribute, pass/fail), and which fields may be null. The extract is valid only if every required key is present and every characteristic ID matches the catalog. Vendor names in the PDF, balloon comments, and operator notes are optional text, never new dimensions.
Bind extracts to the inspection plan version, not to "whatever the PDF said." If drawing rev D added a true-position callout, reports generated against rev C must not grow a phantom characteristic. If the plan retired a check, an extracted value for that check is a schema violation, not a bonus data point. Store the plan ID and revision on every extract so audit queries can reconstruct what was required on that day.
Keep characteristic identity stable. Use the same keys you already use in SAP QM master inspection characteristics, Q-DAS K-fields, or the plant balloon list. The model maps surface text onto those keys. It does not create parallel names like "dia_12" and "diameter 12mm" that later split a trend. When a report uses a supplier synonym, resolve it through a quality-owned synonym table, then fail the field if no synonym exists.
Define result semantics explicitly. Numeric actuals need nominal, upper and lower limits (or a unilateral rule), unit, and decimal precision as printed. Attribute results need the allowed value set. Functional tests need the test step ID, not only a roll-up pass. Disposition (accept, reject, rework, hold) is a quality field. The model may copy a stamp that says "OK." Quality decides whether that stamp maps to lot disposition or only to a step result.
Version the schema the same way you version control plans. A parser update that adds a field is a quality change, not an IT hotfix. Downstream consumers (SPC, genealogy, customer PPAP packages) subscribe to a schema version. If you skip that, you will "speed up" capture and corrupt every chart that assumed yesterday's columns.
Run extraction as a gated inspect step
Ingest the file first, then classify, then extract against the matching schema. Classification answers: CMM dimensional, functional electrical, leak/pressure, hardness, or unknown. Unknown files do not get a best-guess schema. They wait for a quality reviewer to assign a plan or to reject the file as not an inspection record.
OCR and layout reconstruction matter as much as the language model. ABBYY and similar engines recover tables that a raw PDF text layer will scramble. OpenText-class capture can route by supplier, cell, or document type before extraction. Feed the model the reconstructed table plus a small set of header fields, not a 40-page dump. Long context invites the model to mix serials from two lots on the same scan batch.
Prompt and post-validate against the schema, not against fluency. Required checks: part number and serial (or lot, if the plan is lot-based), operation or inspection type, equipment ID when the plan requires it, timestamp, and every characteristic marked mandatory. Compare numeric results to printed limits when limits appear on the report. If the PDF shows a red "NOK" and the extracted disposition is accept, fail the extract. If units are absent and the plan does not declare a default, fail the unit field.
Write to the quality database only after validation. A typical landing zone is an incoming-results table that SAP QM (or the equivalent QMS) consumes as inspection-lot results. Do not overwrite a signed lot from a later re-extract unless quality has an explicit reprocess procedure. Keep the source file hash, page count, extractor version, and schema version beside the structured record so an auditor can replay the path from PDF to characteristic.
Human review is a queue with reasons, not a second full transcription. Show the PDF pane, the mapped characteristics, and the failed rules. The reviewer confirms a synonym, rejects a bad scan, or marks the file as the wrong plan. Measure inspect-stage cycle time as time from file arrival to validated record (or to empty extract with a coded reason). Transcription minutes per report should fall. Unreviewed auto-posts should stay rare and fully logged.
Empty extract when the report cannot be trusted
Empty is a first-class outcome. If OCR confidence is below the threshold quality set for that document class, return no characteristic rows. If the serial is unreadable, return no characteristic rows. If a mandatory true-position report has no datum scheme, return no characteristic rows. Partial extracts look complete in SPC and hide the missing feature until a customer escape.
Code the emptiness. Use reasons such as unreadable image, missing required identifier, schema mismatch, conflicting dispositions, or unsupported layout. Those codes drive the lab's re-scan and supplier corrective action. A blank record with no reason is indistinguishable from a system outage.
Never impute. Do not copy yesterday's actuals, do not average neighboring features, and do not assume "all other dimensions OK" when the PDF only lists failures. CMM software often prints exceptions only. A model that infers in-tolerance for unlisted balloons will invent a clean bill of characteristics the machine never reported.
Handle multi-serial and multi-page batches as all-or-nothing per serial. If page 3 belongs to a different serial and the splitter is unsure, do not attach those measurements to serial A. Split failure produces empty extracts for the ambiguous pages and a batch-hold for quality.
Re-extraction after a better scan is allowed. The empty record stays as history. The new extract is a new attempt with a new hash. Do not silently fill the old row. Audits need to see that the first file was unusable.
Use the structured record for traceability, audit, and trend, then stop
Once the record is valid, genealogy can tie serial to CMM, probe qualification date, and inspection plan revision. Customer and registrar audits then query characteristics instead of hunting share drives. Trend and capability work can run on the same keys used for First-Pass Yield Prediction, because both depend on clean pass/fail and characteristic actuals rather than on PDF text.
Is this worth automating for you?
Whether this pays back depends on how much time it takes your team today. Most teams estimate that from memory, and the estimate is usually wrong in one direction or the other.
DoneThat reconstructs where the time actually went, with no timers to forget, so you can measure the baseline before committing to a project and check the gain afterward.
Measure the baseline first