본문으로 건너뛰기
Workshop overview
Chapter 2 of 7
20 min

Decide how far to trust the structured result

Run document extraction and read confidence as a signal that separates automated handling from review.

Question for this chapter

Is the presence of extracted values enough to make an automated decision?

Why this matters now

A claim amount and diagnosis code can be present and still be wrong. Before sending them into the next automation step, you need a signal for judging the output's quality.

Try it

Open claim_extraction in the processed collection and select Run. When it finishes, open extracted_fields and find CLM-2025-006.

Before the run, only intake metadata existed. After the run, values read from the document and a quality signal appear in the same row.

Success looks like this

Inspect these three values in the CLM-2025-006 row:

ValueResult
claim_amount1850.0
diagnosis_codeJ20.9
confidence0.52
Korean Portal showing claim amount, diagnosis code, and confidence in the extracted-fields dataset
The Portal capture is in Korean. Inspect the structured values and 0.52 confidence on the CLM-2025-006 row.

Interpret the result

confidence is neither the probability that the claim is valid nor the model's overall accuracy. In this sample it is a quality signal for practicing whether automated handling should continue.

The threshold is 0.6. This claim's 0.52 is below it. Even though amount and diagnosis are present, the safer action is to stop and ask a person to compare them with the source.

Deep dive — two paths that create the values

document_parser currently has two execution paths:

  1. When pdf_dir exists and pdfplumber is available, it reads claim amount and diagnosis code from the bundled PDF with regular expressions.
  2. In the default Portal run without pdf_dir, it uses a deterministic fallback keyed by claim_id to reproduce the same result.
Output fieldSource
claim_amount, diagnosis_codePDF text or deterministic fallback
claimant_name, policy_numberCopied intake metadata
incident_dateDate portion of received_at
currencyUSD fixed in code
confidenceDecision signal created by sample rules

The default Portal path does not perform an S3 download, OCR call, or LLM call. This Workshop is a deterministic demonstration of the data contract and decision after document structuring.

Next decision

You found a low quality signal. Next, put it into an ordered rule that decides whether automation continues or hands the claim to a person.