Advanced Evaluation Metrics Reference¶
OpenBench AI v0.3.1 provides 13 registered metric identifiers across baseline and advanced deterministic/embedding metrics.
1. Precision (precision), Recall (recall), and F1 (f1)¶
Operates on two deterministic task structures via extract_decision_elements():
1. Binary Classification Decisions (mode="binary_classification"): Triggered when metadata["task_type"] == "binary_classification" or when the normalized expected answer is a canonical binary label (yes/no, true/false, positive/negative, safe/unsafe, valid/invalid).
2. Discrete Element-Set Prediction (mode="element_set"): Triggered for delimited lists (blue, green, red), explicit metadata["expected_elements"], or token sets:
$\(\text{Precision} = \frac{\text{TP}}{\text{TP} + \text{FP}}, \quad \text{Recall} = \frac{\text{TP}}{\text{TP} + \text{FN}}, \quad \text{F1} = \frac{2 \cdot \text{TP}}{2 \cdot \text{TP} + \text{FP} + \text{FN}}\)$
2. ROUGE (rouge, rouge_1, rouge_l) & BLEU (bleu)¶
rouge_1: Unigram multiset overlap precision, recall, and F1.rouge_l(default forrouge): Longest Common Subsequence (LCS) precision, recall, and F1.bleu: Smoothed sentence BLEU with clipped \(n\)-gram precisions (up to 4-grams) and exponential brevity penalty.
3. Lexical Similarity (lexical_similarity) vs. Semantic Similarity (semantic_similarity)¶
Important Methodological Distinction (v0.3.1)¶
LocalNgramEmbeddingProvider(Default Provider): Computes SHA-256 feature hashes over word unigrams and character 3-grams (is_semantic_embedding = False). Because this measures surface lexical overlap rather than semantic comprehension, results generated with the default provider are explicitly labeledsimilarity_type: "lexical_similarity"in item and aggregate report details.lexical_similarityMetric Identifier: Registered as a first-class metric identifier inv0.3.1for surface n-gram cosine similarity.semantic_similarityMetric Identifier: Retained for backward compatibility. When used with the defaultLocalNgramEmbeddingProvider, it acts as a documented legacy alias forlexical_similarity(similarity_type: "lexical_similarity"). To require a genuine neural embedding model (is_semantic_embedding = True, such asHuggingFaceEmbeddingProvider), passrequire_semantic_provider=True.- Limitation: Neither
lexical_similaritynor embedding-basedsemantic_similarityunderstands logical negation or proves factual correctness.
4. Structured Output Validation (structured_output)¶
- Validates JSON parsing (
valid_json), required keys (required_keys), field types (field_types), and optionaljsonschemacompliance (expected_schema). - Reports structural validity (
valid_structure,structure_score) separately from value accuracy (value_match). - Optional Fenced JSON Stripping (
strip_markdown_fence, New in v0.3.1): - Defaults to
False(preserving v0.2.0 behavior). - When
strip_markdown_fence=True, removes at most one valid surrounding Markdown code fence (```json ... ```or``` ... ```) before JSON parsing. It never strips arbitrary surrounding conversational prose, never concatenates multiple code fences, and never repairs malformed JSON. - Without the optional
jsonschemapackage, schema validation is skipped and reported asschema_validated: false. - With the default
strip_markdown_fence=False, responses wrapped in Markdown code fences fail JSON parsing.