Views
No views yet

pip install lettucedetect1from lettucedetect.models.inference import HallucinationDetector
2
3detector = HallucinationDetector(
4 method="transformer",
5 model_path="KRLabsOrg/lettucedect-mmbert-base-hu-v1",
6 lang="hu",
7 trust_remote_code=True
8)
9
10contexts = [
11 "Franciaország fővárosa Párizs. Franciaország népessége 67 millió fő. Franciaország területe 551 695 km²."
12]
13question = "Mennyi Franciaország népessége?"
14answer = "Franciaország népessége 125 millió fő."
15
16predictions = detector.predict(context=contexts, question=question, answer=answer, output_format="spans")
17print("Predictions:", predictions)
18
19# Predictions: [{'start': 0, 'end': 38, 'confidence': 0.9475189447402954, 'text': 'Franciaország népessége 125 millió fő.'}]| Language | Model | Precision (%) | Recall (%) | F1 (%) | Maverick F1 (%) | Δ F1 (%) |
|---|---|---|---|---|---|---|
| Hungarian | meta-llama/Llama-4-Maverick-17B-128E-Instruct | 38.70 | 96.82 | 55.30 | 55.30 | +0.00 |
| Hungarian | lettucedect-mmBERT-small (ours) | 70.20 | 72.51 | 71.33 | 55.30 | +16.03 |
| Hungarian | lettucedect-mmBERT-base (ours) | 76.62 | 69.21 | 72.73 | 55.30 | +17.43 |
1@misc{Kovacs:2025,
2 title={LettuceDetect: A Hallucination Detection Framework for RAG Applications},
3 author={Ádám Kovács and Gábor Recski},
4 year={2025},
5 eprint={2502.17125},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2502.17125},
9}