chunk.Metric

A named metric value associated with a retrieved chunk.

Usage

Source

chunk.Metric(
    name,
    value,
)

Metrics are used to store retrieval scores and other measurements that describe how well a chunk matches a query.

Parameter Attributes

name: str
value: float

Attributes

name: str

The name of the metric (e.g., “similarity”, “bm25_score”).

value: float
The numeric value of the metric.

Examples

from raghilda.chunk import Metric

similarity = Metric(name="similarity", value=0.95)
print(f"{similarity.name}: {similarity.value}")
similarity: 0.95