Examples

LangExtract examples

End‑to‑end examples that show how to apply LangExtract to healthcare text, long‑form documents, and operational workflows such as support triage.

Medication extraction from clinical notes

Healthcare · entity and relationship extraction

Extract medications, dosages, frequencies, and routes from unstructured clinical notes, while preserving full grounding so clinicians can see exactly where each field came from.

Learn how to structure medication entities, link attributes to their parent drugs, and design prompts that behave well on noisy real‑world text. See also Schemas & validation for representing medication lists.

Radiology report structuring

Healthcare · report structuring

Turn narrative radiology reports into structured findings, impressions, and follow‑up recommendations that can power dashboards, registries, and clinical decision support tools.

This example illustrates stepwise extraction (findings first, then impressions), along with visualization patterns that overlay grounding spans, as described in Visualization.

Full‑text literature extraction (Romeo and Juliet)

Long documents · literature

Work through a classic long‑form text to see how LangExtract handles chunking, parallelization, and multi‑pass extraction over large documents, while preserving performance and quality.

This example highlights the use of batch APIs and staged extraction passes; you can compare results and performance on the Benchmarks page.

Support ticket triage

Operations · classification & extraction

Use LangExtract to categorize support tickets, extract key entities like product, severity, and sentiment, and propose suggested routing or templated responses.

Start from the general patterns in the Docs, then adapt the prompts and schemas for your own support system. You can host this pipeline alongside healthcare or document extraction flows in the same application.