# Chunk Relevance

**Objective:**&#x20;

Chunk Relevance evaluates the relevance of distinct text chunks extracted from documents in response to a query. It splits the source text into meaningful units (chunks) and assesses whether the extracted segments are contextually relevant to the given prompt or query. A high score suggests that the model is efficient in isolating and extracting coherent, meaningful portions of text, ensuring relevance and cohesion.

**Required Columns in Dataset:**

`Prompt`, `Expected Chunks`, `Retrieved Chunks`

**Interpretation:**

* **High Chunk Relevance**: Indicates that the model is efficiently selecting text segments that are contextually aligned and relevant to the query.
* **Low Chunk Relevance**: Means the model often extracts irrelevant or incoherent text chunks, leading to low-quality or disjointed responses.

**Execution via UI:**

<figure><img src="https://1811327582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbIiNdp1QbG4avl7VShw%2Fuploads%2FdAGCQhGgcpNQs55lnbnf%2Fimage.png?alt=media&#x26;token=3ba56b76-74d4-41dc-bebb-0e1712acdd86" alt=""><figcaption></figcaption></figure>

**Execution via SDK:**

```python
metrics=[
    {"name": "Chunk Relevance", "config": {"model": "gpt-4o-mini", "provider": "openai"}, "column_name": "your-text", "schema_mapping": schema_mapping}
]
```
