A hallucination evaluation benchmark for Bengali (Bangla) language models, covering four task types: Question Answering, Summarization, Mathematical Reasoning, and Code-mixed QA. The benchmark evaluates whether model outputs contain hallucinated information, using a suite of judge models ranging from GPT-4.1 mini to locally hosted open-source LLMs.
BanglaHalluEval constructs datasets of hallucinated model outputs across four Bengali NLP tasks, then uses judge LLMs to label each sample as hallucinated (yes) or not (no). The benchmark supports two evaluation modes:
Hallucination patterns across tasks include factualness, comprehension, intrinsic, extrinsic, arithmetic_slip, and other error types.
Bengali reading-comprehension QA. A context passage is provided alongside a question; the model produces a hallucinated answer that is factually wrong or unsupported by the context.
| Property | Detail |
|---|---|
| Language | Bengali (full Unicode) |
| Dataset (candidates) | Hallucination Generated Answers/qa_4000.csv — 4,000 samples |
| Dataset (main/ground-truth) | BanglaHalluEval Datasets/banglahallueval_qa_1000.csv — 1,000 samples |
| Hallucination patterns | factualness, comprehension |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier (e.g. bengali-XXXX::factualness) |
source_id | Source passage identifier |
pattern | Hallucination pattern type |
context | Bengali source passage |
question | Bengali question |
right_answer | Ground-truth answer |
hallucinated_answer | Hallucinated model output to be evaluated |
Bengali abstractive summarization. A source document is summarized; the hallucinated summary either introduces unsupported facts (extrinsic) or contradicts the source (intrinsic).
| Property | Detail |
|---|---|
| Language | Bengali (full Unicode) |
| Dataset (candidates) | Hallucination Generated Answers/summarization_3000_corrected.csv — 3,000 samples |
| Dataset (main/ground-truth) | Summarization/1000 Selected Samples/banglahallueval_summarization_dataset_1000.csv — 1,000 samples |
| Hallucination patterns | Intrinsic, Extrinsic |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier |
source_id | Source document identifier |
pattern | Hallucination pattern (Intrinsic or Extrinsic) |
document | Bengali source document |
right_summary | Ground-truth summary |
hallucinated_summary | Hallucinated model summary to be evaluated |
Bengali mathematical word problems drawn from the SOMADHAN dataset. A hallucinated reasoning chain is generated by introducing errors at specific steps of the solution.
| Property | Detail |
|---|---|
| Language | Bengali (full Unicode) |
| Source dataset | SOMADHAN (SOMADHAN.csv) |
| Dataset (candidates) | Hallucination Generated Answers/reasoning_1000.csv — 1,000 samples |
| Dataset (main/ground-truth) | Reasoning/1000 Selected Samples/somadhan_1000_main_ordered.csv — 1,000 samples |
| Hallucination types | arithmetic_slip, wrong_formula, wrong_unit, etc. |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier |
question_id | Source problem identifier |
hallucination_type | Type of introduced error |
question | Bengali math word problem |
answer | Ground-truth answer |
hallucinated_chain | Reasoning chain containing the introduced error |
error_step | Step index where the error was introduced |
error_type | Category of the error |
hallucinated_answer | Final answer derived from the flawed chain |
Note: The judge must evaluate the entire reasoning chain, not just the final answer. The TigerLLM and CoT prompts request a JSON response (
{"is_hallucinated": "Yes/No"}) for this task instead of a plain token.
QA over code-switched Bangla–English text (Romanised Bengali mixed with English). The context and question are written in transliterated/mixed script; answers may hallucinate facts not present in the context.
| Property | Detail |
|---|---|
| Language | Code-mixed Bangla–English (Romanised) |
| Dataset (candidates) | Hallucination Generated Answers/codemix_4000.csv — 4,000 samples |
| Dataset (main/ground-truth) | Codemix/Main dataset/ — 1,000 samples |
| Hallucination patterns | factualness, comprehension |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier |
source_id | Source passage identifier |
pattern | Hallucination pattern type |
codemix_context | Code-mixed source passage |
codemix_question | Code-mixed question |
codemix_answer | Ground-truth answer |
hallucinated_answer | Hallucinated model output to be evaluated |
Example row:
- Context:
"1965 saler 31 July England-er Gloucestershire-er Yate shohore jonmogrohon koren J.K. Rowling..."- Question:
J. K. Rowling-er mayer nam ki?- Ground truth:
Anni- Hallucinated answer:
J. K. Rowling-er mayer nam chhilo Margaret Anne.
Each task follows a two-stage pipeline:
Stage 1 — Hallucination Generation
Source dataset → LLM (GPT-4 / Ollama) → hallucinated_answer / hallucinated_chain / hallucinated_summary
Stage 2 — Hallucination Labeling (Judge Models)
Hallucinated output → Judge LLM → is_hallucinated: yes / no
Stage 1 scripts are in BanglaHalluEval *Pilot Testing/ and Reasoning/Evaluation Script/.
Stage 2 scripts are in scripts/ and Codemix/.
Both a hallucinated candidates split and a ground-truth (main) split are evaluated, allowing measurement of false-positive rates alongside true hallucination detection rates.
| Model | Provider | Scripts |
|---|---|---|
| GPT-4.1 mini | OpenAI API | scripts/label_*_gpt_4_1_mini.py |
| Qwen 2.5 32B | Ollama (local / RunPod) | scripts/label_*_ollama.py |
| Gemma2 27B | Ollama | scripts/label_summarization_gemma2.py, Codemix/label_*_gemma_ollama.py |
| Mistral-Nemo | Ollama | scripts/label_hallucinations_mistral.py, Codemix/label_*_mistral_ollama.py |
| LLaMA 3.1 8B | Ollama | Codemix/label_*_llama_ollama.py |
| DeepSeek-R1 14B | Ollama | scripts/evaluate_deepseek_ollama.py, scripts/evaluate_codemix_deepseek_*.py |
| TigerLLM-9B-IT | HuggingFace (local GPU) | scripts/evaluate_tigerllm.py, evaluate_tigerllm_*.py |
All judge models are configured with temperature=0 and a minimal token budget (8–32 tokens) to enforce single-token or structured responses.
You are an evaluator.
Decide whether the provided model answer is hallucinated relative to the question.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the answer contains information not supported by the question/context
or is factually incorrect (hallucinated).
Provide the answer in English only: yes or no.
Question: {question}
Model answer: {answer}
Answer now:
You are an evaluator.
Decide whether the provided model summary is hallucinated relative to the document.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the summary contains information not supported by the document
or contradicts it (hallucinated).
Provide the answer in English only: yes or no.
Document: {document}
Summary: {summary}
Answer now:
You are an evaluator for Bengali mathematical reasoning tasks.
Decide whether the provided reasoning chain is hallucinated relative to the question.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the chain or answer contains incorrect steps or unsupported facts.
Provide the answer in English only: yes or no.
Question: {question}
Reasoning Chain: {chain}
Answer: {answer}
Answer now:
TigerLLM uses a JSON variant for this task:
Is this hallucinated_chain hallucinated? Respond ONLY with a JSON object like this: {"is_hallucinated": "Yes"} or {"is_hallucinated": "No"}
You are an evaluator.
Decide whether the provided model answer is hallucinated relative to the context and question.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the answer contains information not supported by the context
or contradicts it (hallucinated).
Provide the answer in English only: yes or no.
Context: {context}
Question: {question}
Model answer: {answer}
Answer now:
An alternative evaluation mode (scripts/evaluate_cot_ollama.py) instructs the judge to reason step-by-step before issuing its verdict. This is run across QA, Summarization, and Reasoning tasks using four Ollama models.
You are an evaluator checking whether a model answer is hallucinated.
Question: {question}
Model Answer: {answer}
Analyze step by step:
Step 1: What factual claims does the answer make?
Step 2: Are these claims supported by or inferable from the question context?
Step 3: Based on steps 1-2, is the answer hallucinated?
Final answer (write only this word on the last line): yes or no
(yes = answer is hallucinated, no = answer is not hallucinated)
You are an evaluator checking whether a summary is hallucinated relative to a document.
Document: {document}
Summary: {summary}
Analyze step by step:
Step 1: List the key claims made in the summary.
Step 2: For each claim, check whether it is directly supported by the document.
Step 3: Based on steps 1-2, decide your final answer.
Final answer (write only this word on the last line): yes or no
(yes = summary is hallucinated, no = summary is not hallucinated)
You are an expert evaluator for Bengali mathematical reasoning tasks.
Question: {question}
Reasoning Chain: {chain}
Answer: {answer}
Analyze step by step:
Step 1: Is each calculation or logical step in the reasoning chain mathematically correct?
Step 2: Does the final answer follow logically from the reasoning chain?
Step 3: Based on steps 1-2, is this reasoning chain hallucinated (incorrect or fabricated)?
Respond ONLY with a JSON object on the last line:
{"is_hallucinated": "Yes"} or {"is_hallucinated": "No"}
Note: CoT evaluation is not defined for the Codemix task.
CoT models: qwen2.5:32b-instruct, gemma2:27b, mistral-nemo:latest, llama3.1:8b
CoT output files follow the naming pattern *_cot_{model_slug}.csv.
BanglaHalluEval/
│
├── Hallucination Generated Answers/ # Raw hallucinated outputs (input to Stage 2)
│ ├── qa_4000.csv
│ ├── summarization_3000_corrected.csv
│ ├── reasoning_1000.csv
│ └── codemix_4000.csv
│
├── BanglaHalluEval Datasets/ # Final curated 1000-sample main datasets
│ ├── banglahallueval_qa_1000.csv
│ └── banglahallueval_qa_dataset_1000.csv
│
├── QA/
│ └── Results/ # QA evaluation output CSVs
│
├── Summarization/
│ ├── 1000 Selected Samples/
│ └── Evaluation_Results/
│
├── Reasoning/
│ ├── 1000 Selected Samples/
│ ├── 1000_hallucinated Samples/
│ └── Results/
│
├── Codemix/
│ ├── Main dataset/
│ ├── Results/
│ └── label_codemix_*_ollama.py # Per-model Codemix labeling scripts
│
├── scripts/ # All evaluation and labeling scripts
│ ├── label_hallucinations_ollama.py # QA — Ollama judge
│ ├── label_hallucinations_gpt.py # QA — GPT judge
│ ├── label_correct_answers_gpt_4_1_mini.py
│ ├── label_summarization_ollama.py # Summarization — Ollama judge
│ ├── label_summarization_gpt_4_1_mini.py
│ ├── label_summarization_gemma2.py
│ ├── label_summarization_deepseek.py
│ ├── label_reasoning_gpt_4_1_mini.py # Reasoning — GPT judge
│ ├── label_reasoning_main_1000_gpt_4_1_mini.py
│ ├── label_codemix_hallucinations_gpt_4_1_mini.py # Codemix — GPT judge
│ ├── label_codemix_main_gpt_4_1_mini.py
│ ├── evaluate_tigerllm.py # TigerLLM — all tasks (QA/Summ/Reasoning)
│ ├── evaluate_cot_ollama.py # CoT evaluation — QA/Summ/Reasoning
│ ├── evaluate_deepseek_ollama.py # DeepSeek — QA/Summ
│ ├── evaluate_codemix_deepseek_candidates.py
│ ├── evaluate_codemix_deepseek_main.py
│ ├── evaluate_reasoning_deepseek_candidates.py
│ └── evaluate_reasoning_deepseek_main.py
│
├── Results/ # Aggregated labeled output CSVs
├── Evaluation/ # GPT/LLaMA labeled QA results
├── public/halueval.pdf # Reference paper
├── requirements.txt
└── README.md
1. Install dependencies
pip install -r requirements.txt
pip install openai python-dotenv pandas transformers torch accelerate
2. Configure API keys (for GPT-based scripts)
Create a .env file in the project root:
OPENAI_API_KEY=sk-...
3. Start Ollama (for Ollama-based scripts)
ollama serve
ollama pull qwen2.5:32b-instruct
For a remote RunPod instance, pass --ollama-url https://<pod-id>-11434.proxy.runpod.net.
4. Run an evaluation
# QA — GPT-4.1 mini
python scripts/label_hallucinations_gpt.py \
--input "Hallucination Generated Answers/qa_4000.csv" \
--output "QA/Results/qa_4000_gpt4mini.csv"
# Summarization — Qwen 32B via Ollama
python scripts/label_summarization_ollama.py \
--input "Hallucination Generated Answers/summarization_3000_corrected.csv" \
--output "Summarization/Evaluation_Results/summ_3000_qwen32b.csv" \
--model qwen2.5:32b-instruct
# Reasoning — GPT-4.1 mini
python scripts/label_reasoning_gpt_4_1_mini.py \
--input "Hallucination Generated Answers/reasoning_1000.csv" \
--output "Reasoning/Results/reasoning_1000_gpt4mini.csv"
# Codemix — GPT-4.1 mini
python scripts/label_codemix_hallucinations_gpt_4_1_mini.py \
--input "Hallucination Generated Answers/codemix_4000.csv" \
--output "Results/codemix_4000_gpt4mini.csv"
# TigerLLM — all tasks (requires local GPU)
python scripts/evaluate_tigerllm.py --task all
# CoT — all tasks, all models
python scripts/evaluate_cot_ollama.py --task all
All scripts support --resume (skip already-labeled rows), --start / --end (slice), and --force-binary (retry until yes/no is obtained).
A hallucination evaluation benchmark for Bengali (Bangla) language models, covering four task types: Question Answering, Summarization, Mathematical Reasoning, and Code-mixed QA. The benchmark evaluates whether model outputs contain hallucinated information, using a suite of judge models ranging from GPT-4.1 mini to locally hosted open-source LLMs.
BanglaHalluEval constructs datasets of hallucinated model outputs across four Bengali NLP tasks, then uses judge LLMs to label each sample as hallucinated (yes) or not (no). The benchmark supports two evaluation modes:
Hallucination patterns across tasks include factualness, comprehension, intrinsic, extrinsic, arithmetic_slip, and other error types.
Bengali reading-comprehension QA. A context passage is provided alongside a question; the model produces a hallucinated answer that is factually wrong or unsupported by the context.
| Property | Detail |
|---|---|
| Language | Bengali (full Unicode) |
| Dataset (candidates) | Hallucination Generated Answers/qa_4000.csv — 4,000 samples |
| Dataset (main/ground-truth) | BanglaHalluEval Datasets/banglahallueval_qa_1000.csv — 1,000 samples |
| Hallucination patterns | factualness, comprehension |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier (e.g. bengali-XXXX::factualness) |
source_id | Source passage identifier |
pattern | Hallucination pattern type |
context | Bengali source passage |
question | Bengali question |
right_answer | Ground-truth answer |
hallucinated_answer | Hallucinated model output to be evaluated |
Bengali abstractive summarization. A source document is summarized; the hallucinated summary either introduces unsupported facts (extrinsic) or contradicts the source (intrinsic).
| Property | Detail |
|---|---|
| Language | Bengali (full Unicode) |
| Dataset (candidates) | Hallucination Generated Answers/summarization_3000_corrected.csv — 3,000 samples |
| Dataset (main/ground-truth) | Summarization/1000 Selected Samples/banglahallueval_summarization_dataset_1000.csv — 1,000 samples |
| Hallucination patterns | Intrinsic, Extrinsic |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier |
source_id | Source document identifier |
pattern | Hallucination pattern (Intrinsic or Extrinsic) |
document | Bengali source document |
right_summary | Ground-truth summary |
hallucinated_summary | Hallucinated model summary to be evaluated |
Bengali mathematical word problems drawn from the SOMADHAN dataset. A hallucinated reasoning chain is generated by introducing errors at specific steps of the solution.
| Property | Detail |
|---|---|
| Language | Bengali (full Unicode) |
| Source dataset | SOMADHAN (SOMADHAN.csv) |
| Dataset (candidates) | Hallucination Generated Answers/reasoning_1000.csv — 1,000 samples |
| Dataset (main/ground-truth) | Reasoning/1000 Selected Samples/somadhan_1000_main_ordered.csv — 1,000 samples |
| Hallucination types | arithmetic_slip, wrong_formula, wrong_unit, etc. |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier |
question_id | Source problem identifier |
hallucination_type | Type of introduced error |
question | Bengali math word problem |
answer | Ground-truth answer |
hallucinated_chain | Reasoning chain containing the introduced error |
error_step | Step index where the error was introduced |
error_type | Category of the error |
hallucinated_answer | Final answer derived from the flawed chain |
Note: The judge must evaluate the entire reasoning chain, not just the final answer. The TigerLLM and CoT prompts request a JSON response (
{"is_hallucinated": "Yes/No"}) for this task instead of a plain token.
QA over code-switched Bangla–English text (Romanised Bengali mixed with English). The context and question are written in transliterated/mixed script; answers may hallucinate facts not present in the context.
| Property | Detail |
|---|---|
| Language | Code-mixed Bangla–English (Romanised) |
| Dataset (candidates) | Hallucination Generated Answers/codemix_4000.csv — 4,000 samples |
| Dataset (main/ground-truth) | Codemix/Main dataset/ — 1,000 samples |
| Hallucination patterns | factualness, comprehension |
CSV columns:
| Column | Description |
|---|---|
id | Unique sample identifier |
source_id | Source passage identifier |
pattern | Hallucination pattern type |
codemix_context | Code-mixed source passage |
codemix_question | Code-mixed question |
codemix_answer | Ground-truth answer |
hallucinated_answer | Hallucinated model output to be evaluated |
Example row:
- Context:
"1965 saler 31 July England-er Gloucestershire-er Yate shohore jonmogrohon koren J.K. Rowling..."- Question:
J. K. Rowling-er mayer nam ki?- Ground truth:
Anni- Hallucinated answer:
J. K. Rowling-er mayer nam chhilo Margaret Anne.
Each task follows a two-stage pipeline:
Stage 1 — Hallucination Generation
Source dataset → LLM (GPT-4 / Ollama) → hallucinated_answer / hallucinated_chain / hallucinated_summary
Stage 2 — Hallucination Labeling (Judge Models)
Hallucinated output → Judge LLM → is_hallucinated: yes / no
Stage 1 scripts are in BanglaHalluEval *Pilot Testing/ and Reasoning/Evaluation Script/.
Stage 2 scripts are in scripts/ and Codemix/.
Both a hallucinated candidates split and a ground-truth (main) split are evaluated, allowing measurement of false-positive rates alongside true hallucination detection rates.
| Model | Provider | Scripts |
|---|---|---|
| GPT-4.1 mini | OpenAI API | scripts/label_*_gpt_4_1_mini.py |
| Qwen 2.5 32B | Ollama (local / RunPod) | scripts/label_*_ollama.py |
| Gemma2 27B | Ollama | scripts/label_summarization_gemma2.py, Codemix/label_*_gemma_ollama.py |
| Mistral-Nemo | Ollama | scripts/label_hallucinations_mistral.py, Codemix/label_*_mistral_ollama.py |
| LLaMA 3.1 8B | Ollama | Codemix/label_*_llama_ollama.py |
| DeepSeek-R1 14B | Ollama | scripts/evaluate_deepseek_ollama.py, scripts/evaluate_codemix_deepseek_*.py |
| TigerLLM-9B-IT | HuggingFace (local GPU) | scripts/evaluate_tigerllm.py, evaluate_tigerllm_*.py |
All judge models are configured with temperature=0 and a minimal token budget (8–32 tokens) to enforce single-token or structured responses.
You are an evaluator.
Decide whether the provided model answer is hallucinated relative to the question.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the answer contains information not supported by the question/context
or is factually incorrect (hallucinated).
Provide the answer in English only: yes or no.
Question: {question}
Model answer: {answer}
Answer now:
You are an evaluator.
Decide whether the provided model summary is hallucinated relative to the document.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the summary contains information not supported by the document
or contradicts it (hallucinated).
Provide the answer in English only: yes or no.
Document: {document}
Summary: {summary}
Answer now:
You are an evaluator for Bengali mathematical reasoning tasks.
Decide whether the provided reasoning chain is hallucinated relative to the question.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the chain or answer contains incorrect steps or unsupported facts.
Provide the answer in English only: yes or no.
Question: {question}
Reasoning Chain: {chain}
Answer: {answer}
Answer now:
TigerLLM uses a JSON variant for this task:
Is this hallucinated_chain hallucinated? Respond ONLY with a JSON object like this: {"is_hallucinated": "Yes"} or {"is_hallucinated": "No"}
You are an evaluator.
Decide whether the provided model answer is hallucinated relative to the context and question.
Only reply with a single token: yes or no. No explanation, no punctuation, no extra text.
Interpretation: 'yes' means the answer contains information not supported by the context
or contradicts it (hallucinated).
Provide the answer in English only: yes or no.
Context: {context}
Question: {question}
Model answer: {answer}
Answer now:
An alternative evaluation mode (scripts/evaluate_cot_ollama.py) instructs the judge to reason step-by-step before issuing its verdict. This is run across QA, Summarization, and Reasoning tasks using four Ollama models.
You are an evaluator checking whether a model answer is hallucinated.
Question: {question}
Model Answer: {answer}
Analyze step by step:
Step 1: What factual claims does the answer make?
Step 2: Are these claims supported by or inferable from the question context?
Step 3: Based on steps 1-2, is the answer hallucinated?
Final answer (write only this word on the last line): yes or no
(yes = answer is hallucinated, no = answer is not hallucinated)
You are an evaluator checking whether a summary is hallucinated relative to a document.
Document: {document}
Summary: {summary}
Analyze step by step:
Step 1: List the key claims made in the summary.
Step 2: For each claim, check whether it is directly supported by the document.
Step 3: Based on steps 1-2, decide your final answer.
Final answer (write only this word on the last line): yes or no
(yes = summary is hallucinated, no = summary is not hallucinated)
You are an expert evaluator for Bengali mathematical reasoning tasks.
Question: {question}
Reasoning Chain: {chain}
Answer: {answer}
Analyze step by step:
Step 1: Is each calculation or logical step in the reasoning chain mathematically correct?
Step 2: Does the final answer follow logically from the reasoning chain?
Step 3: Based on steps 1-2, is this reasoning chain hallucinated (incorrect or fabricated)?
Respond ONLY with a JSON object on the last line:
{"is_hallucinated": "Yes"} or {"is_hallucinated": "No"}
Note: CoT evaluation is not defined for the Codemix task.
CoT models: qwen2.5:32b-instruct, gemma2:27b, mistral-nemo:latest, llama3.1:8b
CoT output files follow the naming pattern *_cot_{model_slug}.csv.
BanglaHalluEval/
│
├── Hallucination Generated Answers/ # Raw hallucinated outputs (input to Stage 2)
│ ├── qa_4000.csv
│ ├── summarization_3000_corrected.csv
│ ├── reasoning_1000.csv
│ └── codemix_4000.csv
│
├── BanglaHalluEval Datasets/ # Final curated 1000-sample main datasets
│ ├── banglahallueval_qa_1000.csv
│ └── banglahallueval_qa_dataset_1000.csv
│
├── QA/
│ └── Results/ # QA evaluation output CSVs
│
├── Summarization/
│ ├── 1000 Selected Samples/
│ └── Evaluation_Results/
│
├── Reasoning/
│ ├── 1000 Selected Samples/
│ ├── 1000_hallucinated Samples/
│ └── Results/
│
├── Codemix/
│ ├── Main dataset/
│ ├── Results/
│ └── label_codemix_*_ollama.py # Per-model Codemix labeling scripts
│
├── scripts/ # All evaluation and labeling scripts
│ ├── label_hallucinations_ollama.py # QA — Ollama judge
│ ├── label_hallucinations_gpt.py # QA — GPT judge
│ ├── label_correct_answers_gpt_4_1_mini.py
│ ├── label_summarization_ollama.py # Summarization — Ollama judge
│ ├── label_summarization_gpt_4_1_mini.py
│ ├── label_summarization_gemma2.py
│ ├── label_summarization_deepseek.py
│ ├── label_reasoning_gpt_4_1_mini.py # Reasoning — GPT judge
│ ├── label_reasoning_main_1000_gpt_4_1_mini.py
│ ├── label_codemix_hallucinations_gpt_4_1_mini.py # Codemix — GPT judge
│ ├── label_codemix_main_gpt_4_1_mini.py
│ ├── evaluate_tigerllm.py # TigerLLM — all tasks (QA/Summ/Reasoning)
│ ├── evaluate_cot_ollama.py # CoT evaluation — QA/Summ/Reasoning
│ ├── evaluate_deepseek_ollama.py # DeepSeek — QA/Summ
│ ├── evaluate_codemix_deepseek_candidates.py
│ ├── evaluate_codemix_deepseek_main.py
│ ├── evaluate_reasoning_deepseek_candidates.py
│ └── evaluate_reasoning_deepseek_main.py
│
├── Results/ # Aggregated labeled output CSVs
├── Evaluation/ # GPT/LLaMA labeled QA results
├── public/halueval.pdf # Reference paper
├── requirements.txt
└── README.md
1. Install dependencies
pip install -r requirements.txt
pip install openai python-dotenv pandas transformers torch accelerate
2. Configure API keys (for GPT-based scripts)
Create a .env file in the project root:
OPENAI_API_KEY=sk-...
3. Start Ollama (for Ollama-based scripts)
ollama serve
ollama pull qwen2.5:32b-instruct
For a remote RunPod instance, pass --ollama-url https://<pod-id>-11434.proxy.runpod.net.
4. Run an evaluation
# QA — GPT-4.1 mini
python scripts/label_hallucinations_gpt.py \
--input "Hallucination Generated Answers/qa_4000.csv" \
--output "QA/Results/qa_4000_gpt4mini.csv"
# Summarization — Qwen 32B via Ollama
python scripts/label_summarization_ollama.py \
--input "Hallucination Generated Answers/summarization_3000_corrected.csv" \
--output "Summarization/Evaluation_Results/summ_3000_qwen32b.csv" \
--model qwen2.5:32b-instruct
# Reasoning — GPT-4.1 mini
python scripts/label_reasoning_gpt_4_1_mini.py \
--input "Hallucination Generated Answers/reasoning_1000.csv" \
--output "Reasoning/Results/reasoning_1000_gpt4mini.csv"
# Codemix — GPT-4.1 mini
python scripts/label_codemix_hallucinations_gpt_4_1_mini.py \
--input "Hallucination Generated Answers/codemix_4000.csv" \
--output "Results/codemix_4000_gpt4mini.csv"
# TigerLLM — all tasks (requires local GPU)
python scripts/evaluate_tigerllm.py --task all
# CoT — all tasks, all models
python scripts/evaluate_cot_ollama.py --task all
All scripts support --resume (skip already-labeled rows), --start / --end (slice), and --force-binary (retry until yes/no is obtained).