MultiPatternAccuracyScorer
Evaluates prediction accuracy against multiple acceptable patterns or answers. Ideal for tasks where multiple correct answers exist, with regex support for flexible pattern matching.
Overview
Evaluates prediction accuracy against multiple acceptable patterns or answers. Ideal for tasks where multiple correct answers exist, with regex support for flexible pattern matching.
Use Cases
- Accuracy benchmarking and validation
How It Works
This scorer uses deterministic rule-based evaluation to validate outputs against specific criteria. It applies predefined rules and patterns to assess the response, providing consistent and reproducible results without requiring LLM inference.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
| prediction | str | Yes | Generated output |
| ground_truth | str | Yes | Primary expected output |
| context.patterns | list[str] | No | Additional acceptable patterns (regex supported) |
Output Schema
| Field | Type | Description |
|---|---|---|
| score | float | 10.0 if any pattern matches, 0.0 otherwise |
| passed | bool | True if any pattern matched |
| reasoning | str | Pattern match details |
| metadata | dict | Which patterns matched |
Score Interpretation
Default threshold: 7/10
Related Scorers
AccuracyScorer
Calculates accuracy based on substring or token-level matching between prediction and ground truth. ...
AccuracyExactMatchScorer
Evaluates whether the prediction exactly matches the ground truth. Strictest form of accuracy measur...
AccuracyF1Scorer
Computes token-level F1 score between prediction and ground truth. Balances precision and recall, us...
NLP MetricsBLEUScorer
Computes BLEU (Bilingual Evaluation Understudy) score between prediction and ground truth. Measures ...
Frequently Asked Questions
When should I use this scorer?
Use MultiPatternAccuracyScorer when you need to evaluate accuracy and rule-based aspects of your AI outputs. It's particularly useful for accuracy benchmarking and validation.
Why does this scorer need expected output?
This scorer compares the generated output against a known expected result to calculate accuracy metrics.
Can I customize the threshold?
Yes, the default threshold of 7 can be customized when configuring the scorer.
Quick Info
Ready to try MultiPatternAccuracyScorer?
Start evaluating your AI agents with Noveum.ai's comprehensive scorer library.
Explore More Scorers
Discover 106 calibrated LLM-as-Judge scorers for comprehensive AI evaluation
