Definition

The quasi-exact match test assesses if two strings are similar, allowing partial matches and variations while being more flexible than exact match.

Taxonomy

  • Task types: LLM.
  • Availability: and .

Why it matters

  • Quasi-exact match provides a more lenient evaluation than exact match, accounting for minor variations in formatting, spacing, or capitalization.
  • This metric is useful when you want to measure semantic correctness without being overly strict about formatting details.
  • It’s particularly valuable for tasks where the core content matters more than exact formatting, such as question answering or content generation.

Required columns

To compute this metric, your dataset must contain the following columns:
  • Outputs: The generated text from your LLM
  • Ground truths: The reference/expected text to compare against

Test configuration examples

If you are writing a tests.json, here are a few valid configurations for the quasi-exact match test:
[
  {
    "name": "Mean quasi-exact match above 0.85",
    "description": "Ensure that the mean quasi-exact match score is above 0.85",
    "type": "performance",
    "subtype": "metricThreshold",
    "thresholds": [
      {
        "insightName": "metrics",
        "insightParameters": null,
        "measurement": "meanQuasiExactMatch",
        "operator": ">",
        "value": 0.85
      }
    ],
    "subpopulationFilters": null,
    "mode": "development",
    "usesValidationDataset": true,
    "usesTrainingDataset": false,
    "usesMlModel": false,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
  }
]