RAG-017RAG · Citationslayaeval.CitationRelevance

Citation Relevance

Is the cited source really about this claim?

CLAIMCITED SOURCE[1] Hotel price listLumière is $1801Source fits the claim
Simulation state:
When it passes

Source fits the claim.

Threshold satisfied: evaluation score >= 3.0.

When it fails

Source is about something else.

Violation detected: execution flagged for human review or fallback routing.

SDK Specification

ParameterValueDescription
ClassCitationRelevancePython evaluator class in layaeval
Required Fields"claim", "citation", "source_text"Arguments expected in the call signature
Default Threshold>= 3.0Passes when quality score is at or above this value
CategoryRAG EvaluationCitations (Do the little [1] tags point to the right place?)

Python Example

pip install layaeval
citation-relevance.py
1from layaeval import CitationRelevance
2
3metric = CitationRelevance(threshold=3.0) # passes at or above 3.0
4
5res = metric(
6 claim="Paris is the capital of France.",
7 citation="[1]",
8 source_text="Paris is the capital of France.",
9)
10
11print(res.passed, res.value, res.confidence)

Related RAG Checks

Other checks in Citations

View all 42 checks →