Views
No views yet
microsoft/deberta-v3-base binary classifier: given a
(question, context, answer) triple, predicts whether the answer is
faithful (label 0) or hallucinated (label 1) with respect to the
context.| Distribution | F1 | Precision | Recall | Expected Calibration Error |
|---|---|---|---|---|
| In-distribution (held-out HaluEval val) | 0.9937 | 0.999 | 0.989 | 0.0044 |
| Out-of-distribution (RAGTruth, real RAG hallucinations, never seen in training) | 0.5067 | — | — | 0.4010 |
1from transformers import AutoModelForSequenceClassification, AutoTokenizer
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("DantheMan124/deberta-hallucination-judge")
5model = AutoModelForSequenceClassification.from_pretrained("DantheMan124/deberta-hallucination-judge")
6
7text = "Q: What is the capital of France? C: France is in Europe. A: Paris"
8inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
9logits = model(**inputs).logits
10pred = logits.argmax(dim=-1).item() # 0 = faithful, 1 = hallucinated0: faithful1: hallucinated