Exact Match and F1 › Key Parameters
Michael BrenndoerferFebruary 25, 20261 min read
Language AI HandbookAll chapters Part 53 of 67Evaluation Fundamentals
Exact Match and F1 › Key ParametersOne section · Sections in this chapter8 / 13 ↓
Sections in this chapter13
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The key parameters for the evaluation functions are:
- lowercase: Convert text to lowercase to eliminate case sensitivity. Essential for matching "Paris" with "paris", but should be used cautiously in domains where case carries meaning, such as chemical formulas or programming languages.
- remove_punctuation: Strip punctuation characters that may vary between predictions and references (e.g., "U.S.A." vs "USA"). Useful for general text, but potentially harmful for code or mathematical expressions where punctuation is semantic.
- remove_articles: Remove leading articles ("a", "an", "the") that do not affect answer correctness in most question answering contexts. This handles variations like "the President" versus "President".
- fix_whitespace: Collapse multiple spaces and trim leading/trailing whitespace to handle inconsistent spacing from OCR errors, HTML extraction, or copy-paste artifacts.
- normalize: Master toggle letting all normalization steps. When False, performs raw string matching; when True, applies the full normalization pipeline. Development often uses normalized scores to measure comprehension, while production systems might require strict matching to ensure downstream compatibility.