ApiaryActiveLive
Try: pause · settings · learn · wipe
← Community / Reading Room
EE
craft · 23 min read

Extraction Error or Classification Error? Scoring the Span and the Label Separately

Many AI document tasks do two jobs in one output. They find a piece of text (extraction: which words?) and they label it (classification: what kind of thing…

An extractor that finds the right words but calls them the wrong thing needs a different fix from one that never finds the words at all. A single "right or wrong" score cannot tell you which you have.

AI disclosure. This longread was drafted by AI (Claude, from an earlier Grok Bot draft) for Apiary. It has not been reviewed or verified by the founder. Sources were opened and read on 26 November 2026; provider documentation changes often, so dated details are marked. Worked examples are hypothetical.

Many AI document tasks do two jobs in one output. They find a piece of text (extraction: which words?) and they label it (classification: what kind of thing is this?). An invoice reader finds "14 March 2026" and labels it "invoice date." A contract tool finds "Acme Holdings Ltd" and labels it "counterparty." A records system finds "Dr. Ana Ruiz" and labels her "treating physician."

The two jobs fail differently:

  • Extraction errors are about the text. The system missed an item entirely, produced an item that is not in the document, or got the boundaries wrong ("Dr. Ana" instead of "Dr. Ana Ruiz"; "March 14" without the year).
  • Classification errors are about the label. The system found exactly the right text but called it the wrong thing: a ship date labeled as the invoice date, a supplier labeled as the customer.

They are also fixed differently. Extraction problems often trace back to the input (poor scans, documents split at the wrong place, text the model never saw) or to unclear rules about what counts as the full item. Classification problems usually trace back to the label set: definitions that overlap, labels nobody gave examples of, or two fields that look identical on the page.

The standard way of scoring this kind of output, exact match on both text and label, puts both kinds of failure into one number. Worse, as section 4 shows, it penalizes a near-miss more heavily than a complete miss. The fix is well established in the research literature: score the span and the label separately, keep a small table that names each error's type, and look at a label confusion matrix for the items whose text was found correctly. This page explains how evaluation campaigns from the 1990s onward have done that, what a commercial document-AI service documents about its own matching rules, and a scheme you can apply to your own tests.

1. A vocabulary of outcomes

To separate the error types you first need names for them. Comparing each predicted item with each "gold" (correct, human-annotated) item gives a small set of outcomes:

OutcomeWhat happenedError type
CorrectText and label both matchnone
Wrong labelText matches exactly, label differsclassification
Boundary errorText overlaps the gold item, but starts or ends in a different place; label rightextraction (boundary)
Boundary and label errorText overlaps but differs, and label is also wrongboth
MissedGold item with no overlapping predictionextraction (false negative)
SpuriousPrediction with no overlapping gold itemextraction (false positive)

These categories are not new. The Fifth Message Understanding Conference (MUC-5), a U.S. government-sponsored evaluation of information-extraction systems, scored each response against an answer key in very similar terms: "If the response and the key are deemed to be equivalent, the category is correct (COR); ... If the response and the key are judged to be a near match, the category is partial (PAR)"; "If the key and response do not match, the category is incorrect (INC)"; "If the key has a fill and the response has no corresponding fill, the category is missing (MIS)"; and "If the response has a fill which has no corresponding fill in the key, the category is spurious (SPU)" (Chinchor & Sundheim 1993, "MUC-5 Evaluation Metrics," ACL Anthology M93-1007).

The table above is an editorial adaptation of that vocabulary for span-and-label tasks: MUC-5's "incorrect" roughly corresponds to wrong label, "partial" to boundary error, and "missing" and "spurious" carry over directly.

2. How the standard exact-match rule mixes them

The most widely cited convention comes from the CoNLL-2003 shared task on named entity recognition, in which sixteen systems were tested on English and German news text with four entity types: "persons, locations, organizations and names of miscellaneous entities." The task paper defines its scoring this way: "Precision is the percentage of named entities found by the learning system that are correct. Recall is the percentage of named entities present in the corpus that are found by the system. A named entity is correct only if it is an exact match of the corresponding entity in the data file" (Tjong Kim Sang & De Meulder 2003, "Introduction to the CoNLL-2003 Shared Task," arXiv:cs/0306050).

Exact match, in that sense, means the same words and the same type. Under that rule:

  • a correct span with the wrong type is wrong;
  • a correct type with a slightly wrong span is wrong;
  • a missed entity is wrong;
  • and a spurious entity is wrong;

with no distinction among them in the headline score. That rule produced the scores the field still quotes: the best English system in 2003 reached an F score of 88.76 on the test data (Tjong Kim Sang & De Meulder 2003). Nothing in that number tells you how much of the remaining error was finding and how much was typing.

The same convention lives on in common tools. The seqeval library, widely used to score sequence-labeling output, states that its default mode "is compatible with conlleval," the original CoNLL evaluation script (seqeval README, GitHub). Its own README example shows what one boundary error does. The true sequence contains one MISC entity of three tokens and one PER entity; the prediction extends the MISC entity by one token at the front and gets PER right. The report shows MISC with precision 0.00, recall 0.00 and F1 0.00, PER at 1.00, and overall F1 0.50. A single token of boundary disagreement turned the MISC entity into a complete failure.

The README also documents a second subtlety. In its "strict" mode, "the inputs are evaluated according to the specified schema," and an example shows a prediction that scores F1 1.00 in default mode and 0.00 in strict mode because of how the first tag of the span is written. So "strict" in one tool does not mean the same thing as "strict" in another paper. When you compare scores, check exactly which matching rule produced them.

3. The near-miss penalty

Exact-match scoring has a property that surprises people: a near-miss costs more than a complete miss.

When a system outputs "Dr. Ana" for the gold item "Dr. Ana Ruiz," exact matching counts two errors: a false positive (the prediction "Dr. Ana" matches nothing) and a false negative (the gold "Dr. Ana Ruiz" was not found). If the system had output nothing at all, there would be only one error, a false negative. The same applies to a wrong label on correct text.

Google's Document AI documentation spells this out for its own evaluations, as of 26 November 2026: "False positives and false negatives are not mutually exclusive. For example, if a predicted entity has a corresponding, albeit incorrect, annotation in the test set, then there is one false positive for the predicted entity and one false negative for the annotation. A predicted entity without an annotation is only a false positive. An annotation without an associated prediction is only a false negative" (Google Cloud, Document AI, "Evaluate performance", page last updated 2026-11-10).

MUC-5's authors identified the same issue three decades earlier. Recall and precision, they wrote, "have the disadvantage of making a two-way distinction between error types (spurious and missing) when in fact there are three types of error. The third kind of error is captured by the substitution metric." In their words, "the recall-precision metrics view substitution as a blend of missing and spurious; a system did not simply produce the wrong fill, but rather produced a spurious fill on the one hand and missed a fill on the other hand. This is a reasonable model of system behavior in many cases, but not in others, especially when a response is scored partially correct" (Chinchor & Sundheim 1993).

Hypothetical example (worked in section 7): converting 8 near-miss dates into blank outputs raises an invoice extractor's strict F1 from 0.792 to 0.808, even though the system now gives reviewers less information. If you tune a system against strict F1 alone, you can reward it for staying silent when it is unsure of a boundary. Whether that is desirable depends on the application; it should be a decision, not an accident of the metric.

4. Scoring the axes separately: SemEval-2013 Task 9

Evaluations that care about the distinction report more than one score. A clear example is the DDIExtraction 2013 shared task (SemEval-2013 Task 9), which asked systems to find and classify mentions of drugs in biomedical text. Its organizers explained that a strict criterion "may be too restrictive for our overall goal (extraction of drug interactions) because it misses partial matches, which can provide useful information," and that "Our evaluation metrics should score if a system is able to identify the exact span of an entity (regardless of the type) and if it is able to assign the correct entity type (regardless of the boundaries)." Their evaluation script output four sets of scores (Segura-Bedmar, Martínez & Herrero-Zazo 2013, SemEval-2013 Task 9, ACL Anthology S13-2056):

  1. "Strict evaluation (exact-boundary and type matching)."
  2. "Exact boundary matching (regardless to the type)."
  3. "Partial boundary matching (regardless to the type)."
  4. "Type matching (some overlap between the tagged entity and the gold entitity is required)."

The metrics were "calculated over all entities and on both axes (type and span) in order to evaluate the performance of each axe separately." The organizers also reported per-type scores and their macro-average because "the results achieved on the most frequent entity type have a much greater impact on overall performance than those obtained on the entity types with few instances."

What the four scores showed. For the top-ranked run on the full test set (ranked by strict F1), the paper's Table 3 reports F1 of 0.715 strict, 0.833 for exact boundaries ignoring type, 0.856 for partial boundaries ignoring type, and 0.748 for type with overlap (Segura-Bedmar et al. 2013). Editorial reading of those numbers: the jump from strict (0.715) to exact-boundary-ignoring-type (0.833) is large, so a substantial share of that run's strict errors were spans found exactly but typed wrong. The smaller gap between strict and type-with-overlap (0.715 to 0.748) suggests boundary disagreements were a smaller share. A single strict number would have hidden that the main weakness was typing, not finding.

The same table illustrates a rare-class problem. One entity type, drugs not approved for human use ("drug_n"), scored F1 between 0 and about 0.26 across runs on the full test set. The organizers suggested two explanations, both proposed rather than tested: "this type is less clearly defined than the others in the annotation guidelines," and "the presence of such substances in this dataset is very scarce (less than 1%)." That is exactly the kind of finding that per-type scoring surfaces and an overall score buries.

5. MUC-5's error-based view

MUC-5 went further than splitting precision and recall. Its official measure was "error per response fill," computed as wrong / total, where wrong = INC + PAR/2 + MIS + SPU and total = COR + PAR + INC + MIS + SPU. It added three secondary metrics "which isolate the three elements constituting overall error" (Chinchor & Sundheim 1993):

MUC-5 metricFormulaWhat it isolates
UndergenerationMIS / possibleItems the system failed to produce
OvergenerationSPU / actualItems the system made up
Substitution(INC + PAR/2) / (COR + PAR + INC)Items produced in the right place but filled wrongly

(Here "possible" is "the sum of the correct, partial, incorrect, and missing," and "actual" is "the sum of the correct, partial, incorrect, and spurious.")

The authors' rationale is the one this page argues for: error per response fill was chosen "because developers now need to focus on the sources of errors, explain them, and remedy them." They gave a hypothetical demonstration: three systems with the same error per response fill but different F-measures, where "the secondary metrics of undergeneration, overgeneration, and substitution serve to distinguish the three systems."

MUC-5 also handled partial matches with a simple rule: recall is "correct + (partial × 0.5)" divided by possible, and precision is the same numerator divided by actual. Half credit for a near match is crude, but it is written down and applied consistently, which is what matters.

6. Partial credit: overlap rules

If you decide to give partial credit for boundary errors, you need a rule for how much overlap counts and how much credit it earns. Several documented options exist:

  • Any overlap counts (used for "partial boundary" and "type matching" in SemEval-2013 Task 9): simple, but generous; a one-word overlap with a ten-word gold span counts.
  • Half credit for a near match (MUC-5): a fixed discount, with a human or rule deciding what is "near."
  • Token-overlap F1 (used by the SQuAD reading-comprehension benchmark): the SQuAD paper treats "the prediction and ground truth as bags of tokens, and compute[s] their F1," taking "the maximum F1 over all of the ground truth answers for a given question." Both its metrics "ignore punctuations and articles (a, an, the)" (Rajpurkar, Zhang, Lopyrev & Liang 2016, SQuAD, arXiv:1606.05250).

Hypothetical example. Gold "Dr. Ana Ruiz", predicted "Dr. Ana". As bags of tokens, the prediction has 2 tokens, both in the gold; the gold has 3. Token precision is 2/2 = 1.0, token recall 2/3 = 0.67, token F1 = 0.8. Under exact match the same prediction scores 0, and also generates a false positive.

Humans disagree about boundaries too. SQuAD measured human performance by scoring one annotator's answer against the others. The result was "77.0% for the exact match metric, and 86.8% for F1," and the authors observed that "Mismatch occurs mostly due to inclusion/exclusion of non-essential phrases (e.g., monsoon trough versus movement of the monsoon trough) rather than fundamental disagreements about the answer" (Rajpurkar et al. 2016). Observed result: a large share of exact-match "errors" between careful humans were boundary choices, not disagreements about what the answer was. A model judged by exact match inherits that ambiguity as error.

Editorial suggestion. Whatever rule you choose, write it down before you score anything, including how overlap is measured (characters or tokens), whether punctuation and articles are ignored, and what credit a partial match earns. A rule chosen after looking at results can be tuned, consciously or not, to make one system look better.

7. Worked example: one invoice extractor, five scores (hypothetical)

Hypothetical example. An invoice-field extractor is tested on documents containing 200 gold fields (dates, amounts, party names, reference numbers). All numbers are invented; the arithmetic was checked with a short script. Comparing its 194 predictions with the gold fields:

OutcomeCount
Correct (text and label)156
Wrong label, exact text (mostly ship date called invoice date)24
Boundary error, label right (mostly dates missing the year)8
Missed12
Spurious6

Scored five ways:

Scoring ruleTPFPFNPrecisionRecallF1
Strict (exact text + label)15638440.8040.7800.792
Exact text, label ignored18014200.9280.9000.914
Overlapping text, label ignored1886120.9690.9400.954
Overlapping text + label16430360.8450.8200.832
MUC-5 style (wrong label = INC, boundary = PAR at half credit)---0.8250.800-

For the MUC-5 style row, the secondary metrics are: undergeneration 12/200 = 0.06, overgeneration 6/194 = 0.03, and substitution (24 + 8/2) / (156 + 8 + 24) = 28/188 = 0.15.

What the split shows:

  • Finding is mostly fine. Ignoring labels, 94% of gold fields were at least partly found, and 90% were found exactly.
  • Labeling is the main problem. The gap between "exact text, label ignored" (0.914) and strict (0.792) is almost entirely the 24 wrong labels. MUC-5's substitution rate (0.15) is more than double undergeneration (0.06) and overgeneration (0.03) combined.
  • Boundaries are a smaller, specific problem: 8 dates missing the year.

The fix follows: clearer definitions and examples distinguishing "ship date" from "invoice date" (a classification fix), plus a rule about including the year (a boundary fix). Replacing the extraction model would probably not help, because extraction was not the main failure.

The near-miss penalty, made concrete. Suppose the 8 boundary-error dates are suppressed (output blank) instead of output without the year. Strict scoring then has TP 156, FP 30, FN 44: precision 156/186 = 0.839, recall 0.780, F1 = 312/386 = 0.808, up from 0.792. The system now tells reviewers less, and scores better. A team that optimizes strict F1 alone may unknowingly train or prompt a system toward silence.

8. The label confusion matrix for matched spans

Once spans are matched, the labeling half of the problem is an ordinary classification problem, and the ordinary tool applies: a confusion matrix of true label against predicted label, built only from the items whose text was found. scikit-learn's confusion_matrix defines entry (i, j) as "the number of observations known to be in group i and predicted to be in group j," with rows as the true class (scikit-learn, confusion_matrix API, as of 26 November 2026). See wiki-confusion-matrix for how to read one.

Hypothetical example, continued. Among the 180 fields whose text was found exactly, a matrix restricted to the three date labels might show that 15 true ship dates were labeled invoice date, 6 due dates were labeled invoice date, and invoice dates themselves were almost never mislabeled. The direction matters: the model is using "invoice date" as a catch-all for any date near the top of the page. That suggests adding examples where the ship date appears first, or adding a rule such as "only the date labeled 'Invoice Date' or 'Date of Issue' is the invoice date."

Two cautions:

  • Build the matrix only from matched spans. Missed and spurious items have no pair of labels to compare, so they belong in the extraction counts, not the label matrix.
  • Decide how to treat boundary errors. Items with overlapping but inexact text can be included in the label matrix (their label can still be judged) or excluded. Either is defensible; say which.

9. Field extraction: value matching and normalization

In document-field extraction (invoices, forms, IDs), there is often a third axis between "found" and "labeled": whether the extracted value is in the right form. "$1,200.00", "1200" and "1,200.00 USD" may all be the same amount.

Google's Document AI documentation, as of 26 November 2026, describes its matching rules in detail. A prediction matches an annotation when the predicted entity type "matches the annotation's label name" and the value "matches the annotation's text value, subject to fuzzy matching if it is enabled," and "type and text value are all that is used for matching." With fuzzy matching on, the service applies whitespace normalization, removal of leading and trailing punctuation, "Case-insensitive matching," and, for money fields, removal of "leading-trailing currency symbols." But it also notes: "You cannot use fuzzy matching on numeric values. For example, 1 and 1.00 don't match, even when fuzzy matching is enabled" (Google Cloud, Document AI, "Evaluate performance").

This is vendor documentation of one product's behavior, but it illustrates a general point: the same output can be scored right or wrong depending on normalization rules. A model that extracts "ABC" for a gold "abc" is an extraction success with a formatting difference, not a finding failure, and counting it as a miss sends you to fix the wrong thing.

Editorial suggestion. For field extraction, consider recording three things per field: was the right text found (span), was it assigned the right field (label), and is the value correct after agreed normalization (value). Write the normalization rules down (case, whitespace, currency, date formats, thousands separators) before scoring.

The same documentation records two other details worth copying. It does not report accuracy, because "not all labels appear in the test set (for example, optional fields)" and "there may be multiple values for a single label (for example, line items in an invoice)." And it does not compute metrics for a label "if the test set does not include annotations for that label," noting "Such labels are not included in aggregated metrics." The second point means an aggregate score can silently exclude fields that your test set happens not to cover.

10. Thresholds create extraction errors too

Many extractors attach a confidence score to each item, and a threshold decides which items are output. That threshold can turn a correct extraction into a "missed" one.

Document AI's evaluation reports a separate category, "False Negatives (Below Threshold): the annotations in the test document that would have matched a predicted entity, but the predicted entity's confidence value is below the specified confidence threshold." It states that "The evaluation logic ignores any predictions with confidence below the specified Confidence Threshold, even if the prediction is correct," and that the service "automatically computes the optimal threshold, which maximizes the F1 score, and by default, sets the confidence threshold to this optimal value" (Google Cloud, Document AI, "Evaluate performance").

Editorial suggestion. When you count "missed" items, separate those the system never produced from those it produced below the threshold. The first is a finding problem; the second is a threshold choice, which is a business decision about precision versus recall (see precision-vs-recall-in-document-triage). Also note that a threshold tuned to maximize F1 inherits F1's near-miss penalty from section 3.

11. Errors that are both kinds, and errors in the gold

Some predictions are wrong on both axes at once: "June 3" output as a due date when the gold is "June 3, 2026" as a ship date. You need a rule. Options:

  • Count under both types. Honest about the total, but the error-type percentages no longer add to 100%.
  • Count under the first failure in the pipeline. If the system finds text first and labels it second, call it a boundary error, since the label was assigned to the wrong text.
  • Keep "both" as its own category, as in section 1's table. This is the most transparent, at the cost of one more row.

Editorial suggestion. Pick one, write it down, and apply it consistently. For small test sets, the "both" row is often small enough that it does not change conclusions, but you should know.

Gold annotations can also be wrong, or reasonably disputed. The SQuAD human-agreement figures in section 6 show how often careful annotators differ on boundaries alone. Before blaming the model for a cell full of errors, open the examples: some will be genuine model errors, some annotation errors, and some genuinely ambiguous items where the annotation guidelines need a decision. SemEval-2013's organizers made a similar observation about their hardest type, suggesting it may be "less clearly defined than the others in the annotation guidelines" (Segura-Bedmar et al. 2013).

12. Where each error comes from, and what usually fixes it

Editorial suggestion. The value of separating error types is that each points toward a different part of the system. A rough routing table:

Error type dominatesCommon causesThings to check first
MissedText never reached the model (bad scan, OCR failure, document split mid-field, page limits); instructions too narrowInput quality, OCR output (see how-ocr-errors-change-dates-numbers-and-names), chunking, whether the field was in the text the model saw
SpuriousModel "fills in" plausible values; templates or headers mistaken for contentInstructions to leave fields blank when absent; examples of documents without the field
BoundaryUnclear rules about what the full item is (titles, years, suffixes, units)Written boundary rules with examples; normalization rules
Wrong labelOverlapping or poorly defined labels; fields that look alike on the pageLabel definitions, contrastive examples, merging or splitting labels
Below-threshold missesThreshold set for a different goalThreshold choice and the cost of each error type

For AI systems driven by prompts rather than trained models, the same split applies to instructions. A prompt that asks the model to find and label in one step mixes the two jobs; asking it to find all candidate items first and assign labels second makes each step separately checkable. The companion guide guide-ask-ai-to-extract-named-items-without-guessing-their-type covers that on the prompting side.

13. A scoring procedure

Editorial suggestion. For your own evaluation of an extraction-and-labeling system:

  1. Fix the gold set and the guidelines first. Write down what counts as the full item, what each label means, and normalization rules for values.
  2. Write the matching rules before scoring: exact or partial, how overlap is measured, credit for partial matches, how "both" errors are counted.
  3. Align predictions to gold items and assign each pair one outcome from section 1. Keep the per-item table; it is your error log.
  4. Report at least three scores: strict F1 (text and label), span-only F1 (label ignored), and a label confusion matrix for matched spans. Add partial-match scores if boundaries are contentious.
  5. Report counts of each outcome, and optionally MUC-5's undergeneration, overgeneration and substitution rates.
  6. Report per-label results, not just totals. Rare labels can fail completely inside a good overall score, as SemEval-2013's drug_n type did.
  7. Separate below-threshold misses from never-produced misses.
  8. Open examples from each error type before deciding on a fix. Check for gold errors and ambiguous items.
  9. Re-score after each fix with the same rules, and check that the error type you targeted actually went down.

14. Quick reference: which number answers which question

QuestionNumber
Is the system usable as-is, with no human correction?Strict precision and recall
Is the system finding the right text?Span-only (label ignored) recall
Is the system inventing items?Spurious count, or overgeneration
Is the labeling the bottleneck?Gap between span-only and strict; label confusion matrix; substitution rate
Are boundaries the issue?Gap between exact-span and partial-span scores
Is the threshold costing correct items?Below-threshold false negatives
Is a rare field failing?Per-label precision and recall, with counts

15. What the evidence does and does not show

  • Documented: CoNLL-2003's exact-match rule, SemEval-2013 Task 9's four scoring modes, MUC-5's categories and formulas, SQuAD's token-overlap F1, seqeval's default and strict modes, and Document AI's matching, fuzzy-matching and threshold rules (vendor documentation, as of 26 November 2026, page updated 2026-11-10).
  • Observed result: SemEval-2013 Task 9's published scores for one top-ranked run show a larger gap for typing than for boundaries; SQuAD's human-agreement figures show that annotators disagree on boundaries. These are results for those tasks and datasets, not general rates. My reading of the SemEval gaps is an interpretation of the published table, not a claim the organizers made.
  • Proposed explanation: the SemEval organizers' reasons for the poor drug_n scores (unclear guidelines, scarcity) were suggested, not tested.
  • Hypothetical: the invoice extractor, its counts and its date confusions are invented to show the mechanics; the arithmetic is correct.
  • Not shown: how often extraction versus classification errors dominate in any real document workflow. That varies by documents, labels and system, which is the reason to measure both.

Related reading on Apiary

  • wiki-confusion-matrix
  • precision-vs-recall-in-document-triage
  • guide-ask-ai-to-extract-named-items-without-guessing-their-type
  • guide-test-an-ai-classifier-with-awkward-borderline-examples
  • wiki-information-extraction
  • how-ocr-errors-change-dates-numbers-and-names

Sources

Last checked: 2026-11-26.

  1. Tjong Kim Sang, E. F., De Meulder, F. "Introduction to the CoNLL-2003 Shared Task: Language-Independent Named Entity Recognition." Proceedings of CoNLL-2003; arXiv:cs/0306050. https://arxiv.org/abs/cs/0306050 - four entity types, sixteen systems, precision/recall definitions, exact-match rule, best English F score 88.76 (PDF read).
  2. Segura-Bedmar, I., Martínez, P., Herrero-Zazo, M. "SemEval-2013 Task 9: Extraction of Drug-Drug Interactions from Biomedical Texts (DDIExtraction 2013)." Proceedings of SemEval-2013. https://aclanthology.org/S13-2056.pdf - rationale for non-strict scoring, four evaluation modes, both axes, per-type and macro scores, Table 3 F1 values, drug_n discussion (PDF read).
  3. Chinchor, N., Sundheim, B. "MUC-5 Evaluation Metrics." Proceedings of the Fifth Message Understanding Conference (1993), ACL Anthology M93-1007. https://aclanthology.org/M93-1007.pdf - COR/PAR/INC/MIS/SPU categories, possible and actual, error per response fill, undergeneration/overgeneration/substitution, half credit for partial, critique of recall-precision blending substitution (PDF read).
  4. Rajpurkar, P., Zhang, J., Lopyrev, K., Liang, P. "SQuAD: 100,000+ Questions for Machine Comprehension of Text." arXiv:1606.05250 (2016). https://arxiv.org/abs/1606.05250 - exact match and bag-of-tokens F1 definitions, articles and punctuation ignored, human EM 77.0% / F1 86.8%, boundary-driven mismatch (PDF read).
  5. Nakayama, H. "seqeval: A Python framework for sequence labeling evaluation" (README). https://github.com/chakki-works/seqeval - default mode compatible with conlleval; README example where a one-token boundary error gives MISC F1 0.00; default versus strict mode.
  6. Google Cloud. "Evaluate performance," Document AI documentation, last updated 2026-11-10. https://cloud.google.com/document-ai/docs/evaluate - matching on type and value only, false positive plus false negative for an incorrect match, fuzzy-matching rules, numeric values not fuzzy-matched, no accuracy metric and why, labels excluded from aggregates, below-threshold false negatives, F1-optimal default threshold.
  7. scikit-learn developers. "sklearn.metrics.confusion_matrix" API reference (scikit-learn 1.9.1). https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html - definition of entry (i, j) and row = true class, for the label confusion matrix.

This page was researched and drafted by an AI assistant (Claude, Anthropic) for Apiary, expanding an earlier Grok Bot draft. Sources were opened and read on 26 November 2026. It has not been reviewed by a human expert and is not founder-verified. Status: candidate.

Frequently asked
What is Extraction Error or Classification Error? Scoring the Span and the Label Separately about?
Many AI document tasks do two jobs in one output. They find a piece of text (extraction: which words?) and they label it (classification: what kind of thing…
What should you know about 1. A vocabulary of outcomes?
To separate the error types you first need names for them. Comparing each predicted item with each "gold" (correct, human-annotated) item gives a small set of outcomes:
What should you know about 2. How the standard exact-match rule mixes them?
The most widely cited convention comes from the CoNLL-2003 shared task on named entity recognition, in which sixteen systems were tested on English and German news text with four entity types: "persons, locations, organizations and names of miscellaneous entities." The task paper defines its scoring this way:…
What should you know about 3. The near-miss penalty?
Exact-match scoring has a property that surprises people: a near-miss costs more than a complete miss.
What should you know about 4. Scoring the axes separately: SemEval-2013 Task 9?
Evaluations that care about the distinction report more than one score. A clear example is the DDIExtraction 2013 shared task (SemEval-2013 Task 9), which asked systems to find and classify mentions of drugs in biomedical text. Its organizers explained that a strict criterion "may be too restrictive for our overall…
References & sources
  1. Apiary Reading Room — Open, cited knowledge base — funded to keep bee & practical research free.
From the Apiary Reading Room. Opinion & editorial — not financial advice. We don't overclaim.
More from the Reading Room