> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quasi-exact match

> Learn how to use the quasi-exact match test

## 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**: development (Continuously evaluate your models and datasets as you iterate on their versions.)
  and monitoring (Monitor a model in production, measure its health, check for drifts and set up alerts.).

## 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:

```json Development theme={null}
[
  {
    "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",
        "measurement": "meanQuasiExactMatch",
        "operator": ">",
        "value": 0.85
      }
    ],
    "subpopulationFilters": null,
    "mode": "development",
    "usesValidationDataset": true,
    "usesTrainingDataset": false,
    "usesMlModel": true,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
  }
]
```

```json Monitoring theme={null}
[
  {
    "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",
        "measurement": "meanQuasiExactMatch",
        "operator": ">",
        "value": 0.85
      }
    ],
    "subpopulationFilters": null,
    "mode": "monitoring",
    "usesProductionData": true,
    "evaluationWindow": 3600,
    "delayWindow": 0,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
  }
]
```

## Related

* [Exact match test](https://docs.openlayer.com/tests/catalog/exact-match.md) - Assess identical string matches.
* [Edit distance test](https://docs.openlayer.com/tests/catalog/edit-distance.md) - Measure character-level similarity.
* [Semantic similarity test](https://docs.openlayer.com/tests/catalog/semantic-similarity.md) - Measure meaning similarity.
* [Aggregate metrics](https://docs.openlayer.com/tests/performance/aggregate-metrics) - Overview of all available metrics.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.