Views
No views yet
bert-base-uncased with a small regression head, trained on synthetic data. The paper is
Beyond accuracy: completeness and relevance metrics for evaluating the quality of long answers,
Language Resources and Evaluation 60(3), article 58 (2026). It is open access:
doi.org/10.1007/s10579-026-09936-6.1import torch
2from transformers import AutoModelForSequenceClassification, AutoTokenizer
3
4name = "egcortes/qa-completeness-regressor"
5model = AutoModelForSequenceClassification.from_pretrained(name, trust_remote_code=True).eval()
6tokenizer = AutoTokenizer.from_pretrained(name)
7
8question = "How does RAM memory work?"
9answer = "RAM stores data your computer is using right now. It is fast but it forgets everything when you turn the power off."
10
11text = f"Question: {question}\n\nfAnswer: {answer}\n\nHow complete is this answer?"
12inputs = tokenizer(text, truncation=True, max_length=512, return_tensors="pt")
13with torch.no_grad():
14 score = model(**inputs).logits.item()
15
16print(round(score, 3)) # 0 = nothing is covered, 1 = everything is covered1from transformers import pipeline
2
3pipe = pipeline("text-classification", model="egcortes/qa-completeness-regressor",
4 trust_remote_code=True, function_to_apply="none")
5pipe(text) # [{'label': 'completeness', 'score': 0.26}]trust_remote_code=True is needed. The head is a plain linear layer on the CLS token, which is not
one of the standard transformers heads, so the model class ships with the model.f before
Answer:. That typo was in the training code, so the model expects it. Without it the scores drift.score, which normally means a probability. It is not one here, so
always pass function_to_apply="none".| Score | |
|---|---|
| Spearman | 0.67 |
| Kendall | 0.47 |
| Pearson | 0.68 |
| Sentences kept | Score |
|---|---|
| all | 0.59 |
| 80% | 0.53 |
| 60% | 0.44 |
| 40% | 0.34 |
| 20% | 0.24 |
bert-base-uncased1@article{cortes2026beyond,
2 title = {Beyond accuracy: completeness and relevance metrics for
3 evaluating the quality of long answers},
4 author = {Cortes, Eduardo G. and Vieira, Renata and Barone, Dante A. C.},
5 journal = {Language Resources and Evaluation},
6 volume = {60},
7 number = {3},
8 pages = {58},
9 year = {2026},
10 doi = {10.1007/s10579-026-09936-6}
11}