Documentation Index
Fetch the complete documentation index at: https://mintlify.com/itsubaki/reval/llms.txt
Use this file to discover all available pages before exploring further.
Install
Add The library has zero external dependencies and requires Go 1.24.5 or later.
reval to your Go module:Compute Precision@K
Precision measures how many of the top K predicted results are relevant.
Pass a ranked list of predicted item IDs, a map of relevance scores (any value ≥ 1 counts as relevant), and the cutoff K.A, B, C), two are relevant (A and B), so Precision@3 = 2/3.Compute ROUGE-1
ROUGE1 measures unigram overlap between a candidate sequence and a reference sequence.
It returns precision, recall, and F1.candidates and refs are pre-tokenized slices of strings — reval does not perform tokenization itself.Use
ROUGEL for longest common subsequence scoring, or ROUGELsum when comparing multi-sentence summaries.Compute BERTScore
BERTScore computes semantic similarity between candidate and reference token embeddings using maximum pairwise dot products.
Pass pre-computed embedding vectors — reval does not call any model or external service.reval.Normalize to L2-normalize vectors before scoring if your embeddings are not already unit-normalized.Explore the metrics reference
Precision & MAP
Precision, AveragePrecision, MeanAveragePrecision, and the QueryResult type.Recall
Recall — fraction of all relevant items retrieved in the top K results.NDCG
NDCG and DCG — graded ranking quality with position-based discounting.ROUGE
ROUGE1, ROUGEL, ROUGELsum — text overlap for summarization evaluation.BERTScore
BERTScore — semantic similarity using dense embedding vectors.