Span correction is the manual adjustment of a named entity's character-level boundaries—specifically its start_offset and end_offset—within a raw text string. When an AI model incorrectly highlights a partial term (e.g., capturing 'diabetes' instead of 'diabetes mellitus'), the reviewer drags or re-selects the text span to align precisely with the intended clinical concept.
Glossary
Span Correction

What is Span Correction?
Span correction is a precise annotation task where a human reviewer adjusts the start and end character offsets of a highlighted medical entity in unstructured text to fix extraction boundary errors.
This task is critical for maintaining ground truth integrity in medical NLP pipelines. Inaccurate spans corrupt downstream FHIR resource mapping and clinical entity linking, as a shifted offset can map to a completely different SNOMED CT or RxNorm code. Efficient span correction interfaces often use a diff view to visually contrast the model's predicted boundary with the reviewer's correction.
Key Characteristics of Span Correction
Span correction is a high-precision annotation task where reviewers adjust the exact character-level boundaries of a highlighted entity to fix extraction errors, ensuring downstream structured data accurately reflects the source text.
Character-Level Boundary Adjustment
The core mechanism involves modifying start and end character offsets of an entity span within unstructured text. Unlike simple label correction, this task requires pixel-perfect precision to ensure the extracted string exactly matches the intended clinical concept.
- Example: Changing a span from 'metformin 500' to 'metformin 500 mg' to capture the complete medication dosage
- Mechanism: Reviewers click and drag or use keyboard shortcuts to expand or contract the highlighted region
- Criticality: A single character offset error can change 'family history of cancer' to 'history of cancer', altering clinical meaning
Boundary Error Types
Span errors fall into distinct taxonomical categories that drive targeted model retraining and reviewer training interventions.
- Under-extraction: The span captures only a fragment of the entity, e.g., 'carcinoma' instead of 'squamous cell carcinoma'
- Over-extraction: The span includes extraneous tokens, e.g., 'the patient has diabetes' instead of 'diabetes'
- Offset shift: The span is correctly sized but anchored at the wrong position, capturing adjacent but irrelevant text
- Boundary ambiguity: Occurs with nested or overlapping entities, such as 'left lower lobe pneumonia' where 'left lower lobe' is an anatomical site and 'pneumonia' is a finding
Annotation Interface Design
Effective span correction demands specialized UI components that minimize cognitive load and maximize throughput.
- Token-level highlighting: Text is rendered with visible token boundaries so reviewers can snap adjustments to word edges
- Diff visualization: The original model-predicted span is shown alongside the reviewer's corrected span with strikethrough and highlight formatting
- Keyboard-first navigation: Shortcuts like Alt+Left/Right to expand or contract spans by one token enable rapid correction without mouse dependency
- Contextual preview: A side panel displays the full sentence or paragraph to prevent reviewers from losing document context during granular edits
Impact on Downstream Structured Data
Span correction directly determines the quality of extracted structured fields that populate EHR systems, FHIR resources, and analytics databases.
- Medication extraction: An incorrect span for 'lisinopril 10 mg daily' could result in a missing dose or frequency in the structured medication list
- Problem list population: Boundary errors on diagnosis spans cause incomplete or inaccurate SNOMED CT code mappings
- Temporal reasoning: Span boundaries that exclude temporal modifiers like 'history of' or 'new onset' corrupt clinical timelines
- Cohort identification: Span errors in inclusion criteria extraction lead to incorrect patient cohort assembly for clinical trials
Quality Assurance and Inter-Annotator Agreement
Span-level annotation requires rigorous QA protocols because traditional label-level agreement metrics are insufficient for boundary precision.
- Exact match IAA: Requires identical start and end offsets between annotators, a stricter standard than label agreement
- Partial overlap scoring: Metrics like Jaccard index or Dice coefficient quantify the degree of span overlap when exact matches are rare
- Adjudication triggers: Cases where annotator spans diverge beyond a predefined character threshold are automatically escalated to a senior reviewer
- Golden span datasets: Curated reference sets with pixel-perfect boundaries serve as calibration benchmarks for both models and human reviewers
Correction Propagation and Efficiency
A single span correction can be programmatically propagated to identical or semantically similar errors across a document or batch, dramatically reducing review burden.
- Exact match propagation: The same string occurring elsewhere in the document is automatically corrected with the same boundary adjustment
- Pattern-based propagation: Regular expression or embedding similarity triggers apply the correction to structurally analogous spans
- Reviewer confirmation gate: Propagated corrections are surfaced in a lightweight confirmation UI rather than applied silently, maintaining human oversight
- Audit trail integrity: Each propagated correction is logged with its origin span and propagation rule for full traceability
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Essential questions about the granular annotation task of adjusting character offsets in clinical text to fix AI extraction boundary errors.
Span correction is a granular annotation task where a human reviewer adjusts the start and end character offsets of a highlighted medical entity in unstructured text to fix extraction boundary errors. When a clinical NLP model identifies an entity like a medication or diagnosis, it outputs a 'span'—the exact character positions where that entity begins and ends in the source document. If the model captures 'metformin 500' instead of 'metformin 500 mg,' the reviewer manually drags or retypes the boundary to include the full dosage. This process is critical for maintaining data extraction accuracy in downstream tasks like FHIR resource mapping and medication reconciliation automation, where even a single-character offset error can propagate into incorrect structured data.
Related Terms
Span correction is a foundational task within a larger clinical annotation ecosystem. The following concepts define the interfaces, metrics, and workflows that enable precise boundary adjustments.
Diff View
A visual comparison interface that highlights the specific textual, structural, or coding differences between an AI-generated output and a human-corrected version to accelerate validation. In the context of span correction, a diff view visually contrasts the original model-predicted character offsets with the reviewer's adjusted boundaries, using strikethroughs and highlights to make the modification immediately apparent without requiring the reviewer to mentally map index values.
Inter-Annotator Agreement (IAA)
A statistical measure that quantifies the degree of consensus among multiple human reviewers, used to establish ground truth reliability. For span-level annotation, standard token-level metrics like Cohen's Kappa are insufficient. Instead, specialized overlap measures such as F1-score on exact boundary matching or intersection-over-union (IoU) thresholds are employed to determine if two annotators agree on the precise character offsets of a clinical entity.
Correction Propagation
A mechanism that automatically applies a single human correction to identical or semantically similar errors across a batch or downstream dataset to maintain consistency. When a reviewer fixes the span of a specific medication mention, the system can propagate that boundary adjustment to all other occurrences of the same string in the document, dramatically reducing the review burden and ensuring uniform data quality without requiring redundant manual corrections.
Source Attribution
A feature that directly links an AI-generated clinical statement or code to the exact sentence or paragraph in the original medical record, enabling rapid evidence verification. During span correction, source attribution provides a one-click navigation mechanism that scrolls the source document to the precise location of the highlighted entity, allowing the reviewer to visually confirm whether the model's character offsets correctly capture the full clinical concept or require boundary adjustment.
Error Taxonomy
A structured classification system of potential model failure modes used by reviewers to tag corrections, enabling granular performance analysis and targeted model retraining. For span correction tasks, common error categories include:
- Left Boundary Error: The start offset is incorrect, often truncating a modifier
- Right Boundary Error: The end offset is incorrect, often including trailing punctuation
- Over-extraction: The span captures text beyond the target entity
- Under-extraction: The span captures only a fragment of the target entity
Golden Dataset
A meticulously curated, high-quality set of ground truth clinical data used as a benchmark to evaluate model accuracy and calibrate reviewer proficiency. For span-level tasks, a golden dataset contains exact character-level annotations validated through a rigorous adjudication workflow where multiple expert annotators achieve high IAA. This dataset serves as the definitive reference for measuring whether a model's boundary predictions or a reviewer's corrections meet the required precision standard.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us