wandb/RAGTruth-processed
Viewer • Updated • 17.8k • 2.06k • 29
How to use anulum/director-ragtruth-token-modernbert with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("token-classification", model="anulum/director-ragtruth-token-modernbert") # Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("anulum/director-ragtruth-token-modernbert")
model = AutoModelForTokenClassification.from_pretrained("anulum/director-ragtruth-token-modernbert")A token classifier that flags hallucinated spans in a RAG response. It reads
[context] [SEP] [response] and labels each response token supported or
hallucinated, then a response is flagged when it contains a hallucinated span.
Response/claim-level NLI grounding cannot isolate the short "baseless addition"
spans that dominate RAGTruth; a token classifier learns them directly.
| approach | example F1 | balanced acc | FPR | precision |
|---|---|---|---|---|
| NLI / claim-decompose | 0.366 | — | 0.347 | — |
| this model | 0.763 | 0.814 | 0.071 | 0.841 |
Operating point: token probability >= 0.95, at least one hallucinated token. Trained on the RAGTruth train split (15090 examples); context truncated to 1024 tokens during training.
from transformers import AutoModelForTokenClassification, AutoTokenizer
tok = AutoTokenizer.from_pretrained("anulum/director-ragtruth-token-modernbert")
model = AutoModelForTokenClassification.from_pretrained(
"anulum/director-ragtruth-token-modernbert")
# index 1 = hallucinated
Base model
answerdotai/ModernBERT-base