Shefwef/banglahallueval

Python

0

157 commits

updated Jun 18, 2026

See the code

README

BanglaHalluEval

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.


Table of Contents


Overview

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:

  • Standard — single-token yes/no judgment
  • CoT (Chain-of-Thought) — step-by-step reasoning before a final verdict

Hallucination patterns across tasks include factualness, comprehension, intrinsic, extrinsic, arithmetic_slip, and other error types.


Tasks

1. Question Answering (QA)

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.

PropertyDetail
LanguageBengali (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 patternsfactualness, comprehension

CSV columns:

ColumnDescription
idUnique sample identifier (e.g. bengali-XXXX::factualness)
source_idSource passage identifier
patternHallucination pattern type
contextBengali source passage
questionBengali question
right_answerGround-truth answer
hallucinated_answerHallucinated model output to be evaluated

2. Summarization

Bengali abstractive summarization. A source document is summarized; the hallucinated summary either introduces unsupported facts (extrinsic) or contradicts the source (intrinsic).

PropertyDetail
LanguageBengali (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 patternsIntrinsic, Extrinsic

CSV columns:

ColumnDescription
idUnique sample identifier
source_idSource document identifier
patternHallucination pattern (Intrinsic or Extrinsic)
documentBengali source document
right_summaryGround-truth summary
hallucinated_summaryHallucinated model summary to be evaluated

3. Reasoning

Bengali mathematical word problems drawn from the SOMADHAN dataset. A hallucinated reasoning chain is generated by introducing errors at specific steps of the solution.

PropertyDetail
LanguageBengali (full Unicode)
Source datasetSOMADHAN (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 typesarithmetic_slip, wrong_formula, wrong_unit, etc.

CSV columns:

ColumnDescription
idUnique sample identifier
question_idSource problem identifier
hallucination_typeType of introduced error
questionBengali math word problem
answerGround-truth answer
hallucinated_chainReasoning chain containing the introduced error
error_stepStep index where the error was introduced
error_typeCategory of the error
hallucinated_answerFinal 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.


4. Code-mixed QA (Codemix)

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.

PropertyDetail
LanguageCode-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 patternsfactualness, comprehension

CSV columns:

ColumnDescription
idUnique sample identifier
source_idSource passage identifier
patternHallucination pattern type
codemix_contextCode-mixed source passage
codemix_questionCode-mixed question
codemix_answerGround-truth answer
hallucinated_answerHallucinated 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.

Evaluation Pipeline

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.


Judge Models

ModelProviderScripts
GPT-4.1 miniOpenAI APIscripts/label_*_gpt_4_1_mini.py
Qwen 2.5 32BOllama (local / RunPod)scripts/label_*_ollama.py
Gemma2 27BOllamascripts/label_summarization_gemma2.py, Codemix/label_*_gemma_ollama.py
Mistral-NemoOllamascripts/label_hallucinations_mistral.py, Codemix/label_*_mistral_ollama.py
LLaMA 3.1 8BOllamaCodemix/label_*_llama_ollama.py
DeepSeek-R1 14BOllamascripts/evaluate_deepseek_ollama.py, scripts/evaluate_codemix_deepseek_*.py
TigerLLM-9B-ITHuggingFace (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.


Evaluation Prompts

QA

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:

Summarization

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:

Reasoning

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"}

Codemix

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:

Chain-of-Thought (CoT) Evaluation

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.

QA — CoT

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)

Summarization — CoT

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)

Reasoning — CoT

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.


Repository Structure

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

Setup

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).

Shefwef/banglahallueval

Python

0

157 commits

updated Jun 18, 2026

See the code

README

BanglaHalluEval

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.


Table of Contents


Overview

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:

  • Standard — single-token yes/no judgment
  • CoT (Chain-of-Thought) — step-by-step reasoning before a final verdict

Hallucination patterns across tasks include factualness, comprehension, intrinsic, extrinsic, arithmetic_slip, and other error types.


Tasks

1. Question Answering (QA)

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.

PropertyDetail
LanguageBengali (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 patternsfactualness, comprehension

CSV columns:

ColumnDescription
idUnique sample identifier (e.g. bengali-XXXX::factualness)
source_idSource passage identifier
patternHallucination pattern type
contextBengali source passage
questionBengali question
right_answerGround-truth answer
hallucinated_answerHallucinated model output to be evaluated

2. Summarization

Bengali abstractive summarization. A source document is summarized; the hallucinated summary either introduces unsupported facts (extrinsic) or contradicts the source (intrinsic).

PropertyDetail
LanguageBengali (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 patternsIntrinsic, Extrinsic

CSV columns:

ColumnDescription
idUnique sample identifier
source_idSource document identifier
patternHallucination pattern (Intrinsic or Extrinsic)
documentBengali source document
right_summaryGround-truth summary
hallucinated_summaryHallucinated model summary to be evaluated

3. Reasoning

Bengali mathematical word problems drawn from the SOMADHAN dataset. A hallucinated reasoning chain is generated by introducing errors at specific steps of the solution.

PropertyDetail
LanguageBengali (full Unicode)
Source datasetSOMADHAN (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 typesarithmetic_slip, wrong_formula, wrong_unit, etc.

CSV columns:

ColumnDescription
idUnique sample identifier
question_idSource problem identifier
hallucination_typeType of introduced error
questionBengali math word problem
answerGround-truth answer
hallucinated_chainReasoning chain containing the introduced error
error_stepStep index where the error was introduced
error_typeCategory of the error
hallucinated_answerFinal 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.


4. Code-mixed QA (Codemix)

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.

PropertyDetail
LanguageCode-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 patternsfactualness, comprehension

CSV columns:

ColumnDescription
idUnique sample identifier
source_idSource passage identifier
patternHallucination pattern type
codemix_contextCode-mixed source passage
codemix_questionCode-mixed question
codemix_answerGround-truth answer
hallucinated_answerHallucinated 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.

Evaluation Pipeline

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.


Judge Models

ModelProviderScripts
GPT-4.1 miniOpenAI APIscripts/label_*_gpt_4_1_mini.py
Qwen 2.5 32BOllama (local / RunPod)scripts/label_*_ollama.py
Gemma2 27BOllamascripts/label_summarization_gemma2.py, Codemix/label_*_gemma_ollama.py
Mistral-NemoOllamascripts/label_hallucinations_mistral.py, Codemix/label_*_mistral_ollama.py
LLaMA 3.1 8BOllamaCodemix/label_*_llama_ollama.py
DeepSeek-R1 14BOllamascripts/evaluate_deepseek_ollama.py, scripts/evaluate_codemix_deepseek_*.py
TigerLLM-9B-ITHuggingFace (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.


Evaluation Prompts

QA

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:

Summarization

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:

Reasoning

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"}

Codemix

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:

Chain-of-Thought (CoT) Evaluation

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.

QA — CoT

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)

Summarization — CoT

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)

Reasoning — CoT

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.


Repository Structure

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

Setup

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).