Abstract advice about extraction only goes so far. To understand what separates a prompt that works from one that quietly fails, it helps to see the same techniques applied to real material with real quirks. This article walks through three extraction scenarios from different domains—legal contracts, biomedical literature, and business news—and shows the specific prompt decisions that determined the outcome in each.
The domains were chosen because their challenges differ. Contracts are dense with defined terms and cross-references. Biomedical text is full of synonyms and precise relationships where a wrong edge has real consequences. Business news is messier, with entities appearing under many names and relationships scattered across paragraphs. What works in one domain illuminates principles that transfer to all of them.
For each scenario we describe the goal, the schema, the prompt choices, and what made the difference. The aim is to give you patterns you can adapt rather than a recipe to copy blindly.
Scenario 1: Extracting Parties and Obligations From Contracts
The Goal and Schema
A legal team wanted a graph of parties, obligations, and effective dates across a portfolio of vendor agreements. Entity types: Party, Obligation, Date. Relation types: hasobligation, effectiveon, party_to. The graph would answer questions like "which vendors owe a deliverable this quarter."
What Made It Work
Contracts define terms explicitly—"the Supplier," "the Effective Date"—and the winning prompt instruction was to resolve each defined term to the concrete entity it referenced. The prompt also required a source span pointing at the clause expressing each obligation, which let lawyers audit every edge. Without the defined-term resolution, the graph filled with abstract placeholders instead of real parties.
Where It Nearly Failed
Cross-references ("as set forth in Section 4") tempted the model to infer obligations not stated in the current span. Adding an explicit instruction to extract only obligations stated in the provided text, not those referenced elsewhere, fixed the fabrication. This is the grounding discipline detailed in Why Graph Extraction Prompts Silently Drop Half Your Entities.
Scenario 2: Mapping Drug-Disease Relationships in Literature
The Goal and Schema
A research group wanted to extract treats and contraindicatedfor relationships between drugs and conditions from abstracts. Entity types: Drug, Disease. Relation types: treats, contraindicatedfor, interacts_with. Accuracy mattered enormously—a wrong edge could mislead a literature review.
What Made It Work
Biomedical names are riddled with synonyms—generic names, brand names, abbreviations. The prompt was paired with a reference vocabulary, and the model was instructed to map every extracted drug and disease to its canonical identifier. This entity resolution, done against a known list, is what kept the graph from fragmenting, the same anchoring practice recommended in Schema-First Habits That Keep Extracted Graphs Trustworthy.
Where It Nearly Failed
Abstracts often state hedged findings—"may reduce symptoms in some patients." The first prompt extracted these as firm treats edges, overstating the evidence. Adding a confidence field and instructing the model to capture hedging turned a misleading graph into an honest one, where tentative claims were marked as such.
Scenario 3: Tracking Companies and Deals in Business News
The Goal and Schema
A market-intelligence team wanted a graph of companies, founders, funding rounds, and acquisitions from news articles. Entity types: Person, Organization, FundingRound. Relation types: founded, raised, acquired, invested_in. The volume was high and the text messy.
What Made It Work
The same company appeared as "Acme," "Acme Inc.," and "the startup" within a single article and across thousands of articles. A dedicated entity-resolution pass after extraction merged these variants, and provenance fields let the team trace each edge to its article. This separation of extraction from resolution kept both steps reliable, mirroring the flow in Walk Text Through a Triple-Producing Extraction Pipeline.
Where It Nearly Failed
Acquisitions were often described across several sentences, and naive chunking split them. Overlapping chunks and a linking pass that connected entities across boundaries recovered the lost edges. Without overlap, a measurable fraction of deals simply vanished from the graph.
Patterns That Transfer Across Domains
Resolve Defined or Canonical Names
Whether it is a contract's defined terms or a drug's canonical identifier, mapping surface forms to a stable name is what keeps a graph connected. Every successful scenario depended on it.
Capture Uncertainty Honestly
Hedged claims, referenced-but-not-stated obligations, and ambiguous mentions all benefit from a confidence or status field. A graph that records how certain each fact is far more trustworthy than one that flattens everything into firm assertions.
Separate Extraction From Resolution
In all three scenarios, doing extraction and entity resolution as distinct steps produced cleaner results than forcing the model to do both at once. The pattern holds whatever the domain, as the end-to-end case study reinforces at scale.
Adapting These Examples to Your Own Domain
Diagnose Your Domain's Quirk First
Before writing a prompt, ask what makes your text hard. Is it defined terms, as in contracts? Synonyms, as in biomedical literature? Name variants and scattered relationships, as in news? Each domain has a dominant quirk, and naming it tells you which technique to lead with—defined-term resolution, reference-list anchoring, or chunk overlap with a linking pass. Diagnosing the quirk first saves you from applying a generic prompt that founders on a problem you could have anticipated.
Borrow the Schema Shape, Not the Schema Content
The three schemas above differ entirely in content but share a shape: a small set of typed entities, a handful of operationally defined relations, and a confidence or provenance field where stakes are high. Copy the shape into your domain and fill it with your own types. This is how the patterns transfer—structure ports across domains even when vocabulary does not, the same principle that drives the reusable extraction framework.
Validate With a Domain Expert
In every scenario, the people who caught subtle errors were domain experts reading triples against sources. A lawyer noticed mis-scoped obligations; a researcher noticed overstated findings. Build a short expert spot-check into your process. No amount of automated validation substitutes for someone who knows the domain confirming that the edges mean what they say.
Frequently Asked Questions
Do extraction techniques really transfer across domains?
The core techniques do—closed schemas, grounding rules, source spans, entity resolution, and chunk overlap apply everywhere. What changes per domain is the schema content and the specific quirks: defined terms in legal text, synonyms in biomedical text, name variants in news. Adapt the schema; keep the discipline.
How do I handle synonyms and abbreviations?
Anchor extraction to a reference vocabulary when one exists and instruct the model to map every mention to its canonical identifier. Where no reference exists, run a resolution pass that clusters surface variants into single nodes. Synonyms are a resolution problem, not an extraction problem.
What should I do about hedged or uncertain claims?
Add a confidence or status field to your schema and instruct the model to capture hedging rather than flatten it into firm assertions. A graph that distinguishes tentative from established facts is far more useful than one that pretends everything is certain.
Why did acquisitions get lost in the news example?
Because relationships described across several sentences were split by naive chunking at a fixed boundary. Overlapping chunks and adding a linking pass that connects entities across boundaries recovered them. Any relationship that spans a chunk cut is at risk without overlap.
Should the model resolve entities or should I do it separately?
A separate resolution pass after extraction is generally more reliable, especially with synonyms and name variants. Forcing the model to extract and resolve simultaneously overloads it and reduces consistency. Keep the steps distinct.
How do I audit a graph in a high-stakes domain like medicine?
Require a source span for every triple so each edge traces back to its supporting text, and add a confidence field for hedged claims. Then have a domain expert spot-check a sample against sources. Auditability built into the schema is what makes a high-stakes graph trustworthy.
Key Takeaways
- Legal, biomedical, and business extraction share the same disciplines but differ in schema content and domain quirks.
- In contracts, resolving defined terms and grounding obligations in stated clauses was the difference between a real and a placeholder graph.
- In biomedical literature, mapping drugs and diseases to canonical identifiers and capturing hedged claims kept the graph honest.
- In business news, separating extraction from a dedicated resolution pass and overlapping chunks recovered otherwise-lost facts.
- Three patterns transfer across all domains: resolve names to stable forms, capture uncertainty honestly, and separate extraction from resolution.
- Build auditability—source spans and confidence fields—into the schema, especially where wrong edges carry real consequences.