diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..fd8887da29d2f6a3c538b0f75946b3c4e0f41ce4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +assets/architecture.png filter=lfs diff=lfs merge=lfs -text +assets/workflow.png filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 2566a2b204cfb80f2765c88a646c24579152cba2..51bc3a4f5e9687effd657685fcb6d14363a8d835 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,145 @@ --- title: EvidenceGuard AI -emoji: ๐Ÿ‘ +emoji: ๐Ÿ›ก๏ธ colorFrom: blue -colorTo: indigo +colorTo: yellow sdk: gradio sdk_version: 6.32.0 -python_version: '3.12' +python_version: "3.12" app_file: app.py pinned: false -license: mit +license: apache-2.0 +short_description: Evidence-verified RAG assistant for university rules --- -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# ๐Ÿ›ก๏ธ EvidenceGuard AI โ€“ Your Verified University Knowledge Assistant + +**A reliable university knowledge assistant using RAG, LLMs and evidence verification.** + +Standard RAG chatbots answer *every* question, even when the documents do not contain the answer or when two +documents give different versions of the same rule. EvidenceGuard AI checks that **sufficient and consistent +evidence** exists before answering. Otherwise it gives a partial answer, shows both conflicting versions (and +names the newer document), or abstains and explains why. + +> โš ๏ธ **All bundled documents are SYNTHETIC DEMONSTRATION DATA** describing *Aranya Valley University*, a +> fictional institution. They are not real university policies, and the experimental results do not establish +> real-world policy accuracy. + +## What's inside + +| Path | Contents | +|---|---| +| `app.py` | 7-tab Gradio app (Home, Upload, AI Assistant, Evidence Verification, Model Comparison, Evaluation Dashboard, About) | +| `config.py` | Models, backends, thresholds (all overridable by environment variables / Space secrets) | +| `src/` | `document_processor`, `embeddings`, `vector_store`, `retrieval`, `reranker`, `evidence_verifier`, `llm_generator`, `baseline_rag`, `enhanced_rag`, `evaluation`, `system`, `research`, `text_utils` | +| `sample_data/` | 16 generated PDFs (28 pages) + `corpus_manifest.json` | +| `evaluation_data/` | `questions.json` / `questions.csv`: 100 questions with evidence document, page, status and behaviour | +| `results/` | `metrics.csv`, `metrics.json`, per-question results, category breakdown, error analysis, failure cases, significance tests, `charts/` | +| `reports/` | `project_report.pdf`, `project_report.docx` | +| `assets/` | `architecture.png`, `workflow.png` | +| `docs/` | `TEST_REPORT.md`, `screenshots/` | +| `scripts/` | dataset generator, evaluation runner, significance tests, diagram and report builders | +| `tests/` | pytest suite (20 tests) | + +## Two systems + +**System A โ€“ Baseline RAG:** PDF ingestion โ†’ extraction โ†’ cleaning โ†’ chunking โ†’ Sentence-Transformer embeddings โ†’ FAISS โ†’ semantic retrieval โ†’ LLM answer โ†’ source citations. + +**System B โ€“ EvidenceGuard RAG:** hybrid retrieval (FAISS + BM25 fused with reciprocal rank fusion) โ†’ cross-encoder reranking โ†’ **evidence-sufficiency check** โ†’ **conflict-search retrieval + contradiction detection** (NLI + numeric/polarity rules) โ†’ context-grounded, conflict-aware generation โ†’ **citation validation** of every sentence โ†’ **confidence-based abstention** โ†’ explanation (answered / partial / conflict / abstained). + +![architecture](assets/architecture.png) + +## Models (free, open licences โ€“ verify on each model card) + +| Role | Default model | Offline fallback | +|---|---|---| +| Embeddings | `sentence-transformers/all-MiniLM-L6-v2` | LSA (TF-IDF + TruncatedSVD) | +| Reranker | `cross-encoder/ms-marco-MiniLM-L-6-v2` | lexical cross-scorer | +| NLI | `cross-encoder/nli-deberta-v3-xsmall` | numeric-value & polarity rules | +| LLM (local CPU) | `Qwen/Qwen2.5-0.5B-Instruct` | extractive composer (no LLM) | +| LLM (API, optional) | `Qwen/Qwen2.5-7B-Instruct` via HF Inference Providers (`HF_TOKEN`) | โ€“ | + +`EG_BACKEND=auto` (default) loads the Hugging Face models and falls back component-by-component if one cannot +be loaded. `EG_BACKEND=lite` forces the offline components (fast, no downloads). + +## Run locally + +```bash +python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate +pip install -r requirements.txt +python app.py # http://127.0.0.1:7860 +``` + +Fully offline / fastest start: `EG_BACKEND=lite LLM_BACKEND=extractive python app.py` + +Regenerate everything: + +```bash +python scripts/generate_dataset.py # PDFs + 100 questions +python scripts/run_evaluation.py --backend lite --llm extractive # results/ + charts (โ‰ˆ25 s on CPU) +python scripts/significance.py # McNemar + bootstrap CIs +python scripts/make_diagrams.py # assets/*.png +pip install -r requirements-dev.txt && python -m pytest -q # tests +python scripts/build_report.py # reports/*.docx + *.pdf (needs Node `docx` + LibreOffice) +``` + +With the Hugging Face model stack (e.g. on Kaggle/Colab or the Space): +`python scripts/run_evaluation.py --backend full --llm local` (or `--llm hf_api` with `HF_TOKEN` set). Thresholds +are re-calibrated on the DEV split for that backend automatically. + +## Results (real, from `results/metrics.json`) + + +Held-out TEST split (71 questions), backend `lite` (offline fallback components), run 2026-11-19 07:51: + +| Metric | Baseline RAG | + Reranking | + Verification | EvidenceGuard | +|---|---|---|---|---| +| Recall@5 | 0.975 | 0.992 | 0.983 | 0.992 | +| MRR | 0.975 | 0.958 | 0.975 | 0.958 | +| Answer correctness | 0.563 | 0.549 | 0.704 | 0.704 | +| Expected-behaviour accuracy | 0.535 | 0.521 | 0.704 | 0.704 | +| Evidence-grounded faithfulness | 0.770 | 0.747 | 0.858 | 0.844 | +| Unsupported answer rate โ†“ | 0.211 | 0.225 | 0.099 | 0.099 | +| Abstention F1 | 0.000 | 0.000 | 0.588 | 0.588 | +| Contradiction F1 | 0.000 | 0.000 | 0.720 | 0.720 | +| Citation support accuracy | 0.756 | 0.730 | 0.826 | 0.812 | +| Avg response time (s) | 0.0014 | 0.0023 | 0.0040 | 0.0052 | + +Paired exact McNemar test, baseline vs EvidenceGuard (test split): behaviour accuracy +0.169 (p = 0.029); unsupported answers -0.113 (p = 0.039). + + +**Read these honestly:** gains come from the verification layer. Reranking alone gave no improvement on this +small corpus. EvidenceGuard over-abstains on some answerable multi-part questions. The reported run used the +**offline fallback components**, because Hugging Face downloads were blocked in the build environment; re-run with +`--backend full` to measure the Hugging Face model stack. The verification rules were developed on the same +question set (only thresholds were calibrated on the DEV split), so the test numbers are optimistic. + +## Deploy to Hugging Face Spaces + +1. Create a Space at : SDK **Gradio**, hardware **CPU basic (free)**. +2. Push this repository to it: + ```bash + git remote add space https://huggingface.co/spaces//EvidenceGuard-AI + git push space main + ``` + (Authenticate with a Hugging Face **write** token as the password, or use `huggingface-cli login`.) + PDFs and PNGs are binary: if the push is rejected, run `git lfs install && git lfs track "*.pdf" "*.png"` and commit again. +3. Optional **Settings โ†’ Variables and secrets**: + - `HF_TOKEN` (secret) โ€“ enables the stronger LLM through Hugging Face Inference Providers + - `LLM_BACKEND` = `hf_api` | `local` | `extractive` (default `auto`) + - `EG_BACKEND` = `auto` | `full` | `lite` +4. The first start downloads ~0.1 GB of encoder models (+ ~1 GB if the local Qwen LLM is used), which takes a few minutes. + Sample data is in the repository, so it is reloaded on every restart. + +Never commit tokens; `config.py` reads credentials only from environment variables. + +## Research basis (verified) + +Chen et al. (AAAI 2024, RGB) ยท Asai et al. (ICLR 2024, Self-RAG) ยท Yan et al. (arXiv 2024, CRAG) ยท +Gao et al. (EMNLP 2023, ALCE) ยท Yoran et al. (ICLR 2024) ยท Hou et al. (NeurIPS 2024 D&B, WikiContradict) ยท +Es et al. (EACL 2024 demos, RAGAS) ยท Niu et al. (ACL 2024, RAGTruth). Full table and IEEE references are in the report +and in the app's About tab. + +## Licence + +Code: Apache-2.0. Generated documents and questions: synthetic, free to reuse with the "synthetic" label kept. diff --git a/app.py b/app.py new file mode 100644 index 0000000000000000000000000000000000000000..78b108213d37667ca538dd6423a6b1c4cb627d93 --- /dev/null +++ b/app.py @@ -0,0 +1,524 @@ +""" +EvidenceGuard AI - Your Verified University Knowledge Assistant +Gradio application (entry point for local runs and Hugging Face Spaces). + + python app.py -> http://127.0.0.1:7860 +""" +from __future__ import annotations + +import json +import logging +import re +import shutil +import subprocess +import sys +import threading +from pathlib import Path + +import gradio as gr +import pandas as pd + +import config +from src.research import FOUNDATION, FUTURE, LIMITATIONS, OBJECTIVES, PAPERS, RESEARCH_GAP +from src.system import CONFIG_NAMES, EvidenceGuardSystem + +logging.basicConfig(level=logging.INFO, format="%(levelname)s %(name)s: %(message)s") +log = logging.getLogger("app") + +SYSTEM = EvidenceGuardSystem() # loads models (or fallbacks) + the synthetic sample corpus +LOCK = threading.Lock() # uploads rebuild the shared index +ASSETS = config.ROOT / "assets" + +EXAMPLES = [ + "What is the minimum attendance required to appear for end-semester examinations?", + "How many books can a postgraduate student borrow from the library?", + "What is the fee for revaluation of answer scripts?", + "Given that internal assessment carries 50 marks, how many marks does the end-semester examination carry?", + "What is the late fee for course registration?", + "Are late assignment submissions accepted?", + "When is Internal Test 1 held this semester, and what must a student do to take a make-up test if they miss it through illness?", +] + +DECISION_BADGE = { + "answered": "โœ… Answered - evidence verified", + "partial": "๐ŸŸก Partially answered - some parts not covered", + "conflict": "โš ๏ธ Conflicting evidence - both versions shown", + "abstained": "โ›” Abstained - insufficient evidence", +} + +# ============================================================================ helpers + +def kb_table() -> pd.DataFrame: + rows = [{"Document": d.doc_name, "Title": d.title, "Issued": d.issued or "-", "Pages": d.pages, + "Chunks": d.chunks, "Status": d.status} for d in SYSTEM.kb.docs.values()] + return pd.DataFrame(rows, columns=["Document", "Title", "Issued", "Pages", "Chunks", "Status"]) + + +def kb_summary() -> str: + n_docs, n_chunks = len(SYSTEM.kb.docs), len(SYSTEM.kb.chunks) + pages = sum(d.pages for d in SYSTEM.kb.docs.values()) + return f"**Knowledge base:** {n_docs} documents ยท {pages} pages ยท {n_chunks} chunks indexed in FAISS + BM25." + + +def msg_text(m) -> str: + """Gradio 6 returns message content either as a string or as a list of typed parts.""" + c = m.get("content") if isinstance(m, dict) else m + if isinstance(c, str): + return c + if isinstance(c, dict): + return c.get("text", "") + if isinstance(c, (list, tuple)): + return " ".join(msg_text({"content": x}) for x in c) + return str(c or "") + + +def contextualize(question: str, history: list) -> str: + """Follow-up support: short / referential questions inherit the previous user question.""" + prev = [msg_text(m) for m in history if isinstance(m, dict) and m.get("role") == "user"] + if not prev: + return question + q = question.strip() + referential = re.match(r"^(and|what about|how about|also|then)\b", q, re.I) or \ + re.search(r"\b(it|that|this|those|them|they|same)\b", q, re.I) + if referential or len(q.split()) <= 5: + last = prev[-1] + last = last.split("\n(Interpreted as:")[0] + return f"{q} (context: {last})" + return question + + +def citations_md(res: dict) -> str: + if not res.get("citations"): + return "" + lines = [f"[{c['n']}] {c['title']} - *{c['doc_name']}*, page {c['page']}" for c in res["citations"]] + return "\n\n**Sources:**\n" + "\n".join(f"- {x}" for x in lines) + + +def answer_md(res: dict, show_badge: bool = True) -> str: + label = DECISION_BADGE.get(res["decision"], res["decision"]) + if res.get("sufficiency") is None and res["decision"] == "answered": + label = "โ„น๏ธ Answered without verification (baseline - may be unsupported)" + badge = f"**{label}**\n\n" if show_badge else "" + conf = f"\n\nConfidence: {res['confidence']:.2f} ยท {res['explanation']}" \ + if res.get("confidence") is not None else f"\n\n{res['explanation']}" + return badge + res["answer"] + citations_md(res) + conf + + +def passages_df(res: dict) -> pd.DataFrame: + rows = [] + for p in res.get("passages", []): + rows.append({"#": p["n"], "Document": p["title"], "File": p["doc_name"], "Page": p["page"], + "Retrieval relevance": p["relevance"], "Dense": p["dense"], "BM25": p["sparse"], + "Source": p.get("source", "retrieval"), + "Passage": p["text"][:400] + ("..." if len(p["text"]) > 400 else "")}) + return pd.DataFrame(rows) + + +def verification_md(res: dict | None) -> str: + if not res: + return "*Ask a question in the AI Assistant tab (or below) to see its evidence report here.*" + out = [f"### Question\n{res['question']}", + f"### Decision\n**{DECISION_BADGE.get(res['decision'], res['decision'])}**", + f"**Why:** {res['explanation']}"] + s = res.get("sufficiency") + if s: + out.append("### Evidence sufficiency\n" + f"| Signal | Value | Threshold |\n|---|---|---|\n" + f"| Best passage relevance | {s['max_relevance']:.3f} | {SYSTEM.verifier.th['min_relevance']:.2f} |\n" + f"| Query coverage (combined) | {s['coverage']:.3f} | {SYSTEM.verifier.th['min_coverage']:.2f} |\n" + f"| Coverage by best single passage | {s['coverage_single']:.3f} | - |\n" + f"| Coverage by top-3 passages | {s['coverage_union']:.3f} | - |\n" + f"| Status | **{s['status']}** | - |\n\n" + + (f"Question terms not found in evidence: `{', '.join(s['missing_terms'])}`" + if s["missing_terms"] else "All question terms found in the evidence.")) + elif res["system"].startswith("1.") or res["system"].startswith("2."): + out.append("*Baseline configuration: no sufficiency, contradiction or citation checks are performed.*") + cs = res.get("conflicts") or [] + out.append("### Contradiction status\n" + ("No contradiction detected between the retrieved documents." + if not cs else "")) + for c in cs: + out.append(f"- **{c['kind']} conflict** ({c['detail']})\n" + f" - *{c['title_a']}* (p.{c['page_a']}, issued {c['issued_a'] or '?'}): {c['sentence_a']}\n" + f" - *{c['title_b']}* (p.{c['page_b']}, issued {c['issued_b'] or '?'}): {c['sentence_b']}\n" + f" - Newer document: **{c['newer'] or 'unknown'}**" + + (" (explicitly revises the earlier rule)" if c["explicit_update"] else "")) + if res.get("premise_notes"): + out.append("### False-premise check\n" + "\n".join(f"- {p}" for p in res["premise_notes"])) + ch = res.get("citation_checks") or [] + if ch: + out.append("### Citation verification\n| Sentence | Cited | Supported | Score | Reason |\n|---|---|---|---|---|\n" + + "\n".join(f"| {c['sentence'][:110].replace('|', '/')} | {c['cited']} | " + f"{'โœ…' if c['supported'] else 'โŒ'} | {c['score']:.2f} | {c['reason'][:80]} |" for c in ch)) + t = res["timings"] + out.append(f"### Timing\nretrieval {t['retrieval']*1000:.0f} ms ยท rerank {t.get('rerank', 0)*1000:.0f} ms ยท " + f"verification {t.get('verification', 0)*1000:.0f} ms ยท generation {t['generation']*1000:.0f} ms ยท " + f"**total {t['total']*1000:.0f} ms** ยท generator: {res.get('generator') or '-'}") + return "\n\n".join(out) + + +# ============================================================================ callbacks + +def process_uploads(files): + if not files: + return pd.DataFrame(), kb_table(), kb_summary(), "Please choose one or more PDF files first." + paths = [] + for f in files: + src = Path(f if isinstance(f, str) else f.name) + if src.suffix.lower() != ".pdf": + continue + dst = config.UPLOAD_DIR / src.name + shutil.copy(src, dst) + paths.append(dst) + if not paths: + return pd.DataFrame(), kb_table(), kb_summary(), "No PDF files were found in the upload." + with LOCK: + infos = SYSTEM.kb.add_pdfs(paths) + rows = [{"File": i.doc_name, "Extraction status": f"{i.status}: {i.message}", "Pages": i.pages, + "Chunks": i.chunks, "Detected title": i.title, "Detected date": i.issued or "-"} for i in infos] + ok = sum(i.status == "ok" for i in infos) + return (pd.DataFrame(rows), kb_table(), kb_summary(), + f"Processed {len(infos)} file(s): {ok} indexed successfully. You can now ask questions about them.") + + +def reset_kb(): + with LOCK: + for d in list(SYSTEM.kb.docs): + SYSTEM.kb.docs.pop(d) + SYSTEM.kb.chunks = [] + SYSTEM.kb.load_folder(config.SAMPLE_DATA_DIR) + return pd.DataFrame(), kb_table(), kb_summary(), "Knowledge base reset to the 16 synthetic sample documents." + + +def remove_doc(name): + with LOCK: + for did, d in list(SYSTEM.kb.docs.items()): + if d.doc_name == name: + SYSTEM.kb.remove_doc(did) + return kb_table(), kb_summary(), f"Removed {name}." + return kb_table(), kb_summary(), f"Document '{name}' not found." + + +def chat(message, history, mode): + history = history or [] + if not message or not message.strip(): + return history, "", None + if not SYSTEM.kb.ready: + history += [{"role": "user", "content": message}, + {"role": "assistant", "content": "The knowledge base is empty. Upload PDFs in the Upload tab first."}] + return history, "", None + q = contextualize(message, history) + key = "full" if mode.startswith("EvidenceGuard") else "baseline" + with LOCK: + res = SYSTEM.pipelines[key].answer(q) + shown = message if q == message else f"{message}\n(Interpreted as: {q})" + history += [{"role": "user", "content": shown}, {"role": "assistant", "content": answer_md(res)}] + return history, "", res + + +def verify_direct(question, cfg): + if not question.strip(): + return "Please type a question.", pd.DataFrame(), None + key = {v: k for k, v in CONFIG_NAMES.items()}[cfg] + with LOCK: + res = SYSTEM.pipelines[key].answer(question) + return verification_md(res), passages_df(res), res + + +def show_last(res): + return verification_md(res), passages_df(res) if res else pd.DataFrame() + + +def compare(question): + if not question.strip(): + empty = "Please type a question." + return empty, empty, pd.DataFrame(), pd.DataFrame(), pd.DataFrame() + with LOCK: + a = SYSTEM.pipelines["baseline"].answer(question) + b = SYSTEM.pipelines["full"].answer(question) + + def perf(r, name): + t = r["timings"] + return {"System": name, "Decision": r["decision"], "Passages": len(r["passages"]), + "Citations": len(r["citations"]), "Conflicts flagged": len(r.get("conflicts") or []), + "Confidence": r.get("confidence"), "Retrieval ms": round((t["retrieval"] + t.get("rerank", 0)) * 1000, 1), + "Verification ms": round(t.get("verification", 0) * 1000, 1), + "Generation ms": round(t["generation"] * 1000, 1), "Total ms": round(t["total"] * 1000, 1)} + perf_df = pd.DataFrame([perf(a, "Baseline RAG"), perf(b, "EvidenceGuard")]) + return answer_md(a, show_badge=False), answer_md(b), passages_df(a), passages_df(b), perf_df + + +# ---------------------------------------------------------------------------- evaluation dashboard +METRIC_LABELS = { + "precision_at_k": "Precision@5", "recall_at_k": "Recall@5", "mrr": "MRR", + "answer_correctness": "Answer correctness", "behaviour_accuracy": "Expected-behaviour accuracy", + "faithfulness": "Faithfulness (to context)", "grounded_faithfulness": "Evidence-grounded faithfulness", + "answer_relevance": "Answer relevance (lexical proxy)", "context_precision": "Context precision (AP@5)", + "context_recall": "Context recall (key facts in context)", "unsupported_answer_rate": "Unsupported answer rate โ†“", + "abstention_accuracy": "Abstention accuracy", "abstention_f1": "Abstention F1", + "contradiction_precision": "Contradiction precision", "contradiction_recall": "Contradiction recall", + "contradiction_f1": "Contradiction F1", "citation_support_accuracy": "Citation support accuracy", + "avg_response_time_s": "Avg response time (s)", "avg_retrieval_time_s": "Avg retrieval time (s)", + "avg_generation_time_s": "Avg generation time (s)", "avg_verification_time_s": "Avg verification time (s)", +} + + +def load_eval(split="all"): + p = config.RESULTS_DIR / "metrics.json" + if not p.exists(): + return pd.DataFrame({"info": ["No results yet - click 'Re-run evaluation'."]}), "", pd.DataFrame(), pd.DataFrame(), pd.DataFrame() + m = json.loads(p.read_text()) + names = m["config_names"] + order = ["baseline", "rerank", "verify", "full"] + rows = [] + for k, lab in METRIC_LABELS.items(): + rows.append({"Metric": lab, **{names[c]: m["metrics"][split][c].get(k) for c in order}}) + meta = m["meta"] + info = (f"**Run:** {meta['date']} ยท {meta['n_questions']} questions ({meta['dev_questions']} dev used for " + f"threshold calibration, {meta['test_questions']} held-out test) ยท backend `{meta['backend']}` ยท " + f"runtime {meta['runtime_s']} s\n\n**Components used in this run:** " + + "; ".join(f"{k}: {v}" for k, v in meta["components"].items()) + + f"\n\n> โš ๏ธ {meta['note']}") + cat = pd.read_csv(config.RESULTS_DIR / "category_breakdown.csv") + err = pd.read_csv(config.RESULTS_DIR / "error_analysis.csv") + fails = json.loads((config.RESULTS_DIR / "failure_cases.json").read_text()) + fdf = pd.DataFrame(fails["evidenceguard_failures"])[["id", "category", "question", "error_type", "answer", + "expected_answer", "explanation"]] \ + if fails["evidenceguard_failures"] else pd.DataFrame() + return pd.DataFrame(rows), info, cat, err, fdf + + +def chart_paths(): + names = ["retrieval_comparison", "answer_quality_comparison", "reliability_comparison", + "category_breakdown", "error_analysis", "response_time"] + return [str(config.CHARTS_DIR / f"{n}.png") if (config.CHARTS_DIR / f"{n}.png").exists() else None for n in names] + + +def rerun_eval(split): + backend = SYSTEM.effective_backend + cmd = [sys.executable, str(config.ROOT / "scripts" / "run_evaluation.py"), "--backend", backend, + "--llm", "extractive" if SYSTEM.generator.llm is None else config.LLM_BACKEND] + proc = subprocess.run(cmd, capture_output=True, text=True, cwd=str(config.ROOT), timeout=3600) + status = ("โœ… Evaluation finished." if proc.returncode == 0 else "โŒ Evaluation failed:\n" + proc.stderr[-1500:]) + if proc.returncode == 0: + SYSTEM.set_thresholds(config.load_thresholds(SYSTEM.effective_backend)) + return (status + "\n\n```\n" + proc.stdout[-1800:] + "\n```", *load_eval(split), *chart_paths()) + + +# ============================================================================ UI text +HOME_MD = f""" +# ๐Ÿ›ก๏ธ EvidenceGuard AI +### Your Verified University Knowledge Assistant + +**Problem.** Ordinary LLM chatbots and standard RAG systems answer *every* question, even when the +documents do not contain the answer, when the retrieved text is irrelevant, or when two documents give +**different versions of the same rule** (e.g. an old regulation and a newer amendment circular). +For students, a confident wrong answer about attendance, exam eligibility or scholarship deadlines has real consequences. + +**EvidenceGuard AI** retrieves information from university documents and **verifies that sufficient, +consistent evidence exists before answering**. Otherwise it gives a partial answer, shows both +conflicting versions, or refuses and explains why. + +#### Key features +- ๐Ÿ“„ Upload any PDFs; text extraction, cleaning, chunking and indexing (FAISS + BM25) +- ๐Ÿ”Ž Hybrid semantic + keyword retrieval with cross-encoder reranking +- ๐Ÿงช Evidence-sufficiency check โ†’ **abstains** instead of guessing +- โš–๏ธ **Conflict search**: detects contradictions between documents and names the newer version +- ๐Ÿ”— **Citation validation**: every answer sentence is checked against the passage it cites +- ๐Ÿ’ฌ Explanations of why the system answered, partially answered or refused +- ๐Ÿ“Š Side-by-side Baseline vs EvidenceGuard comparison and a real evaluation dashboard + +#### Research contribution +A training-free, CPU-only verification layer combining sufficiency-based abstention, numeric-aware +inter-document contradiction detection with *conflict-search retrieval*, and inference-time citation +validation, evaluated with a 4-configuration ablation on a 100-question benchmark containing labelled +missing, misleading and conflicting questions. + +> โš ๏ธ The bundled documents describe **Aranya Valley University, a fictional institution**. They are +> SYNTHETIC DEMONSTRATION DATA, not real university policy. +""" + +ABOUT_PARTS = [] + + +def about_md(): + lit = "| # | Paper | Authors (year) | Venue | Problem | Method | Limitation | How EvidenceGuard responds |\n|---|---|---|---|---|---|---|---|\n" + for i, p in enumerate(PAPERS, 1): + lit += (f"| {i} | [{p['title']}]({p['link']}) | {p['authors']} ({p['year']}) | {p['venue']} | {p['problem']} | " + f"{p['method']} | {p['limitations']} | {p['ours']} |\n") + refs = "\n".join(f"{i}. {p['authors']}, \"{p['title']},\" {p['venue']}. {p['link']}" for i, p in enumerate(PAPERS, 1)) + refs += "\n" + "\n".join(f"{len(PAPERS) + i}. {r}" for i, r in enumerate(FOUNDATION, 1)) + return f""" +## Research papers (verified, 2023-2024) +{lit} + +## Research gap +{RESEARCH_GAP} + +## Objectives +{chr(10).join(f'{i}. {o}' for i, o in enumerate(OBJECTIVES, 1))} + +## Methodology +1. **Synthetic corpus** - 16 fictional AVU PDFs (28 pages) generated from one fact base, with 9 planted conflicts, + superseding circulars, a distractor document and deliberately uncovered topics. +2. **Benchmark** - 100 questions (30 answerable, 20 multi-passage, 15 missing-information, 15 misleading, 20 conflicting), + each with expected answer, key facts, evidence document/page, expected evidence status and behaviour. +3. **Systems** - Baseline RAG (dense FAISS โ†’ LLM โ†’ citations) vs EvidenceGuard (hybrid โ†’ rerank โ†’ sufficiency โ†’ + conflict search & contradiction โ†’ grounded generation โ†’ citation validation โ†’ confidence/abstention). +4. **Ablation** - 4 configurations; thresholds calibrated on a stratified DEV split (29 questions) only, results reported + on all 100 and on the 71 held-out TEST questions. +5. **Metrics** - Precision/Recall@5, MRR, answer correctness, faithfulness, answer relevance, context precision/recall, + unsupported-answer rate, abstention and contradiction P/R/F1, citation support accuracy, latency. + +## Architecture +See the diagrams below. Every model component has an offline fallback so the app runs on any CPU. + +## Limitations +{chr(10).join(f'- {x}' for x in LIMITATIONS)} + +## Future scope +{chr(10).join(f'- {x}' for x in FUTURE)} + +## References (IEEE style) +{refs} +""" + + +def stack_md(): + rows = "\n".join(f"| {k} | {v} |" for k, v in SYSTEM.component_names().items()) + return ("#### Technology stack (live - what this running instance is using)\n| Component | Implementation |\n|---|---|\n" + + rows + "\n| UI | Gradio |\n| PDF processing | PyMuPDF (pypdf fallback) |\n\n" + "If a Hugging Face model cannot be downloaded, the app automatically uses the offline fallback shown here.") + + +CSS = """ +.gradio-container {max-width: 1280px !important} +.badge {font-size: 0.9em} +footer {visibility: hidden} +""" + +# ============================================================================ layout +with gr.Blocks(title="EvidenceGuard AI") as demo: + last_result = gr.State(None) + gr.Markdown("

๐Ÿ›ก๏ธ EvidenceGuard AI - Your Verified University Knowledge Assistant

" + "Demo corpus = SYNTHETIC DEMONSTRATION DATA of a fictional university") + + # ---------------------------------------------------------------- TAB 1 + with gr.Tab("๐Ÿ  Home"): + with gr.Row(): + with gr.Column(scale=3): + gr.Markdown(HOME_MD) + with gr.Column(scale=2): + gr.Markdown(stack_md()) + home_kb = gr.Markdown(kb_summary()) + gr.Markdown("#### System workflow") + gr.Image(str(ASSETS / "workflow.png"), show_label=False, height=620) + + # ---------------------------------------------------------------- TAB 2 + with gr.Tab("๐Ÿ“„ Upload Documents"): + gr.Markdown("Upload one or more PDFs. They are extracted, cleaned, chunked and added to the FAISS + BM25 index " + "alongside the sample documents. Re-uploading a file with the same name replaces it.") + with gr.Row(): + up_files = gr.File(label="PDF files", file_count="multiple", file_types=[".pdf"]) + with gr.Column(): + up_btn = gr.Button("โš™๏ธ Process documents into the vector database", variant="primary") + reset_btn = gr.Button("โ†ฉ๏ธ Reset to sample data") + up_status = gr.Markdown() + up_result = gr.Dataframe(label="Processing result (this upload)", interactive=False) + up_kb_md = gr.Markdown(kb_summary()) + up_kb = gr.Dataframe(value=kb_table(), label="Documents in the knowledge base", interactive=False) + with gr.Row(): + rm_name = gr.Textbox(label="Remove a document (file name)", placeholder="e.g. my_policy.pdf") + rm_btn = gr.Button("๐Ÿ—‘๏ธ Remove") + + # ---------------------------------------------------------------- TAB 3 + with gr.Tab("๐Ÿ’ฌ AI Assistant"): + with gr.Row(): + mode = gr.Radio(["EvidenceGuard (verified)", "Baseline RAG"], value="EvidenceGuard (verified)", + label="Answering system") + chatbot = gr.Chatbot(height=470, label="EvidenceGuard Assistant", render_markdown=True) + with gr.Row(): + msg = gr.Textbox(placeholder="Ask about attendance, exams, scholarships, library rules... " + "(follow-up questions are supported)", scale=6, show_label=False) + send = gr.Button("Ask", variant="primary", scale=1) + clear = gr.Button("Clear chat", scale=1) + gr.Examples(EXAMPLES, inputs=msg, label="Try these (include missing-information, misleading and conflicting cases)") + gr.Markdown("*The full evidence report for the latest answer is in the **Evidence Verification** tab.*") + + # ---------------------------------------------------------------- TAB 4 + with gr.Tab("๐Ÿ”ฌ Evidence Verification"): + gr.Markdown("Shows the retrieved passages, sources, pages, relevance scores, evidence sufficiency, " + "contradiction status, citation verification and the reason for any abstention.") + with gr.Row(): + v_q = gr.Textbox(label="Question", placeholder="Type a question, or press 'Show latest chat answer'", scale=4) + v_cfg = gr.Dropdown(list(CONFIG_NAMES.values()), value=CONFIG_NAMES["full"], label="Configuration", scale=2) + with gr.Row(): + v_btn = gr.Button("๐Ÿ” Verify this question", variant="primary") + v_last = gr.Button("Show latest chat answer") + v_md = gr.Markdown(verification_md(None)) + v_df = gr.Dataframe(label="Retrieved passages", interactive=False, wrap=True) + + # ---------------------------------------------------------------- TAB 5 + with gr.Tab("โš–๏ธ Model Comparison"): + with gr.Row(): + c_q = gr.Textbox(label="Question", scale=5, value=EXAMPLES[0]) + c_btn = gr.Button("Compare", variant="primary", scale=1) + gr.Examples(EXAMPLES, inputs=c_q) + with gr.Row(): + with gr.Column(): + gr.Markdown("### System A - Baseline RAG") + c_a = gr.Markdown() + c_pa = gr.Dataframe(label="Baseline evidence", interactive=False, wrap=True) + with gr.Column(): + gr.Markdown("### System B - EvidenceGuard RAG") + c_b = gr.Markdown() + c_pb = gr.Dataframe(label="EvidenceGuard evidence", interactive=False, wrap=True) + c_perf = gr.Dataframe(label="Performance information", interactive=False) + + # ---------------------------------------------------------------- TAB 6 + with gr.Tab("๐Ÿ“Š Evaluation Dashboard"): + with gr.Row(): + e_split = gr.Radio(["all", "test", "dev"], value="all", label="Question split") + e_reload = gr.Button("Reload results") + e_run = gr.Button("โ–ถ๏ธ Re-run evaluation (100 questions ร— 4 systems)", variant="primary") + e_status = gr.Markdown() + e_info = gr.Markdown() + e_table = gr.Dataframe(label="Metrics (real values from results/metrics.json)", interactive=False) + with gr.Row(): + ch1 = gr.Image(label="Retrieval comparison") + ch2 = gr.Image(label="Answer quality & faithfulness") + with gr.Row(): + ch3 = gr.Image(label="Reliability: unsupported answers, abstention, contradictions") + ch4 = gr.Image(label="Behaviour accuracy by category") + with gr.Row(): + ch5 = gr.Image(label="Error analysis") + ch6 = gr.Image(label="Response time") + e_cat = gr.Dataframe(label="Category breakdown", interactive=False) + e_err = gr.Dataframe(label="Error analysis (counts per configuration)", interactive=False) + e_fail = gr.Dataframe(label="EvidenceGuard failure cases", interactive=False, wrap=True) + + # ---------------------------------------------------------------- TAB 7 + with gr.Tab("โ„น๏ธ About Project"): + gr.Markdown(about_md()) + gr.Image(str(ASSETS / "architecture.png"), label="System architecture") + + # ================================================================ wiring + up_btn.click(process_uploads, up_files, [up_result, up_kb, up_kb_md, up_status]).then(kb_summary, None, home_kb) + reset_btn.click(reset_kb, None, [up_result, up_kb, up_kb_md, up_status]).then(kb_summary, None, home_kb) + rm_btn.click(remove_doc, rm_name, [up_kb, up_kb_md, up_status]) + send.click(chat, [msg, chatbot, mode], [chatbot, msg, last_result]) + msg.submit(chat, [msg, chatbot, mode], [chatbot, msg, last_result]) + clear.click(lambda: ([], None), None, [chatbot, last_result]) + v_btn.click(verify_direct, [v_q, v_cfg], [v_md, v_df, last_result]) + v_last.click(show_last, last_result, [v_md, v_df]) + c_btn.click(compare, c_q, [c_a, c_b, c_pa, c_pb, c_perf]) + eval_outs = [e_table, e_info, e_cat, e_err, e_fail] + e_reload.click(load_eval, e_split, eval_outs).then(chart_paths, None, [ch1, ch2, ch3, ch4, ch5, ch6]) + e_split.change(load_eval, e_split, eval_outs) + e_run.click(rerun_eval, e_split, [e_status, *eval_outs, ch1, ch2, ch3, ch4, ch5, ch6]) + demo.load(load_eval, e_split, eval_outs).then(chart_paths, None, [ch1, ch2, ch3, ch4, ch5, ch6]) + + +if __name__ == "__main__": + demo.queue(default_concurrency_limit=2).launch( + server_name="0.0.0.0", server_port=int(__import__("os").getenv("PORT", 7860)), + theme=gr.themes.Soft(primary_hue="blue"), css=CSS, show_error=True, allowed_paths=[str(ASSETS), str(config.CHARTS_DIR)]) diff --git a/assets/architecture.png b/assets/architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..456cb598b9e7d0657b7089775c791cdfdb1b53e2 --- /dev/null +++ b/assets/architecture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60157a386c610c1abee3bf190971b37265ee2d6e345a7d70d3239fa206f49cba +size 219921 diff --git a/assets/workflow.png b/assets/workflow.png new file mode 100644 index 0000000000000000000000000000000000000000..12f98e3a7aee5cb805970fe191478aee720f6584 --- /dev/null +++ b/assets/workflow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b853e69092c8c68bd00a1f5236424d29c78a88d7dfd7ecf90da56f207a974398 +size 157461 diff --git a/config.py b/config.py new file mode 100644 index 0000000000000000000000000000000000000000..d39c0922fd2a2af6fb7a90143673f7f64ee122bc --- /dev/null +++ b/config.py @@ -0,0 +1,104 @@ +""" +Central configuration for EvidenceGuard AI. + +Every value can be overridden with an environment variable (or a Hugging Face Space +secret/variable) of the same name. No credentials are stored in code. + +Backends +-------- +EG_BACKEND = "auto" | "full" | "lite" + full : Hugging Face models (Sentence Transformer, cross-encoder reranker, NLI cross-encoder) + lite : dependency-light, CPU-only fallbacks (TF-IDF+SVD embeddings, lexical reranker, + rule-based numeric/negation contradiction detector). Used when models cannot be + downloaded (offline machines) and for fast tests. + auto : try "full", fall back to "lite" component-by-component if a model cannot load. + +LLM_BACKEND = "auto" | "hf_api" | "local" | "extractive" + hf_api : Hugging Face Inference Providers via huggingface_hub (needs HF_TOKEN secret) + local : small instruction-tuned model run locally with transformers (CPU OK) + extractive : no LLM; answer is composed from retrieved sentences (fully offline) + auto : hf_api if HF_TOKEN is set, else local, else extractive +""" +from __future__ import annotations + +import os +from pathlib import Path + +ROOT = Path(__file__).resolve().parent +SAMPLE_DATA_DIR = ROOT / "sample_data" +EVAL_DATA_PATH = ROOT / "evaluation_data" / "questions.json" +RESULTS_DIR = ROOT / "results" +CHARTS_DIR = RESULTS_DIR / "charts" +CACHE_DIR = Path(os.getenv("EG_CACHE_DIR", str(ROOT / ".cache"))) +UPLOAD_DIR = CACHE_DIR / "uploads" + + +def _env(name: str, default): + v = os.getenv(name) + if v is None or v == "": + return default + return type(default)(v) if not isinstance(default, bool) else v.lower() in {"1", "true", "yes"} + + +# ---------------------------------------------------------------- backends +EG_BACKEND = _env("EG_BACKEND", "auto") +LLM_BACKEND = _env("LLM_BACKEND", "auto") + +# ---------------------------------------------------------------- models (all free / open licences) +EMBEDDING_MODEL = _env("EMBEDDING_MODEL", "sentence-transformers/all-MiniLM-L6-v2") +RERANKER_MODEL = _env("RERANKER_MODEL", "cross-encoder/ms-marco-MiniLM-L-6-v2") +NLI_MODEL = _env("NLI_MODEL", "cross-encoder/nli-deberta-v3-xsmall") +LOCAL_LLM_MODEL = _env("LOCAL_LLM_MODEL", "Qwen/Qwen2.5-0.5B-Instruct") +HF_API_MODEL = _env("HF_API_MODEL", "Qwen/Qwen2.5-7B-Instruct") +HF_TOKEN = os.getenv("HF_TOKEN") or os.getenv("HUGGINGFACEHUB_API_TOKEN") # Space secret, never hard-coded + +# ---------------------------------------------------------------- chunking & retrieval +CHUNK_TARGET_WORDS = _env("CHUNK_TARGET_WORDS", 70) +CHUNK_OVERLAP_SENTENCES = _env("CHUNK_OVERLAP_SENTENCES", 1) +TOP_K = _env("TOP_K", 5) # passages given to the generator +CANDIDATES = _env("CANDIDATES", 20) # candidates pulled by each retriever before fusion/reranking +RRF_K = _env("RRF_K", 60) +LSA_DIM = _env("LSA_DIM", 256) + +# ---------------------------------------------------------------- generation +MAX_NEW_TOKENS = _env("MAX_NEW_TOKENS", 220) +TEMPERATURE = _env("TEMPERATURE", 0.0) + +# ---------------------------------------------------------------- verification thresholds +# Default values; scripts/run_evaluation.py re-calibrates them on a held-out DEV split +# and writes results/calibrated_thresholds.json, which is loaded automatically if present. +THRESHOLDS = { + "min_relevance": _env("MIN_RELEVANCE", 0.30), # reranker score of best passage + "min_coverage": _env("MIN_COVERAGE", 0.60), # IDF-weighted query-term coverage + "partial_coverage": _env("PARTIAL_COVERAGE", 0.45), + "min_confidence": _env("MIN_CONFIDENCE", 0.40), + "conflict_topic_sim": _env("CONFLICT_TOPIC_SIM", 0.30), # overlap coefficient (polarity/NLI) + "conflict_sentence_coverage": _env("CONFLICT_SENT_COV", 0.35), # sentence must cover the question + "conflict_min_shared": _env("CONFLICT_MIN_SHARED", 2), # shared context words around a value + "conflict_subject_mismatch": _env("CONFLICT_SUBJECT_MISMATCH", 0.30), # max weight of unshared question words + "conflict_min_relevance": _env("CONFLICT_MIN_RELEVANCE", 0.25), + "nli_contradiction": _env("NLI_CONTRADICTION", 0.60), + "nli_entailment": _env("NLI_ENTAILMENT", 0.50), + "citation_overlap": _env("CITATION_OVERLAP", 0.50), +} + +CALIBRATED_THRESHOLDS_PATH = RESULTS_DIR / "calibrated_thresholds.json" + + +def load_thresholds(effective_backend: str = "lite") -> dict: + """Defaults, overridden by calibrated values only if they were calibrated for the same backend + (reranker scores of the lexical fallback and of the cross-encoder live on different scales).""" + import json + th = dict(THRESHOLDS) + if CALIBRATED_THRESHOLDS_PATH.exists() and not os.getenv("EG_IGNORE_CALIBRATION"): + try: + cal = json.loads(CALIBRATED_THRESHOLDS_PATH.read_text()) + if cal.get("backend") == effective_backend: + th.update(cal.get("thresholds", {})) + except Exception: + pass + return th + + +for _d in (CACHE_DIR, UPLOAD_DIR, CHARTS_DIR): + _d.mkdir(parents=True, exist_ok=True) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..4c3643ba52caa26beb59bdb6df2f6c116a2cdefb --- /dev/null +++ b/requirements.txt @@ -0,0 +1,19 @@ +# CPU-only PyTorch wheels (much smaller than the default CUDA build) - works on free HF Spaces +--extra-index-url https://download.pytorch.org/whl/cpu + +gradio>=6.0 +numpy>=1.26 +pandas>=2.0 +scikit-learn>=1.3 +faiss-cpu>=1.8 +rank-bm25>=0.2.2 +pymupdf>=1.24 +pypdf>=4.0 +reportlab>=4.0 +matplotlib>=3.8 + +# Hugging Face model stack (optional at runtime - the app falls back to offline components if missing) +torch>=2.2 +transformers>=4.44 +sentence-transformers>=3.0 +huggingface_hub>=0.24 diff --git a/results/calibrated_thresholds.json b/results/calibrated_thresholds.json new file mode 100644 index 0000000000000000000000000000000000000000..0813cef01c51ed097e404ed0c0ba3035b29ba69d --- /dev/null +++ b/results/calibrated_thresholds.json @@ -0,0 +1,51 @@ +{ + "backend": "lite", + "thresholds": { + "min_relevance": 0.15, + "min_coverage": 0.6, + "partial_coverage": 0.5, + "min_confidence": 0.3, + "conflict_topic_sim": 0.3, + "conflict_sentence_coverage": 0.35, + "conflict_min_shared": 2, + "conflict_subject_mismatch": 0.3, + "conflict_min_relevance": 0.25, + "nli_contradiction": 0.6, + "nli_entailment": 0.5, + "citation_overlap": 0.5 + }, + "dev_ids": [ + "A06", + "A07", + "A11", + "A12", + "A13", + "A15", + "A20", + "A23", + "A27", + "C08", + "C11", + "C12", + "C13", + "C16", + "C20", + "I03", + "I08", + "I10", + "I12", + "M03", + "M10", + "M12", + "M13", + "M14", + "M15", + "N01", + "N09", + "N11", + "N15" + ], + "dev_behaviour_accuracy": 0.7931, + "dev_abstention_accuracy": 0.8966, + "dev_unsupported_rate": 0.069 +} \ No newline at end of file diff --git a/results/category_breakdown.csv b/results/category_breakdown.csv new file mode 100644 index 0000000000000000000000000000000000000000..7facf8997e737f3b6249fb6b2a4999c55f2e15e8 --- /dev/null +++ b/results/category_breakdown.csv @@ -0,0 +1,21 @@ +configuration,category,n,answer_correctness,behaviour_accuracy,unsupported_rate,abstention_rate +Baseline RAG,answerable,30,1.0,1.0,0.0,0.0 +Baseline RAG,conflicting,20,0.1,0.0,0.05,0.0 +Baseline RAG,misleading,15,0.8,0.8,0.1333,0.0 +Baseline RAG,missing,15,0.0,0.0,1.0,0.0 +Baseline RAG,multi_passage,20,0.65,0.65,0.05,0.0 ++ Reranking,answerable,30,1.0,1.0,0.0,0.0 ++ Reranking,conflicting,20,0.1,0.0,0.05,0.0 ++ Reranking,misleading,15,0.8,0.8,0.1333,0.0 ++ Reranking,missing,15,0.0,0.0,1.0,0.0 ++ Reranking,multi_passage,20,0.6,0.6,0.1,0.0 ++ Verification,answerable,30,0.9,0.9,0.0,0.1 ++ Verification,conflicting,20,0.65,0.65,0.05,0.2 ++ Verification,misleading,15,0.7333,0.7333,0.1333,0.1333 ++ Verification,missing,15,0.8,0.8,0.2,0.8 ++ Verification,multi_passage,20,0.5,0.5,0.15,0.25 +EvidenceGuard,answerable,30,0.9,0.9,0.0,0.1 +EvidenceGuard,conflicting,20,0.65,0.65,0.05,0.2 +EvidenceGuard,misleading,15,0.7333,0.7333,0.1333,0.1333 +EvidenceGuard,missing,15,0.8,0.8,0.2,0.8 +EvidenceGuard,multi_passage,20,0.5,0.5,0.15,0.25 diff --git a/results/charts/answer_quality_comparison.png b/results/charts/answer_quality_comparison.png new file mode 100644 index 0000000000000000000000000000000000000000..48bc2af7d47523fc61565f1788ff307dc98ec7b7 Binary files /dev/null and b/results/charts/answer_quality_comparison.png differ diff --git a/results/charts/category_breakdown.png b/results/charts/category_breakdown.png new file mode 100644 index 0000000000000000000000000000000000000000..bf16bc5776a9b8ede18b6049b9b726ba9efbad9b Binary files /dev/null and b/results/charts/category_breakdown.png differ diff --git a/results/charts/error_analysis.png b/results/charts/error_analysis.png new file mode 100644 index 0000000000000000000000000000000000000000..03a6d823f8fc84ef7db996ba3004f3e5628bd2fa Binary files /dev/null and b/results/charts/error_analysis.png differ diff --git a/results/charts/reliability_comparison.png b/results/charts/reliability_comparison.png new file mode 100644 index 0000000000000000000000000000000000000000..0e74e7e36847a748e3e8efd00660e910e4a7fa86 Binary files /dev/null and b/results/charts/reliability_comparison.png differ diff --git a/results/charts/response_time.png b/results/charts/response_time.png new file mode 100644 index 0000000000000000000000000000000000000000..e9691b7530732f2af84215522d1da3316e048267 Binary files /dev/null and b/results/charts/response_time.png differ diff --git a/results/charts/retrieval_comparison.png b/results/charts/retrieval_comparison.png new file mode 100644 index 0000000000000000000000000000000000000000..51f281b55576d16110280b3bbbbfe7b9d3c8f546 Binary files /dev/null and b/results/charts/retrieval_comparison.png differ diff --git a/results/error_analysis.csv b/results/error_analysis.csv new file mode 100644 index 0000000000000000000000000000000000000000..7ec817c5ab0ce88e8bda5cc0b3621fae21b8064b --- /dev/null +++ b/results/error_analysis.csv @@ -0,0 +1,7 @@ +error_type,Baseline RAG,+ Reranking,+ Verification,EvidenceGuard +answered unanswerable question (hallucination risk),15,15,3,3 +correct,55,54,73,73 +incomplete answer (some key facts missing),7,7,2,2 +missed conflict,20,20,3,3 +over-abstention (answer was available),0,0,14,14 +wrong/irrelevant answer content,3,4,5,5 diff --git a/results/failure_cases.json b/results/failure_cases.json new file mode 100644 index 0000000000000000000000000000000000000000..4680daffc6691935cb91af3786f309d9ca782874 --- /dev/null +++ b/results/failure_cases.json @@ -0,0 +1,584 @@ +{ + "evidenceguard_failures": [ + { + "id": "A10", + "category": "answerable", + "question": "What are the timings of the afternoon examination session?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "2:00 PM to 5:00 PM.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.53, query coverage 0.58; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: timings.", + "retrieved": "D06 p.2; D06 p.1; D06 p.1; D06 p.1; D06 p.2", + "baseline_answer": "Afternoon session: 2:00 PM to 5:00 PM. [3]", + "baseline_ok": true + }, + { + "id": "A17", + "category": "answerable", + "question": "What is the amount of the need-based scholarship?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "INR 30,000 per year.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.50, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: amount.", + "retrieved": "D07 p.1; D08 p.1; D07 p.1; D07 p.2; D08 p.1", + "baseline_answer": "A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1]", + "baseline_ok": true + }, + { + "id": "A24", + "category": "answerable", + "question": "How far in advance must an application for academic leave be submitted?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "At least 30 days before the start of the semester (except medical emergencies).", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.28, query coverage 0.50; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: far, advance.", + "retrieved": "D10 p.1; D10 p.1; D07 p.1; D10 p.2; D10 p.1", + "baseline_answer": "Applications must be submitted to the Dean of Academics at least 30 days before the start of the semester, except in medical emergencies. [1] Students may avail maternity leave of up to 6 months, which is counted within the academic leave limit. [1]", + "baseline_ok": true + }, + { + "id": "M01", + "category": "multi_passage", + "question": "What minimum internal assessment marks are needed for exam eligibility, and how many marks is each internal test worth?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "At least 16 out of 40 IA marks (40%); each internal test is worth 15 marks.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.49; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: minimum, exam, worth.", + "retrieved": "D04 p.1; D03 p.1; D04 p.1; D04 p.2; D04 p.1", + "baseline_answer": "Internal assessment consists of Internal Test 1 (15 marks), Internal Test 2 (15 marks), Assignment (5 marks), and Class participation and quizzes (5 marks). [1]", + "baseline_ok": false + }, + { + "id": "M02", + "category": "multi_passage", + "question": "When is Internal Test 1 held this semester, and what must a student do to take a make-up test if they miss it through illness?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "1-5 September 2025; submit a medical certificate within 3 working days to take one make-up test.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.33, query coverage 0.56; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: held, through, illness.", + "retrieved": "D04 p.1; D04 p.1; D04 p.1; D14 p.1; D14 p.1", + "baseline_answer": "A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]", + "baseline_ok": false + }, + { + "id": "M03", + "category": "multi_passage", + "question": "What happens to a student whose attendance is still short after condonation, and to whom can an eligibility decision be appealed?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "They are marked NE (Not Eligible) and must re-register; appeals go to the Controller of Examinations within 3 working days.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.19, query coverage 0.42; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: happens, still, short.", + "retrieved": "D03 p.2; D02 p.1; D01 p.1; D03 p.1; D01 p.1", + "baseline_answer": "A student may appeal against an eligibility decision to the Controller of Examinations within 3 working days of the publication of the eligibility list. [1]", + "baseline_ok": false + }, + { + "id": "M08", + "category": "multi_passage", + "question": "How many internal assessment marks are given for assignments, and in what file format must assignments be submitted?", + "expected_behaviour": "answer", + "error_type": "wrong/irrelevant answer content", + "decision": "conflict", + "answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [1]\n- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [2]\nThe more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** IA marks are published on AVU-Learn within 10 working days of each test. [1]", + "expected_answer": "5 marks; as a single PDF file (max 10 MB).", + "explanation": "Answered with a conflict warning: 'Internal Assessment Guidelines 2024' and 'Assignment Submission Policy 2024' disagree (one passage permits what the other rules out).", + "retrieved": "D04 p.2; D05 p.1; D05 p.1; D04 p.1; D04 p.1; D14 p.1", + "baseline_answer": "Assignments submitted after the deadline will not be accepted for internal assessment. [1] IA marks are published on AVU-Learn within 10 working days of each test. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [2]", + "baseline_ok": false + }, + { + "id": "M11", + "category": "multi_passage", + "question": "What documents must be submitted for the need-based scholarship, and how recent must the income certificate be?", + "expected_behaviour": "answer", + "error_type": "wrong/irrelevant answer content", + "decision": "conflict", + "answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Scholarship Policy 2025-26* (issued 2025-05-01): A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1]\n- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The family income ceiling for the need-based scholarship is revised to INR 8,00,000. [2]\nThe more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [5]", + "expected_answer": "An income certificate from a competent authority issued within the last 6 months, and the previous year's marks card.", + "explanation": "Answered with a conflict warning: 'Scholarship Policy 2025-26' and 'Notice: Revision of Scholarship Deadline and Income Ceiling' disagree (inr: 600000 vs 800000 (context: family, income)).", + "retrieved": "D07 p.1; D08 p.1; D07 p.1; D08 p.1; D04 p.1", + "baseline_answer": "A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1] Applications must be submitted on AVU-Learn by 31 August 2025. [1] Applicants must submit an income certificate issued by a competent authority within the last 6 months and the marks card of the previous year. [1]", + "baseline_ok": true + }, + { + "id": "M12", + "category": "multi_passage", + "question": "If a student qualifies for both the merit and need-based scholarships, what do they receive, and what is needed to renew it?", + "expected_behaviour": "answer", + "error_type": "incomplete answer (some key facts missing)", + "decision": "answered", + "answer": "Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [5]", + "expected_answer": "Only the higher-value scholarship; renewal needs a CGPA of at least 8.0 and no disciplinary action.", + "explanation": "Answered: relevance 0.34, coverage 0.68, 3/3 sentences verified against their citations.", + "retrieved": "D07 p.1; D07 p.2; D07 p.2; D05 p.1; D07 p.1", + "baseline_answer": "Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [3]", + "baseline_ok": false + }, + { + "id": "M16", + "category": "multi_passage", + "question": "Which MSc Data Science Semester 3 examination is held in the afternoon session, and what are the afternoon session timings?", + "expected_behaviour": "answer", + "error_type": "incomplete answer (some key facts missing)", + "decision": "answered", + "answer": "10 December 2025 (Wednesday): MDS305 Security for Data Science - Afternoon session. [2] MSc Data Science - Semester 3. [1] Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [5]", + "expected_answer": "MDS305 Security for Data Science on 10 December 2025; 2:00 PM to 5:00 PM.", + "explanation": "Answered: relevance 0.50, coverage 0.62, 3/3 sentences verified against their citations.", + "retrieved": "D06 p.1; D06 p.1; D06 p.2; D06 p.1; D13 p.2", + "baseline_answer": "10 December 2025 (Wednesday): MDS305 Security for Data Science - Afternoon session. [2] MSc Data Science - Semester 3. [1]", + "baseline_ok": false + }, + { + "id": "M18", + "category": "multi_passage", + "question": "How many backlog courses prevent promotion to the next year, and when can backlogs be cleared through supplementary examinations?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "More than 4 backlog courses; supplementary exams are held in June and July.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.52; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: prevent, promotion, through.", + "retrieved": "D13 p.2; D03 p.2; D03 p.2; D11 p.2; D03 p.1", + "baseline_answer": "A student with more than 4 backlog courses at the end of an academic year will not be promoted to the next year. [1] Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1] Library dues do not affect examination eligibility but must be cleared before results are released. [2]", + "baseline_ok": true + }, + { + "id": "M19", + "category": "multi_passage", + "question": "How is participation in university-approved events treated for attendance, and who must approve it?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "Counted as present for up to 10 contact hours per semester with prior approval of the Head of Department.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.49, query coverage 0.56; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: treated, approve.", + "retrieved": "D01 p.2; D04 p.1; D04 p.1; D01 p.1; D02 p.1", + "baseline_answer": "Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1]", + "baseline_ok": true + }, + { + "id": "M20", + "category": "multi_passage", + "question": "A student returning from academic leave must re-register within which window, and what are the regular odd semester registration dates?", + "expected_behaviour": "answer", + "error_type": "wrong/irrelevant answer content", + "decision": "answered", + "answer": "Students returning from leave must re-register within the regular registration window. [1] Key Dates - Odd Semester 2025-26. [4]", + "expected_answer": "Within the regular registration window: 1 July 2025 to 15 July 2025.", + "explanation": "Answered: relevance 0.64, coverage 0.84, 2/2 sentences verified against their citations.", + "retrieved": "D10 p.2; D10 p.2; D09 p.1; D14 p.1; D10 p.1", + "baseline_answer": "Students returning from leave must re-register within the regular registration window. [1] Key Dates - Odd Semester 2025-26. [5]", + "baseline_ok": false + }, + { + "id": "N09", + "category": "missing", + "question": "What is the fee for a duplicate hall ticket?", + "expected_behaviour": "abstain", + "error_type": "answered unanswerable question (hallucination risk)", + "decision": "answered", + "answer": "Hall tickets are issued through the AVU-Learn portal 5 days before the first examination. [1] (c) The student must have no outstanding tuition fee dues. [1]", + "expected_answer": "The documents do not contain this information; the system should abstain.", + "explanation": "Answered: relevance 0.57, coverage 0.65, 2/2 sentences verified against their citations.", + "retrieved": "D03 p.1; D06 p.2; D07 p.1; D01 p.1; D03 p.1; D05 p.1", + "baseline_answer": "Hall tickets are issued through the AVU-Learn portal 5 days before the first examination. [1] (c) The student must have no outstanding tuition fee dues. [1]", + "baseline_ok": false + }, + { + "id": "N13", + "category": "missing", + "question": "What is the late fine for paying tuition fees after the due date?", + "expected_behaviour": "abstain", + "error_type": "answered unanswerable question (hallucination risk)", + "decision": "answered", + "answer": "Late payment of hostel dues attracts a fine of INR 500. [1] Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [4] Instructors must announce assignment topics at least two weeks before the due date. [2]", + "expected_answer": "The documents do not contain this information; the system should abstain.", + "explanation": "Answered: relevance 0.30, coverage 0.62, 3/3 sentences verified against their citations.", + "retrieved": "D16 p.1; D04 p.2; D05 p.1; D10 p.2; D09 p.1; D05 p.1", + "baseline_answer": "Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [1] Late payment of hostel dues attracts a fine of INR 500. [2]", + "baseline_ok": false + }, + { + "id": "N15", + "category": "missing", + "question": "What is the timetable for the even semester examinations in May 2026?", + "expected_behaviour": "abstain", + "error_type": "answered unanswerable question (hallucination risk)", + "decision": "answered", + "answer": "Even semester classes begin on 5 January 2026. [2] Only non-programmable scientific calculators are permitted in the examination hall. [1]", + "expected_answer": "The documents do not contain this information; the system should abstain.", + "explanation": "Answered: relevance 0.52, coverage 0.83, 2/2 sentences verified against their citations.", + "retrieved": "D06 p.2; D14 p.2; D06 p.1; D06 p.1; D06 p.1; D14 p.1", + "baseline_answer": "Even semester classes begin on 5 January 2026. [3] Only non-programmable scientific calculators are permitted in the examination hall. [1]", + "baseline_ok": false + }, + { + "id": "I05", + "category": "misleading", + "question": "Given that academic leave can be taken for up to four semesters, how early must a student apply?", + "expected_behaviour": "correct_premise", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "Academic leave is limited to two semesters; apply at least 30 days before the semester.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.35; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: taken, four, early.", + "retrieved": "D10 p.1; D10 p.2; D10 p.1; D10 p.1; D10 p.2", + "baseline_answer": "A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1]", + "baseline_ok": false + }, + { + "id": "I06", + "category": "misleading", + "question": "As the MDS301 Deep Learning exam is in the afternoon session, what time does it start?", + "expected_behaviour": "correct_premise", + "error_type": "wrong/irrelevant answer content", + "decision": "answered", + "answer": "01 December 2025 (Monday): MDS301 Deep Learning - Morning session. [1]", + "expected_answer": "It is in the morning session (01 December 2025), which starts at 10:00 AM.", + "explanation": "Answered: relevance 0.53, coverage 0.73, 1/1 sentences verified against their citations.", + "retrieved": "D06 p.1; D06 p.1; D06 p.2; D06 p.1; D07 p.2", + "baseline_answer": "01 December 2025 (Monday): MDS301 Deep Learning - Morning session. [1]", + "baseline_ok": false + }, + { + "id": "I13", + "category": "misleading", + "question": "What is the minimum CGPA for First Class (without distinction)?", + "expected_behaviour": "answer", + "error_type": "wrong/irrelevant answer content", + "decision": "answered", + "answer": "First Class with Distinction is awarded for a CGPA of 8.0 or above. [1] Scholarship holders must maintain a minimum of 75% attendance in every course. [3]", + "expected_answer": "6.5 (First Class is CGPA 6.5 to 7.99).", + "explanation": "Answered: relevance 0.52, coverage 0.68, 2/2 sentences verified against their citations.", + "retrieved": "D13 p.2; D13 p.2; D07 p.2; D03 p.1; D01 p.1", + "baseline_answer": "First Class with Distinction is awarded for a CGPA of 8.0 or above. [1] Scholarship holders must maintain a minimum of 75% attendance in every course. [3]", + "baseline_ok": false + }, + { + "id": "I15", + "category": "misleading", + "question": "Is a calculator with programmable memory allowed in the examination hall?", + "expected_behaviour": "answer", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "No - only non-programmable scientific calculators are permitted.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.22, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: programmable, memory.", + "retrieved": "D06 p.2; D03 p.1; D03 p.1; D06 p.1; D03 p.1", + "baseline_answer": "Only non-programmable scientific calculators are permitted in the examination hall. [2]", + "baseline_ok": true + }, + { + "id": "C02", + "category": "conflicting", + "question": "Up to what percentage can an attendance shortage be condoned on medical grounds?", + "expected_behaviour": "flag_conflict", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "Conflict: 10% under the 2023 regulations; limited to 5% by the 2025 circular.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.43, query coverage 0.50; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: percentage, condoned.", + "retrieved": "D01 p.1; D01 p.1; D02 p.1; D02 p.1; D01 p.1", + "baseline_answer": "The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]", + "baseline_ok": false + }, + { + "id": "C04", + "category": "conflicting", + "question": "According to the examination eligibility rules, what attendance is needed in a course to sit its end-semester exam?", + "expected_behaviour": "flag_conflict", + "error_type": "missed conflict", + "decision": "answered", + "answer": "These rules determine whether a student may appear for the end-semester examination of a course. [1] A student may appeal against an eligibility decision to the Controller of Examinations within 3 working days of the publication of the eligibility list. [4]", + "expected_answer": "Conflict: the eligibility rules (2024) state 75%, but the 2025 circular raises the requirement to 80%.", + "explanation": "Answered: relevance 0.49, coverage 0.62, 2/2 sentences verified against their citations.", + "retrieved": "D03 p.1; D03 p.1; D06 p.1; D03 p.2; D01 p.1", + "baseline_answer": "These rules determine whether a student may appear for the end-semester examination of a course. [1] Students declared not eligible must re-register for the course when it is next offered and satisfy all eligibility conditions afresh. [2]", + "baseline_ok": false + }, + { + "id": "C16", + "category": "conflicting", + "question": "If my attendance in a course is 78%, am I eligible for the end-semester examination?", + "expected_behaviour": "flag_conflict", + "error_type": "missed conflict", + "decision": "partial", + "answer": "A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [2]", + "expected_answer": "Conflict: eligible under the 2023 rule (75%), but below the 80% minimum under the 2025 circular (condonable between 75% and 80%).", + "explanation": "Partially answered: query coverage 0.56; not covered: 78%.", + "retrieved": "D03 p.1; D01 p.1; D01 p.1; D03 p.1; D01 p.2; D03 p.2", + "baseline_answer": "A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1]", + "baseline_ok": false + }, + { + "id": "C17", + "category": "conflicting", + "question": "If a PG student scores 45% in aggregate in a course, do they pass?", + "expected_behaviour": "flag_conflict", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "Conflict: pass under the Grading Policy (40%), fail under the PG Handbook (50%).", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.41, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: scores, 45%.", + "retrieved": "D15 p.1; D15 p.1; D13 p.1; D13 p.1; D09 p.1", + "baseline_answer": "PG students must obtain at least 50% marks in aggregate to pass a course. [1]", + "baseline_ok": false + }, + { + "id": "C18", + "category": "conflicting", + "question": "What is the lowest attendance percentage that can be condoned on medical grounds?", + "expected_behaviour": "flag_conflict", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "Conflict: 65% under the 2023 regulations vs 75% under the 2025 circular.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.27, query coverage 0.30; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: lowest, percentage, condoned.", + "retrieved": "D01 p.1; D02 p.1; D02 p.1; D01 p.1; D01 p.1", + "baseline_answer": "The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2]", + "baseline_ok": false + }, + { + "id": "C19", + "category": "conflicting", + "question": "Which attendance rule is the latest, and what minimum attendance does it require?", + "expected_behaviour": "flag_conflict", + "error_type": "over-abstention (answer was available)", + "decision": "abstained", + "answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "expected_answer": "Conflict: the 2025 circular (latest) requires 80%, superseding the 75% of the 2023 regulations.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.38, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: latest.", + "retrieved": "D01 p.1; D02 p.1; D01 p.1; D07 p.2; D09 p.1", + "baseline_answer": "A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1]", + "baseline_ok": false + }, + { + "id": "C20", + "category": "conflicting", + "question": "According to the academic calendar, what is the scholarship application deadline, and has it changed?", + "expected_behaviour": "flag_conflict", + "error_type": "missed conflict", + "decision": "answered", + "answer": "Last date for scholarship applications: 31 August 2025. [1] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [3]", + "expected_answer": "Conflict: the calendar says 31 August 2025, but the notice extends it to 15 September 2025.", + "explanation": "Answered: relevance 0.31, coverage 0.64, 2/2 sentences verified against their citations.", + "retrieved": "D14 p.1; D07 p.1; D05 p.1; D08 p.1; D08 p.1", + "baseline_answer": "Last date for scholarship applications: 31 August 2025. [1]", + "baseline_ok": false + } + ], + "evidenceguard_fixes_over_baseline": [ + { + "id": "N01", + "category": "missing", + "question": "What is the fee for revaluation of answer scripts?", + "baseline_answer": "Answer scripts of internal tests are retained by the department for one year. [1] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [2]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.45, query coverage 0.60; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: revaluation." + }, + { + "id": "N02", + "category": "missing", + "question": "Who is the current Vice-Chancellor of Aranya Valley University?", + "baseline_answer": "Students returning from leave must re-register within the regular registration window. [1]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.31, query coverage 0.41; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: vice-chancellor." + }, + { + "id": "N03", + "category": "missing", + "question": "What is the annual hostel fee for PhD students?", + "baseline_answer": "Late payment of hostel dues attracts a fine of INR 500. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [3] The mess fee is INR 4,500 per month, payable by the 10th of each month. [1]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.30, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: phd." + }, + { + "id": "N04", + "category": "missing", + "question": "Does the university offer a sports quota scholarship?", + "baseline_answer": "Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [5] All other conditions of the Scholarship Policy 2025-26 remain unchanged. [1]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.19, query coverage 0.36; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: offer, quota." + }, + { + "id": "N05", + "category": "missing", + "question": "What is the dress code during end-semester examinations?", + "baseline_answer": "End-semester examinations: from 3 December 2025. [1]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.26, query coverage 0.22; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: dress, code." + }, + { + "id": "N06", + "category": "missing", + "question": "Can students take the end-semester examinations online from home?", + "baseline_answer": "The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.20, query coverage 0.17; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: take, online, home." + }, + { + "id": "N07", + "category": "missing", + "question": "What minimum CGPA is required to sit for campus placements?", + "baseline_answer": "Campus Wi-Fi is available to residents with a daily limit of 5 GB. [1] First Class is awarded for a CGPA from 6.5 to 7.99. [2] Scholarship holders must maintain a minimum of 75% attendance in every course. [3]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.22, query coverage 0.36; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: sit, placements." + }, + { + "id": "N08", + "category": "missing", + "question": "How many total credits are required to graduate from the MSc Data Science programme?", + "baseline_answer": "MSc Data Science - Semester 3. [1] The PG dissertation carries 12 credits and is evaluated by an internal guide and an external examiner. [3]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: total, graduate." + }, + { + "id": "N10", + "category": "missing", + "question": "On what date will the 2026 convocation ceremony be held?", + "baseline_answer": "Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1] Instructors must announce assignment topics at least two weeks before the due date. [4]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.15, query coverage 0.28; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: date, convocation, ceremony." + }, + { + "id": "N11", + "category": "missing", + "question": "What is the university policy on using generative AI tools such as ChatGPT in assignments?", + "baseline_answer": "03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session. [1] Subscribed e-journals can be accessed off campus through the library remote access service using university credentials. [2]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.28, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: tools, chatgpt." + }, + { + "id": "N12", + "category": "missing", + "question": "What is the parking fee for students' two-wheelers on campus?", + "baseline_answer": "The mess fee is INR 4,500 per month, payable by the 10th of each month. [2] Campus Wi-Fi is available to residents with a daily limit of 5 GB. [1]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.25, query coverage 0.33; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: parking, two-wheelers." + }, + { + "id": "N14", + "category": "missing", + "question": "Does the university offer a tuition fee concession for siblings?", + "baseline_answer": "Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [4]", + "evidenceguard_answer": "I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.", + "explanation": "Abstained: evidence is insufficient (best passage relevance 0.24, query coverage 0.27; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: offer, concession, siblings." + }, + { + "id": "C01", + "category": "conflicting", + "question": "What is the minimum attendance required to appear for end-semester examinations?", + "baseline_answer": "A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Attendance Regulations 2023* (issued 2023-06-15): A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1]\n- *Circular: Amendment to Attendance Regulations* (issued 2025-06-02): With effect from the academic year 2025-26, the minimum attendance requirement for each course is revised to 80%. [5]\nThe more recent document is *Circular: Amendment to Attendance Regulations*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.", + "explanation": "Answered with a conflict warning: 'Attendance Regulations 2023' and 'Circular: Amendment to Attendance Regulations' disagree (%: 75 vs 80 (context: attendance, minimum))." + }, + { + "id": "C03", + "category": "conflicting", + "question": "What is the condonation fee per course for attendance shortage?", + "baseline_answer": "A condonation fee of INR 500 per course is payable before the condonation order is issued. [1] The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Attendance Regulations 2023* (issued 2023-06-15): A condonation fee of INR 500 per course is payable before the condonation order is issued. [1]\n- *Circular: Amendment to Attendance Regulations* (issued 2025-06-02): The condonation fee is revised to INR 1,000 per course. [4]\nThe more recent document is *Circular: Amendment to Attendance Regulations*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]", + "explanation": "Answered with a conflict warning: 'Attendance Regulations 2023' and 'Circular: Amendment to Attendance Regulations' disagree (inr: 500 vs 1000 (context: condonation, fee))." + }, + { + "id": "C05", + "category": "conflicting", + "question": "What is the last date to apply for a scholarship for 2025-26?", + "baseline_answer": "The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [1]\n- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Last date for scholarship applications: 31 August 2025. [2]\nThe more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.", + "explanation": "Answered with a conflict warning: 'Notice: Revision of Scholarship Deadline and Income Ceiling' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (date: 15 september 2025 vs 31 august 2025 (context: application, date, last, scholarship))." + }, + { + "id": "C06", + "category": "conflicting", + "question": "What is the family income limit for the need-based scholarship?", + "baseline_answer": "A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The family income ceiling for the need-based scholarship is revised to INR 8,00,000. [1]\n- *Scholarship Policy 2025-26* (issued 2025-05-01): A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [2]\nThe more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Students may avail maternity leave of up to 6 months, which is counted within the academic leave limit. [5]", + "explanation": "Answered with a conflict warning: 'Notice: Revision of Scholarship Deadline and Income Ceiling' and 'Scholarship Policy 2025-26' disagree (inr: 800000 vs 600000 (context: family, income))." + }, + { + "id": "C07", + "category": "conflicting", + "question": "Are late assignment submissions accepted?", + "baseline_answer": "Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1]\n- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [3]\nThe more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Assignments must be submitted as a single PDF file of no more than 10 MB. [1]", + "explanation": "Answered with a conflict warning: 'Assignment Submission Policy 2024' and 'Internal Assessment Guidelines 2024' disagree (one passage permits what the other rules out)." + }, + { + "id": "C08", + "category": "conflicting", + "question": "What is the penalty for submitting an assignment one day late?", + "baseline_answer": "Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1]\n- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [6]\nThe more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Assignments must be submitted as a single PDF file of no more than 10 MB. [1]", + "explanation": "Answered with a conflict warning: 'Assignment Submission Policy 2024' and 'Internal Assessment Guidelines 2024' disagree (one passage permits what the other rules out)." + }, + { + "id": "C09", + "category": "conflicting", + "question": "How many books can a postgraduate student borrow from the library?", + "baseline_answer": "Postgraduate students may borrow up to 5 books for 14 days. [1] Library hours during examination periods are extended until 12:00 midnight on working days. [2]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Central Library Regulations 2023* (issued 2023-07-01): Postgraduate students may borrow up to 5 books for 14 days. [1]\n- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2]\nThe more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Library hours during examination periods are extended until 12:00 midnight on working days. [2]", + "explanation": "Answered with a conflict warning: 'Central Library Regulations 2023' and 'Library Notice: Revised Borrowing Rules' disagree (books: 5 vs 6 (context: borrow, day, postgraduate))." + }, + { + "id": "C10", + "category": "conflicting", + "question": "For how many days can a postgraduate student keep a borrowed library book?", + "baseline_answer": "Postgraduate students may borrow up to 5 books for 14 days. [2] Reference books cannot be borrowed and must be used within the library. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2]\n- *Central Library Regulations 2023* (issued 2023-07-01): Postgraduate students may borrow up to 5 books for 14 days. [3]\nThe more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Reference books cannot be borrowed and must be used within the library. [1]", + "explanation": "Answered with a conflict warning: 'Library Notice: Revised Borrowing Rules' and 'Central Library Regulations 2023' disagree (days: 21 vs 14 (context: book, borrow, postgraduate))." + }, + { + "id": "C11", + "category": "conflicting", + "question": "What is the library overdue fine per book per day?", + "baseline_answer": "An overdue fine of INR 5 per book per day is charged. [1] Reference books cannot be borrowed and must be used within the library. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Central Library Regulations 2023* (issued 2023-07-01): An overdue fine of INR 5 per book per day is charged. [1]\n- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): The overdue fine is revised to INR 10 per book per day. [2]\nThe more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Reference books cannot be borrowed and must be used within the library. [1]", + "explanation": "Answered with a conflict warning: 'Central Library Regulations 2023' and 'Library Notice: Revised Borrowing Rules' disagree (inr: 5 vs 10 (context: book, day, fine, overdue))." + }, + { + "id": "C12", + "category": "conflicting", + "question": "How long is the add/drop period for elective courses?", + "baseline_answer": "Add/drop period for electives: 7 working days from the start of classes. [2]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Course Registration Guidelines 2025* (issued 2025-06-05): Students may add or drop elective courses within 10 working days from the start of classes. [1]\n- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Add/drop period for electives: 7 working days from the start of classes. [2]\nThe more recent document is *Academic Calendar 2025-26 (Odd Semester)*. Please confirm with the issuing office before relying on either version.", + "explanation": "Answered with a conflict warning: 'Course Registration Guidelines 2025' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (working days: 10 vs 7 (context: add, class, drop, elective))." + }, + { + "id": "C13", + "category": "conflicting", + "question": "What minimum aggregate percentage is needed to pass a postgraduate course?", + "baseline_answer": "PG students must obtain at least 50% marks in aggregate to pass a course. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [2]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Postgraduate Programme Handbook 2025-26 (Extract)* (issued 2025-07-05): PG students must obtain at least 50% marks in aggregate to pass a course. [1]\n- *Grading and Academic Progression Policy 2024* (issued 2024-04-02): To pass a course, a student must secure at least 40% marks in aggregate (internal assessment plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60). [4]\nThe more recent document is *Postgraduate Programme Handbook 2025-26 (Extract)*. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [3]", + "explanation": "Answered with a conflict warning: 'Postgraduate Programme Handbook 2025-26 (Extract)' and 'Grading and Academic Progression Policy 2024' disagree (%: 50 vs 40 (context: aggregate, mark, pass))." + }, + { + "id": "C14", + "category": "conflicting", + "question": "On what date do the odd semester end-semester examinations begin?", + "baseline_answer": "The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1] Odd semester classes begin on 21 July 2025. [3] Key Dates - Odd Semester 2025-26. [3]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *End-Semester Examination Timetable - Odd Semester 2025-26* (issued 2025-10-20): The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [2]\n- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): End-semester examinations: from 3 December 2025. [3]\nThe more recent document is *End-Semester Examination Timetable - Odd Semester 2025-26*. Please confirm with the issuing office before relying on either version.\n**Most relevant evidence:** Odd semester classes begin on 21 July 2025. [1] Key Dates - Odd Semester 2025-26. [1]", + "explanation": "Answered with a conflict warning: 'End-Semester Examination Timetable - Odd Semester 2025-26' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (date: 12 december 2025 vs 3 december 2025 (context: end-semester, examination))." + }, + { + "id": "C15", + "category": "conflicting", + "question": "Can I drop an elective course 9 working days after classes start?", + "baseline_answer": "Students may add or drop elective courses within 10 working days from the start of classes. [1]", + "evidenceguard_answer": "\u26a0\ufe0f **Conflicting evidence found.** The documents disagree:\n- *Course Registration Guidelines 2025* (issued 2025-06-05): Students may add or drop elective courses within 10 working days from the start of classes. [1]\n- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Add/drop period for electives: 7 working days from the start of classes. [2]\nThe more recent document is *Academic Calendar 2025-26 (Odd Semester)*. Please confirm with the issuing office before relying on either version.", + "explanation": "Answered with a conflict warning: 'Course Registration Guidelines 2025' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (working days: 10 vs 7 (context: add, class, drop, elective))." + } + ] +} \ No newline at end of file diff --git a/results/metrics.csv b/results/metrics.csv new file mode 100644 index 0000000000000000000000000000000000000000..18162292b02639ff1e0464ffd663099fb8b22ec0 --- /dev/null +++ b/results/metrics.csv @@ -0,0 +1,13 @@ +split,configuration,n_questions,precision_at_k,recall_at_k,mrr,answer_correctness,faithfulness,grounded_faithfulness,answer_relevance,context_precision,context_recall,unsupported_answer_rate,abstention_accuracy,abstention_precision,abstention_recall,abstention_f1,abstention_rate,contradiction_precision,contradiction_recall,contradiction_f1,contradiction_accuracy,citation_support_accuracy,behaviour_accuracy,avg_response_time_s,avg_retrieval_time_s,avg_generation_time_s,avg_verification_time_s +all,Baseline RAG,100,0.4541,0.9647,0.9765,0.57,1.0,0.7567,0.4425,0.9244,0.9765,0.19,0.85,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.8,0.7483,0.55,0.0014,0.0006,0.0007,0.0 +all,+ Reranking,100,0.44,0.9765,0.9588,0.56,1.0,0.735,0.4417,0.9101,0.9824,0.2,0.85,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.8,0.72,0.54,0.0023,0.0017,0.0006,0.0 +all,+ Verification,100,0.4148,0.9765,0.9765,0.73,1.0,0.8311,0.473,0.921,0.9824,0.09,0.83,0.4615,0.8,0.5854,0.26,0.8667,0.65,0.7429,0.91,0.8108,0.73,0.0042,0.001,0.0005,0.0027 +all,EvidenceGuard,100,0.4106,0.9824,0.9588,0.73,1.0,0.8221,0.4744,0.9059,0.9882,0.09,0.83,0.4615,0.8,0.5854,0.26,0.8667,0.65,0.7429,0.91,0.8018,0.73,0.0055,0.0018,0.0005,0.0031 +test,Baseline RAG,71,0.4633,0.975,0.975,0.5634,1.0,0.77,0.4523,0.9279,0.9833,0.2113,0.8451,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.8028,0.7559,0.5352,0.0014,0.0006,0.0007,0.0 +test,+ Reranking,71,0.46,0.9917,0.9583,0.5493,1.0,0.7465,0.4496,0.9154,0.9917,0.2254,0.8451,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.8028,0.73,0.5211,0.0023,0.0017,0.0006,0.0 +test,+ Verification,71,0.4305,0.9833,0.975,0.7042,1.0,0.8576,0.5024,0.9237,0.9833,0.0986,0.8028,0.4348,0.9091,0.5882,0.3239,0.8182,0.6429,0.72,0.9014,0.8264,0.7042,0.004,0.001,0.0005,0.0026 +test,EvidenceGuard,71,0.4347,0.9917,0.9583,0.7042,1.0,0.8438,0.5018,0.915,0.9917,0.0986,0.8028,0.4348,0.9091,0.5882,0.3239,0.8182,0.6429,0.72,0.9014,0.8125,0.7042,0.0052,0.0018,0.0005,0.0029 +dev,Baseline RAG,29,0.432,0.94,0.98,0.5862,1.0,0.7241,0.4185,0.9159,0.96,0.1379,0.8621,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.7931,0.7299,0.5862,0.0013,0.0006,0.0007,0.0 +dev,+ Reranking,29,0.392,0.94,0.96,0.5862,1.0,0.7069,0.4222,0.8973,0.96,0.1379,0.8621,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.7931,0.6954,0.5862,0.0023,0.0016,0.0006,0.0 +dev,+ Verification,29,0.3772,0.96,0.98,0.7931,1.0,0.7821,0.4189,0.9146,0.98,0.069,0.8966,0.6667,0.5,0.5714,0.1034,1.0,0.6667,0.8,0.931,0.7821,0.7931,0.0048,0.0009,0.0007,0.0031 +dev,EvidenceGuard,29,0.3527,0.96,0.96,0.7931,1.0,0.7821,0.4238,0.8839,0.98,0.069,0.8966,0.6667,0.5,0.5714,0.1034,1.0,0.6667,0.8,0.931,0.7821,0.7931,0.0061,0.0017,0.0007,0.0037 diff --git a/results/metrics.json b/results/metrics.json new file mode 100644 index 0000000000000000000000000000000000000000..fb81c6462b7fb2a148f668a3af9bb76dfd821ef4 --- /dev/null +++ b/results/metrics.json @@ -0,0 +1,537 @@ +{ + "meta": { + "note": "Experiments use SYNTHETIC documents of a fictional university. Results do not establish real-world university policy accuracy.", + "components": { + "Embeddings": "LSA (TF-IDF + TruncatedSVD) - offline fallback", + "Vector store": "FAISS IndexFlatIP (cosine)", + "Keyword retrieval": "BM25 (rank_bm25) fused with Reciprocal Rank Fusion", + "Reranker": "Lexical cross-scorer (IDF coverage + bigrams + BM25) - offline fallback", + "Evidence verifier": "Rule-based verifier (numeric mismatch, polarity flip, lexical support) - offline fallback", + "Generator": "Extractive composer (no LLM) - offline fallback" + }, + "backend": "lite", + "llm_backend": "extractive", + "thresholds": { + "min_relevance": 0.15, + "min_coverage": 0.6, + "partial_coverage": 0.5, + "min_confidence": 0.3, + "conflict_topic_sim": 0.3, + "conflict_sentence_coverage": 0.35, + "conflict_min_shared": 2, + "conflict_subject_mismatch": 0.3, + "conflict_min_relevance": 0.25, + "nli_contradiction": 0.6, + "nli_entailment": 0.5, + "citation_overlap": 0.5 + }, + "n_questions": 100, + "dev_questions": 29, + "test_questions": 71, + "python": "3.13.18", + "machine": "x86_64", + "cpu_count": 2, + "runtime_s": 23.7, + "date": "2026-11-19 07:51" + }, + "metrics": { + "all": { + "baseline": { + "n_questions": 100, + "precision_at_k": 0.4541, + "recall_at_k": 0.9647, + "mrr": 0.9765, + "answer_correctness": 0.57, + "faithfulness": 1.0, + "grounded_faithfulness": 0.7567, + "answer_relevance": 0.4425, + "context_precision": 0.9244, + "context_recall": 0.9765, + "unsupported_answer_rate": 0.19, + "abstention_accuracy": 0.85, + "abstention_precision": 0.0, + "abstention_recall": 0.0, + "abstention_f1": 0.0, + "abstention_rate": 0.0, + "contradiction_precision": 0.0, + "contradiction_recall": 0.0, + "contradiction_f1": 0.0, + "contradiction_accuracy": 0.8, + "citation_support_accuracy": 0.7483, + "behaviour_accuracy": 0.55, + "avg_response_time_s": 0.0014, + "avg_retrieval_time_s": 0.0006, + "avg_generation_time_s": 0.0007, + "avg_verification_time_s": 0.0 + }, + "rerank": { + "n_questions": 100, + "precision_at_k": 0.44, + "recall_at_k": 0.9765, + "mrr": 0.9588, + "answer_correctness": 0.56, + "faithfulness": 1.0, + "grounded_faithfulness": 0.735, + "answer_relevance": 0.4417, + "context_precision": 0.9101, + "context_recall": 0.9824, + "unsupported_answer_rate": 0.2, + "abstention_accuracy": 0.85, + "abstention_precision": 0.0, + "abstention_recall": 0.0, + "abstention_f1": 0.0, + "abstention_rate": 0.0, + "contradiction_precision": 0.0, + "contradiction_recall": 0.0, + "contradiction_f1": 0.0, + "contradiction_accuracy": 0.8, + "citation_support_accuracy": 0.72, + "behaviour_accuracy": 0.54, + "avg_response_time_s": 0.0023, + "avg_retrieval_time_s": 0.0017, + "avg_generation_time_s": 0.0006, + "avg_verification_time_s": 0.0 + }, + "verify": { + "n_questions": 100, + "precision_at_k": 0.4148, + "recall_at_k": 0.9765, + "mrr": 0.9765, + "answer_correctness": 0.73, + "faithfulness": 1.0, + "grounded_faithfulness": 0.8311, + "answer_relevance": 0.473, + "context_precision": 0.921, + "context_recall": 0.9824, + "unsupported_answer_rate": 0.09, + "abstention_accuracy": 0.83, + "abstention_precision": 0.4615, + "abstention_recall": 0.8, + "abstention_f1": 0.5854, + "abstention_rate": 0.26, + "contradiction_precision": 0.8667, + "contradiction_recall": 0.65, + "contradiction_f1": 0.7429, + "contradiction_accuracy": 0.91, + "citation_support_accuracy": 0.8108, + "behaviour_accuracy": 0.73, + "avg_response_time_s": 0.0042, + "avg_retrieval_time_s": 0.001, + "avg_generation_time_s": 0.0005, + "avg_verification_time_s": 0.0027 + }, + "full": { + "n_questions": 100, + "precision_at_k": 0.4106, + "recall_at_k": 0.9824, + "mrr": 0.9588, + "answer_correctness": 0.73, + "faithfulness": 1.0, + "grounded_faithfulness": 0.8221, + "answer_relevance": 0.4744, + "context_precision": 0.9059, + "context_recall": 0.9882, + "unsupported_answer_rate": 0.09, + "abstention_accuracy": 0.83, + "abstention_precision": 0.4615, + "abstention_recall": 0.8, + "abstention_f1": 0.5854, + "abstention_rate": 0.26, + "contradiction_precision": 0.8667, + "contradiction_recall": 0.65, + "contradiction_f1": 0.7429, + "contradiction_accuracy": 0.91, + "citation_support_accuracy": 0.8018, + "behaviour_accuracy": 0.73, + "avg_response_time_s": 0.0055, + "avg_retrieval_time_s": 0.0018, + "avg_generation_time_s": 0.0005, + "avg_verification_time_s": 0.0031 + } + }, + "test": { + "baseline": { + "n_questions": 71, + "precision_at_k": 0.4633, + "recall_at_k": 0.975, + "mrr": 0.975, + "answer_correctness": 0.5634, + "faithfulness": 1.0, + "grounded_faithfulness": 0.77, + "answer_relevance": 0.4523, + "context_precision": 0.9279, + "context_recall": 0.9833, + "unsupported_answer_rate": 0.2113, + "abstention_accuracy": 0.8451, + "abstention_precision": 0.0, + "abstention_recall": 0.0, + "abstention_f1": 0.0, + "abstention_rate": 0.0, + "contradiction_precision": 0.0, + "contradiction_recall": 0.0, + "contradiction_f1": 0.0, + "contradiction_accuracy": 0.8028, + "citation_support_accuracy": 0.7559, + "behaviour_accuracy": 0.5352, + "avg_response_time_s": 0.0014, + "avg_retrieval_time_s": 0.0006, + "avg_generation_time_s": 0.0007, + "avg_verification_time_s": 0.0 + }, + "rerank": { + "n_questions": 71, + "precision_at_k": 0.46, + "recall_at_k": 0.9917, + "mrr": 0.9583, + "answer_correctness": 0.5493, + "faithfulness": 1.0, + "grounded_faithfulness": 0.7465, + "answer_relevance": 0.4496, + "context_precision": 0.9154, + "context_recall": 0.9917, + "unsupported_answer_rate": 0.2254, + "abstention_accuracy": 0.8451, + "abstention_precision": 0.0, + "abstention_recall": 0.0, + "abstention_f1": 0.0, + "abstention_rate": 0.0, + "contradiction_precision": 0.0, + "contradiction_recall": 0.0, + "contradiction_f1": 0.0, + "contradiction_accuracy": 0.8028, + "citation_support_accuracy": 0.73, + "behaviour_accuracy": 0.5211, + "avg_response_time_s": 0.0023, + "avg_retrieval_time_s": 0.0017, + "avg_generation_time_s": 0.0006, + "avg_verification_time_s": 0.0 + }, + "verify": { + "n_questions": 71, + "precision_at_k": 0.4305, + "recall_at_k": 0.9833, + "mrr": 0.975, + "answer_correctness": 0.7042, + "faithfulness": 1.0, + "grounded_faithfulness": 0.8576, + "answer_relevance": 0.5024, + "context_precision": 0.9237, + "context_recall": 0.9833, + "unsupported_answer_rate": 0.0986, + "abstention_accuracy": 0.8028, + "abstention_precision": 0.4348, + "abstention_recall": 0.9091, + "abstention_f1": 0.5882, + "abstention_rate": 0.3239, + "contradiction_precision": 0.8182, + "contradiction_recall": 0.6429, + "contradiction_f1": 0.72, + "contradiction_accuracy": 0.9014, + "citation_support_accuracy": 0.8264, + "behaviour_accuracy": 0.7042, + "avg_response_time_s": 0.004, + "avg_retrieval_time_s": 0.001, + "avg_generation_time_s": 0.0005, + "avg_verification_time_s": 0.0026 + }, + "full": { + "n_questions": 71, + "precision_at_k": 0.4347, + "recall_at_k": 0.9917, + "mrr": 0.9583, + "answer_correctness": 0.7042, + "faithfulness": 1.0, + "grounded_faithfulness": 0.8438, + "answer_relevance": 0.5018, + "context_precision": 0.915, + "context_recall": 0.9917, + "unsupported_answer_rate": 0.0986, + "abstention_accuracy": 0.8028, + "abstention_precision": 0.4348, + "abstention_recall": 0.9091, + "abstention_f1": 0.5882, + "abstention_rate": 0.3239, + "contradiction_precision": 0.8182, + "contradiction_recall": 0.6429, + "contradiction_f1": 0.72, + "contradiction_accuracy": 0.9014, + "citation_support_accuracy": 0.8125, + "behaviour_accuracy": 0.7042, + "avg_response_time_s": 0.0052, + "avg_retrieval_time_s": 0.0018, + "avg_generation_time_s": 0.0005, + "avg_verification_time_s": 0.0029 + } + }, + "dev": { + "baseline": { + "n_questions": 29, + "precision_at_k": 0.432, + "recall_at_k": 0.94, + "mrr": 0.98, + "answer_correctness": 0.5862, + "faithfulness": 1.0, + "grounded_faithfulness": 0.7241, + "answer_relevance": 0.4185, + "context_precision": 0.9159, + "context_recall": 0.96, + "unsupported_answer_rate": 0.1379, + "abstention_accuracy": 0.8621, + "abstention_precision": 0.0, + "abstention_recall": 0.0, + "abstention_f1": 0.0, + "abstention_rate": 0.0, + "contradiction_precision": 0.0, + "contradiction_recall": 0.0, + "contradiction_f1": 0.0, + "contradiction_accuracy": 0.7931, + "citation_support_accuracy": 0.7299, + "behaviour_accuracy": 0.5862, + "avg_response_time_s": 0.0013, + "avg_retrieval_time_s": 0.0006, + "avg_generation_time_s": 0.0007, + "avg_verification_time_s": 0.0 + }, + "rerank": { + "n_questions": 29, + "precision_at_k": 0.392, + "recall_at_k": 0.94, + "mrr": 0.96, + "answer_correctness": 0.5862, + "faithfulness": 1.0, + "grounded_faithfulness": 0.7069, + "answer_relevance": 0.4222, + "context_precision": 0.8973, + "context_recall": 0.96, + "unsupported_answer_rate": 0.1379, + "abstention_accuracy": 0.8621, + "abstention_precision": 0.0, + "abstention_recall": 0.0, + "abstention_f1": 0.0, + "abstention_rate": 0.0, + "contradiction_precision": 0.0, + "contradiction_recall": 0.0, + "contradiction_f1": 0.0, + "contradiction_accuracy": 0.7931, + "citation_support_accuracy": 0.6954, + "behaviour_accuracy": 0.5862, + "avg_response_time_s": 0.0023, + "avg_retrieval_time_s": 0.0016, + "avg_generation_time_s": 0.0006, + "avg_verification_time_s": 0.0 + }, + "verify": { + "n_questions": 29, + "precision_at_k": 0.3772, + "recall_at_k": 0.96, + "mrr": 0.98, + "answer_correctness": 0.7931, + "faithfulness": 1.0, + "grounded_faithfulness": 0.7821, + "answer_relevance": 0.4189, + "context_precision": 0.9146, + "context_recall": 0.98, + "unsupported_answer_rate": 0.069, + "abstention_accuracy": 0.8966, + "abstention_precision": 0.6667, + "abstention_recall": 0.5, + "abstention_f1": 0.5714, + "abstention_rate": 0.1034, + "contradiction_precision": 1.0, + "contradiction_recall": 0.6667, + "contradiction_f1": 0.8, + "contradiction_accuracy": 0.931, + "citation_support_accuracy": 0.7821, + "behaviour_accuracy": 0.7931, + "avg_response_time_s": 0.0048, + "avg_retrieval_time_s": 0.0009, + "avg_generation_time_s": 0.0007, + "avg_verification_time_s": 0.0031 + }, + "full": { + "n_questions": 29, + "precision_at_k": 0.3527, + "recall_at_k": 0.96, + "mrr": 0.96, + "answer_correctness": 0.7931, + "faithfulness": 1.0, + "grounded_faithfulness": 0.7821, + "answer_relevance": 0.4238, + "context_precision": 0.8839, + "context_recall": 0.98, + "unsupported_answer_rate": 0.069, + "abstention_accuracy": 0.8966, + "abstention_precision": 0.6667, + "abstention_recall": 0.5, + "abstention_f1": 0.5714, + "abstention_rate": 0.1034, + "contradiction_precision": 1.0, + "contradiction_recall": 0.6667, + "contradiction_f1": 0.8, + "contradiction_accuracy": 0.931, + "citation_support_accuracy": 0.7821, + "behaviour_accuracy": 0.7931, + "avg_response_time_s": 0.0061, + "avg_retrieval_time_s": 0.0017, + "avg_generation_time_s": 0.0007, + "avg_verification_time_s": 0.0037 + } + } + }, + "by_category": { + "baseline": { + "answerable": { + "n": 30, + "answer_correctness": 1.0, + "behaviour_accuracy": 1.0, + "unsupported_rate": 0.0, + "abstention_rate": 0.0 + }, + "conflicting": { + "n": 20, + "answer_correctness": 0.1, + "behaviour_accuracy": 0.0, + "unsupported_rate": 0.05, + "abstention_rate": 0.0 + }, + "misleading": { + "n": 15, + "answer_correctness": 0.8, + "behaviour_accuracy": 0.8, + "unsupported_rate": 0.1333, + "abstention_rate": 0.0 + }, + "missing": { + "n": 15, + "answer_correctness": 0.0, + "behaviour_accuracy": 0.0, + "unsupported_rate": 1.0, + "abstention_rate": 0.0 + }, + "multi_passage": { + "n": 20, + "answer_correctness": 0.65, + "behaviour_accuracy": 0.65, + "unsupported_rate": 0.05, + "abstention_rate": 0.0 + } + }, + "rerank": { + "answerable": { + "n": 30, + "answer_correctness": 1.0, + "behaviour_accuracy": 1.0, + "unsupported_rate": 0.0, + "abstention_rate": 0.0 + }, + "conflicting": { + "n": 20, + "answer_correctness": 0.1, + "behaviour_accuracy": 0.0, + "unsupported_rate": 0.05, + "abstention_rate": 0.0 + }, + "misleading": { + "n": 15, + "answer_correctness": 0.8, + "behaviour_accuracy": 0.8, + "unsupported_rate": 0.1333, + "abstention_rate": 0.0 + }, + "missing": { + "n": 15, + "answer_correctness": 0.0, + "behaviour_accuracy": 0.0, + "unsupported_rate": 1.0, + "abstention_rate": 0.0 + }, + "multi_passage": { + "n": 20, + "answer_correctness": 0.6, + "behaviour_accuracy": 0.6, + "unsupported_rate": 0.1, + "abstention_rate": 0.0 + } + }, + "verify": { + "answerable": { + "n": 30, + "answer_correctness": 0.9, + "behaviour_accuracy": 0.9, + "unsupported_rate": 0.0, + "abstention_rate": 0.1 + }, + "conflicting": { + "n": 20, + "answer_correctness": 0.65, + "behaviour_accuracy": 0.65, + "unsupported_rate": 0.05, + "abstention_rate": 0.2 + }, + "misleading": { + "n": 15, + "answer_correctness": 0.7333, + "behaviour_accuracy": 0.7333, + "unsupported_rate": 0.1333, + "abstention_rate": 0.1333 + }, + "missing": { + "n": 15, + "answer_correctness": 0.8, + "behaviour_accuracy": 0.8, + "unsupported_rate": 0.2, + "abstention_rate": 0.8 + }, + "multi_passage": { + "n": 20, + "answer_correctness": 0.5, + "behaviour_accuracy": 0.5, + "unsupported_rate": 0.15, + "abstention_rate": 0.25 + } + }, + "full": { + "answerable": { + "n": 30, + "answer_correctness": 0.9, + "behaviour_accuracy": 0.9, + "unsupported_rate": 0.0, + "abstention_rate": 0.1 + }, + "conflicting": { + "n": 20, + "answer_correctness": 0.65, + "behaviour_accuracy": 0.65, + "unsupported_rate": 0.05, + "abstention_rate": 0.2 + }, + "misleading": { + "n": 15, + "answer_correctness": 0.7333, + "behaviour_accuracy": 0.7333, + "unsupported_rate": 0.1333, + "abstention_rate": 0.1333 + }, + "missing": { + "n": 15, + "answer_correctness": 0.8, + "behaviour_accuracy": 0.8, + "unsupported_rate": 0.2, + "abstention_rate": 0.8 + }, + "multi_passage": { + "n": 20, + "answer_correctness": 0.5, + "behaviour_accuracy": 0.5, + "unsupported_rate": 0.15, + "abstention_rate": 0.25 + } + } + }, + "config_names": { + "baseline": "Baseline RAG", + "rerank": "+ Reranking", + "verify": "+ Verification", + "full": "EvidenceGuard" + } +} \ No newline at end of file diff --git a/results/per_question_results.csv b/results/per_question_results.csv new file mode 100644 index 0000000000000000000000000000000000000000..bdd08c91478da7d7979dbbac33f77f2cd28480a9 --- /dev/null +++ b/results/per_question_results.csv @@ -0,0 +1,528 @@ +config,split,id,category,question,expected_behaviour,decision,abstained,conflict_flagged,correct,behaviour_ok,unsupported,error_type,keywords_hit,keywords_total,precision_at_k,recall_at_k,mrr,faithfulness,grounded_faithfulness,citation_support,confidence,t_total,answer,expected_answer,explanation,retrieved +baseline,test,A01,answerable,How many marks are allotted to internal assessment in a theory course?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0016003800001271884,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],40 marks are allotted to internal assessment (the end-semester exam carries 60).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.2; D04 p.2; D03 p.1 +baseline,test,A02,answerable,How many marks does the end-semester examination of a theory course carry?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0014369379996423959,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],60 marks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D13 p.1; D13 p.1; D03 p.1; D03 p.1 +baseline,test,A03,answerable,What is the duration of an internal test?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0012533909998637682,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],Internal tests are 60 minutes long.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D10 p.2 +baseline,test,A04,answerable,Within how many working days must a medical certificate be submitted to take a make-up test?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.001341309000054025,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Within 3 working days of the missed test.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D10 p.1; D04 p.2; D04 p.1; D10 p.1 +baseline,test,A05,answerable,By what time on the due date must assignments be submitted on AVU-Learn?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,0.5,0.5,,0.001493447000029846,"All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [5]",By 11:59 PM on the due date.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D04 p.2; D05 p.1; D07 p.1; D07 p.2 +baseline,dev,A06,answerable,What is the maximum file size allowed for an assignment submission?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0013160710000192921,Assignments must be submitted as a single PDF file of no more than 10 MB. [1] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [2],A single PDF of no more than 10 MB.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D05 p.1; D05 p.1; D05 p.2; D09 p.1 +baseline,dev,A07,answerable,What is the maximum number of members allowed in a group assignment?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.3333333333333333,0.3333333333333333,,0.0013493299998117436,"Group assignments may have at most 4 members, and each member must state their individual contribution. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [3]",At most 4 members.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D01 p.1; D05 p.1; D09 p.1; D05 p.1 +baseline,test,A08,answerable,What happens if an assignment has a similarity index above 40%?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.001447533999908046,"A similarity index above 40% results in zero marks and referral to the Academic Integrity Committee. [1] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",It receives zero marks and is referred to the Academic Integrity Committee.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D03 p.1; D13 p.1; D04 p.1; D05 p.1 +baseline,test,A09,answerable,On what date do the odd semester end-semester examinations conclude?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,,0.0014480660001936485,The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1] Key Dates - Odd Semester 2025-26. [3],12 December 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D14 p.1; D14 p.1; D06 p.2; D01 p.2 +baseline,test,A10,answerable,What are the timings of the afternoon examination session?,answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0014586620000045514,Afternoon session: 2:00 PM to 5:00 PM. [3],2:00 PM to 5:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.2; D06 p.1; D06 p.1; D06 p.2 +baseline,dev,A11,answerable,How early must students report before an examination session starts?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.001419449000422901,Students must report 30 minutes before the start of the session. [1],30 minutes before the start of the session.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D06 p.1; D06 p.2; D06 p.2 +baseline,dev,A12,answerable,On which date is the MDS302 Generative AI and LLMs examination?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,,0.001550025000142341,03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session. [1] All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [2],"03 December 2025, morning session.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D05 p.1; D03 p.1; D04 p.2; D14 p.1 +baseline,dev,A13,answerable,What type of calculator is permitted in the examination hall?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0013662090000252647,Only non-programmable scientific calculators are permitted in the examination hall. [1],Only non-programmable scientific calculators.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D03 p.1; D09 p.1; D03 p.1; D03 p.1 +baseline,test,A14,answerable,By when will the odd semester examination results be announced?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.00132122300010451,Results of the odd semester examinations will be announced by 15 January 2026. [1],By 15 January 2026.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D06 p.1; D14 p.1; D14 p.1; D14 p.2 +baseline,dev,A15,answerable,What tuition fee waiver does a student with a CGPA of 9.0 or above receive?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0012616510002771975,Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],A 50% tuition fee waiver.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D03 p.1; D03 p.1; D13 p.2; D13 p.1 +baseline,test,A16,answerable,What tuition fee waiver is given to students with a CGPA between 8.5 and 8.99?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0012854999999944994,Students with a CGPA between 8.5 and 8.99 receive a 25% tuition fee waiver. [1],A 25% tuition fee waiver.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D13 p.2 +baseline,test,A17,answerable,What is the amount of the need-based scholarship?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0011677200000121957,"A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1]","INR 30,000 per year.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D07 p.1; D08 p.1; D08 p.1; D07 p.2 +baseline,test,A18,answerable,What CGPA is required for a scholarship to be renewed?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0011352490000717808,Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [1],A CGPA of at least 8.0 (and no disciplinary action).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.2; D07 p.2; D07 p.1; D08 p.1; D13 p.2 +baseline,test,A19,answerable,Can a student hold an external scholarship together with a university scholarship?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0012058320003234257,Students may simultaneously hold one external (government or private) scholarship. [1],"Yes, a student may simultaneously hold one external (government or private) scholarship.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.2; D08 p.1; D07 p.2; D07 p.1; D08 p.1 +baseline,dev,A20,answerable,How many credits must a PG student register for in a semester?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0012776469998243556,PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1],A minimum of 18 and a maximum of 26 credits.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D15 p.1; D09 p.2; D15 p.1; D03 p.1 +baseline,test,A21,answerable,What is the fee for late course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0013728009998885682,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (late registration allowed until 22 July 2025).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D09 p.1; D09 p.2; D05 p.1; D10 p.2 +baseline,test,A22,answerable,How many open electives can a student register for per semester?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0014859899997645698,A student may register for a maximum of 2 open electives per semester. [1],A maximum of 2 open electives per semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D09 p.2; D14 p.1; D03 p.1; D16 p.2 +baseline,dev,A23,answerable,For how many semesters can a student take academic leave during the programme?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0011967929999627813,A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1],A maximum of two semesters.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D10 p.2; D10 p.1; D10 p.2; D10 p.1 +baseline,test,A24,answerable,How far in advance must an application for academic leave be submitted?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0012030869997943228,"Applications must be submitted to the Dean of Academics at least 30 days before the start of the semester, except in medical emergencies. [1] Students may avail maternity leave of up to 6 months, which is counted within the academic leave limit. [1]",At least 30 days before the start of the semester (except medical emergencies).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D10 p.1; D10 p.2; D10 p.2; D10 p.1 +baseline,test,A25,answerable,What fee must a student pay per semester while on academic leave?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0011885779999829538,"Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [1]","A registration retention fee of INR 5,000 per semester (no tuition fee).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D10 p.1; D10 p.1; D10 p.2; D10 p.1 +baseline,test,A26,answerable,What is the maximum duration allowed to complete a programme?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0013864410002497607,"The maximum duration to complete a programme is the normal duration plus two years, including any academic leave. [1]","The normal duration plus two years, including any academic leave.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D10 p.1; D09 p.1; D04 p.1; D15 p.1 +baseline,dev,A27,answerable,What are the Central Library's opening hours on Saturdays?,answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,0.5,0.5,,0.0011833530002149928,The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1] Library hours during examination periods are extended until 12:00 midnight on working days. [5],9:00 AM to 5:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D11 p.2; D11 p.1; D11 p.2; D12 p.1 +baseline,test,A28,answerable,How many books can research scholars borrow and for how long?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0013358659998630174,Research scholars may borrow up to 8 books for 30 days. [1],Up to 8 books for 30 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D11 p.2; D12 p.1; D04 p.1; D10 p.1 +baseline,test,A29,answerable,Which grade is awarded for marks between 80 and 89?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.001409449000220775,Grade A+ (grade point 9): 80 to 89 marks. [1] Grades are awarded on a 10-point scale as follows. [1],Grade A+ (grade point 9).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.1; D13 p.2; D13 p.1; D13 p.2; D13 p.1 +baseline,test,A30,answerable,What minimum mark is needed in the end-semester examination to pass a course?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,0.5,0.5,,0.001391931000398472,"To pass a course, a student must secure at least 40% marks in aggregate (internal assessment plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60). [1] A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [3]",At least 35% in the end-semester examination (21 out of 60).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.1; D13 p.1; D01 p.1; D01 p.1; D03 p.1 +baseline,test,M01,multi_passage,"What minimum internal assessment marks are needed for exam eligibility, and how many marks is each internal test worth?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.001361871999961295,"Internal assessment consists of Internal Test 1 (15 marks), Internal Test 2 (15 marks), Assignment (5 marks), and Class participation and quizzes (5 marks). [1]",At least 16 out of 40 IA marks (40%); each internal test is worth 15 marks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.1; D03 p.1; D04 p.2 +baseline,test,M02,multi_passage,"When is Internal Test 1 held this semester, and what must a student do to take a make-up test if they miss it through illness?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,1.0,1.0,1.0,1.0,1.0,1.0,,0.001349503000255936,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",1-5 September 2025; submit a medical certificate within 3 working days to take one make-up test.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D14 p.1; D04 p.1; D14 p.1 +baseline,dev,M03,multi_passage,"What happens to a student whose attendance is still short after condonation, and to whom can an eligibility decision be appealed?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.2,0.5,1.0,1.0,1.0,1.0,,0.001541926000300009,A student may appeal against an eligibility decision to the Controller of Examinations within 3 working days of the publication of the eligibility list. [1],They are marked NE (Not Eligible) and must re-register; appeals go to the Controller of Examinations within 3 working days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.2; D01 p.1; D03 p.1; D01 p.1; D02 p.1 +baseline,test,M04,multi_passage,"Does approved medical leave count as attendance, and for how many days can a Head of Department approve medical leave?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0012054819999320898,Medical leave of up to 15 days within a semester may be approved by the Head of Department on submission of a medical certificate from a registered medical practitioner. [1] Approved medical leave does not count as attendance; it is considered only for condonation. [1],"No, it does not count as attendance (only for condonation); up to 15 days per semester.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D10 p.1; D10 p.1; D01 p.2; D10 p.2 +baseline,test,M05,multi_passage,"Do library dues affect examination eligibility, and what is charged for a lost library book?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0013189340002099925,Library dues do not affect examination eligibility but must be cleared before results are released. [1] An overdue fine of INR 5 per book per day is charged. [2] Lost books must be replaced or paid for at twice the current price. [2],"No, but they must be cleared before results are released; lost books cost twice the current price.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.2; D11 p.2; D03 p.2; D03 p.1; D03 p.1 +baseline,test,M06,multi_passage,"What CGPA is needed for First Class with Distinction, and what CGPA earns a 50% merit tuition waiver?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0011971630001426092,First Class with Distinction is awarded for a CGPA of 8.0 or above. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],8.0 or above for First Class with Distinction; 9.0 or above for a 50% waiver.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D13 p.2; D13 p.2; D13 p.1; D07 p.2 +baseline,test,M07,multi_passage,"Can reference books be borrowed, and how many times can a borrowed book be renewed?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0013766350002697436,A borrowed book may be renewed once if it has not been reserved by another member. [1] Reference books cannot be borrowed and must be used within the library. [1],Reference books cannot be borrowed; a borrowed book can be renewed once if not reserved.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.2; D11 p.1; D12 p.1; D07 p.2; D07 p.2 +baseline,test,M08,multi_passage,"How many internal assessment marks are given for assignments, and in what file format must assignments be submitted?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.8,1.0,0.5,1.0,1.0,0.5,,0.0014477879999503784,Assignments submitted after the deadline will not be accepted for internal assessment. [1] IA marks are published on AVU-Learn within 10 working days of each test. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [2],5 marks; as a single PDF file (max 10 MB).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.2; D05 p.1; D04 p.1; D05 p.1; D04 p.1 +baseline,test,M09,multi_passage,"When does odd semester course registration close, and what is the last date for late registration?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,0.6666666666666666,0.5,,0.0013639759999932721,"Course registration for the odd semester opens on 1 July 2025 and closes on 15 July 2025. [1] Last date for scholarship applications: 31 August 2025. [2] Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]",Closes 15 July 2025; late registration until 22 July 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D14 p.1; D09 p.1; D09 p.2; D14 p.1 +baseline,dev,M10,multi_passage,When do odd semester classes begin and what is the last working day of the odd semester?,answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0013579869996647176,Last working day of the odd semester: 21 November 2025. [2] Odd semester classes begin on 21 July 2025. [1],Classes begin 21 July 2025; last working day 21 November 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D14 p.1; D14 p.1; D14 p.2; D06 p.1; D06 p.2 +baseline,test,M11,multi_passage,"What documents must be submitted for the need-based scholarship, and how recent must the income certificate be?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.001303068000197527,"A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1] Applications must be submitted on AVU-Learn by 31 August 2025. [1] Applicants must submit an income certificate issued by a competent authority within the last 6 months and the marks card of the previous year. [1]","An income certificate from a competent authority issued within the last 6 months, and the previous year's marks card.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D08 p.1; D08 p.1; D07 p.1; D04 p.1 +baseline,dev,M12,multi_passage,"If a student qualifies for both the merit and need-based scholarships, what do they receive, and what is needed to renew it?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.4,1.0,0.5,1.0,0.3333333333333333,0.3333333333333333,,0.001323251000030723,"Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [3]",Only the higher-value scholarship; renewal needs a CGPA of at least 8.0 and no disciplinary action.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D07 p.2; D07 p.1; D07 p.2; D05 p.1 +baseline,dev,M13,multi_passage,How long is each internal test and in which weeks of the semester are they conducted?,answer,answered,False,False,True,True,False,correct,3,3,0.6,1.0,1.0,1.0,1.0,1.0,,0.001310457999807113,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],60 minutes; in the 7th and 13th weeks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D04 p.2 +baseline,dev,M14,multi_passage,"Within how many days are internal assessment marks published after a test, and how long do students have to request a review?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0013291889999891282,Students may request a review of IA marks within 5 working days of publication. [1] IA marks are published on AVU-Learn within 10 working days of each test. [1] Assignments submitted after the deadline will not be accepted for internal assessment. [1],Within 10 working days; review requests within 5 working days of publication.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.2; D04 p.1; D04 p.1; D04 p.1; D03 p.1 +baseline,dev,M15,multi_passage,"How long an extension can an instructor grant for an assignment, and what happens if the similarity index is above 20%?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0013294939999468625,A similarity index above 20% requires resubmission within 3 days. [1] Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [2],Up to 5 days if requested before the deadline; similarity above 20% requires resubmission within 3 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D05 p.1; D05 p.1; D14 p.2; D06 p.2 +baseline,test,M16,multi_passage,"Which MSc Data Science Semester 3 examination is held in the afternoon session, and what are the afternoon session timings?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0015873450001890888,10 December 2025 (Wednesday): MDS305 Security for Data Science - Afternoon session. [2] MSc Data Science - Semester 3. [1],MDS305 Security for Data Science on 10 December 2025; 2:00 PM to 5:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D06 p.2 +baseline,test,M17,multi_passage,"When are supplementary examinations held, and what is the maximum grade that can be awarded in them?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0014821270001448283,Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1],In June and July; the maximum grade is A.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D13 p.2; D13 p.1; D13 p.1; D13 p.1 +baseline,test,M18,multi_passage,"How many backlog courses prevent promotion to the next year, and when can backlogs be cleared through supplementary examinations?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.6666666666666666,0.5,,0.0013841810000485566,A student with more than 4 backlog courses at the end of an academic year will not be promoted to the next year. [1] Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1] Library dues do not affect examination eligibility but must be cleared before results are released. [2],More than 4 backlog courses; supplementary exams are held in June and July.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D03 p.2; D09 p.2; D04 p.2; D07 p.1 +baseline,test,M19,multi_passage,"How is participation in university-approved events treated for attendance, and who must approve it?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.001470309000069392,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1]",Counted as present for up to 10 contact hours per semester with prior approval of the Head of Department.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.2; D01 p.1; D01 p.1; D02 p.1; D04 p.1 +baseline,test,M20,multi_passage,"A student returning from academic leave must re-register within which window, and what are the regular odd semester registration dates?",answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,2,0.4,0.5,1.0,1.0,0.5,0.5,,0.0013237140001365333,Students returning from leave must re-register within the regular registration window. [1] Key Dates - Odd Semester 2025-26. [5],Within the regular registration window: 1 July 2025 to 15 July 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D10 p.2; D10 p.1; D10 p.1; D14 p.1 +baseline,dev,N01,missing,What is the fee for revaluation of answer scripts?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0012922460000481806,Answer scripts of internal tests are retained by the department for one year. [1] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [2],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.2; D07 p.1; D01 p.1; D03 p.1; D03 p.1 +baseline,test,N02,missing,Who is the current Vice-Chancellor of Aranya Valley University?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.001043024999944464,Students returning from leave must re-register within the regular registration window. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D01 p.1; D04 p.2; D12 p.1; D03 p.2 +baseline,test,N03,missing,What is the annual hostel fee for PhD students?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0013675159998456365,"Late payment of hostel dues attracts a fine of INR 500. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [3] The mess fee is INR 4,500 per month, payable by the 10th of each month. [1]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D16 p.1; D16 p.1; D07 p.1; D07 p.1; D16 p.2 +baseline,test,N04,missing,Does the university offer a sports quota scholarship?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0012978620002286334,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [5] All other conditions of the Scholarship Policy 2025-26 remain unchanged. [1]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D08 p.1; D07 p.1; D07 p.2; D07 p.2; D01 p.2 +baseline,test,N05,missing,What is the dress code during end-semester examinations?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.001351022999642737,End-semester examinations: from 3 December 2025. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D14 p.1; D06 p.1; D01 p.2; D03 p.1; D06 p.2 +baseline,test,N06,missing,Can students take the end-semester examinations online from home?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0013302100001055805,The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D14 p.1; D01 p.2; D03 p.2; D03 p.1 +baseline,test,N07,missing,What minimum CGPA is required to sit for campus placements?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.001373058999888599,Campus Wi-Fi is available to residents with a daily limit of 5 GB. [1] First Class is awarded for a CGPA from 6.5 to 7.99. [2] Scholarship holders must maintain a minimum of 75% attendance in every course. [3],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D16 p.2; D13 p.2; D07 p.2; D16 p.1; D01 p.1 +baseline,test,N08,missing,How many total credits are required to graduate from the MSc Data Science programme?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.001480877000176406,MSc Data Science - Semester 3. [1] The PG dissertation carries 12 credits and is evaluated by an internal guide and an external examiner. [3],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D15 p.1; D09 p.1; D15 p.1 +baseline,dev,N09,missing,What is the fee for a duplicate hall ticket?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0013619180003843212,Hall tickets are issued through the AVU-Learn portal 5 days before the first examination. [1] (c) The student must have no outstanding tuition fee dues. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.1; D06 p.2; D07 p.1; D01 p.1; D03 p.1 +baseline,test,N10,missing,On what date will the 2026 convocation ceremony be held?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0014049419996808865,Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1] Instructors must announce assignment topics at least two weeks before the due date. [4],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D14 p.2; D06 p.2; D04 p.2; D05 p.1 +baseline,dev,N11,missing,What is the university policy on using generative AI tools such as ChatGPT in assignments?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0014197119999153074,03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session. [1] Subscribed e-journals can be accessed off campus through the library remote access service using university credentials. [2],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D11 p.2; D05 p.1; D05 p.2; D04 p.2 +baseline,test,N12,missing,What is the parking fee for students' two-wheelers on campus?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0012438369999472343,"The mess fee is INR 4,500 per month, payable by the 10th of each month. [2] Campus Wi-Fi is available to residents with a daily limit of 5 GB. [1]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D16 p.2; D16 p.1; D07 p.1; D16 p.1; D11 p.2 +baseline,test,N13,missing,What is the late fine for paying tuition fees after the due date?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0014395110001714784,"Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [1] Late payment of hostel dues attracts a fine of INR 500. [2]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D16 p.1; D05 p.1; D09 p.1; D07 p.1 +baseline,test,N14,missing,Does the university offer a tuition fee concession for siblings?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0014389509997272398,"Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [4]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D10 p.1 +baseline,dev,N15,missing,What is the timetable for the even semester examinations in May 2026?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0013553290000345442,Even semester classes begin on 5 January 2026. [3] Only non-programmable scientific calculators are permitted in the examination hall. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D06 p.1; D14 p.2; D14 p.1; D06 p.1 +baseline,test,I01,misleading,"Given that internal assessment carries 50 marks, how many marks does the end-semester examination carry?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0013926960000389954,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],The premise is wrong: IA carries 40 marks and the end-semester examination carries 60 marks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D13 p.1; D15 p.1; D13 p.1 +baseline,test,I02,misleading,"Since PG students can register for up to 30 credits, what is the minimum number of credits?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.5,0.5,,0.0013259279999147111,"PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [4]","The maximum is 26, not 30; the minimum is 18.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D15 p.1; D15 p.1; D01 p.1; D09 p.2 +baseline,dev,I03,misleading,"As research scholars can borrow 10 books, what is their loan period?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.5,0.5,,0.0014706950000800134,"Research scholars may borrow up to 8 books for 30 days. [1] With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2]",Research scholars may borrow up to 8 books (not 10) for 30 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D12 p.1; D11 p.2; D05 p.1; D14 p.1 +baseline,test,I04,misleading,"Since a CGPA of 8.0 earns a 50% merit tuition waiver, what does a CGPA of 9.0 earn?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0014670109999315173,Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],The 50% waiver requires a CGPA of 9.0 or above; 8.5-8.99 earns 25%.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D07 p.2; D13 p.2; D07 p.2; D13 p.2 +baseline,test,I05,misleading,"Given that academic leave can be taken for up to four semesters, how early must a student apply?",correct_premise,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0013427140002022497,A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1],Academic leave is limited to two semesters; apply at least 30 days before the semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D10 p.1; D10 p.2; D10 p.2; D10 p.1 +baseline,test,I06,misleading,"As the MDS301 Deep Learning exam is in the afternoon session, what time does it start?",correct_premise,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0016281759999401402,01 December 2025 (Monday): MDS301 Deep Learning - Morning session. [1],"It is in the morning session (01 December 2025), which starts at 10:00 AM.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D07 p.2 +baseline,test,I07,misleading,"Since make-up internal tests are allowed for any reason, how many can a student take per semester?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0012770409998665855,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Make-up tests are only for medical grounds; one make-up test per semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.2; D04 p.1; D04 p.1; D14 p.1 +baseline,dev,I08,misleading,What is the late fee for course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0013219219999882625,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (not the INR 500 hostel fine).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D09 p.1; D09 p.2; D05 p.1; D10 p.2 +baseline,test,I09,misleading,Above what similarity percentage must an assignment be resubmitted?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.6666666666666666,0.5,,0.00136932599980355,"A similarity index above 20% requires resubmission within 3 days. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",Above 20%.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D01 p.1; D05 p.1; D05 p.1; D05 p.1 +baseline,dev,I10,misleading,At what time does the Central Library close on working days?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0012498090000008233,The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1],10:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D11 p.2; D12 p.1; D11 p.1; D12 p.1 +baseline,test,I11,misleading,How many days before the examinations is the attendance shortage list published?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0013677910001206328,The list of students with attendance shortage is published 7 days before the commencement of end-semester examinations. [1],7 days before the commencement of end-semester examinations.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.2; D01 p.1; D01 p.1; D03 p.2; D04 p.2 +baseline,dev,I12,misleading,How many contact hours of approved event participation can be counted as present?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,0.5,0.5,,0.0012942590001330245,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1] Medical leave of up to 15 days within a semester may be approved by the Head of Department on submission of a medical certificate from a registered medical practitioner. [3]",Up to 10 contact hours per semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.2; D01 p.1; D10 p.1; D01 p.2; D10 p.1 +baseline,test,I13,misleading,What is the minimum CGPA for First Class (without distinction)?,answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.4,1.0,1.0,1.0,0.5,0.5,,0.0013752989998465637,First Class with Distinction is awarded for a CGPA of 8.0 or above. [1] Scholarship holders must maintain a minimum of 75% attendance in every course. [3],6.5 (First Class is CGPA 6.5 to 7.99).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D13 p.2; D07 p.2; D01 p.1; D13 p.1 +baseline,test,I14,misleading,For how many days can a course instructor extend an assignment deadline?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,,0.0012220660000821226,Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [1] The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [5] Assignments must be submitted as a single PDF file of no more than 10 MB. [2],Up to 5 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D05 p.1; D04 p.2; D08 p.1; D08 p.1 +baseline,test,I15,misleading,Is a calculator with programmable memory allowed in the examination hall?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,0.5,1.0,1.0,1.0,,0.00147972300010224,Only non-programmable scientific calculators are permitted in the examination hall. [2],No - only non-programmable scientific calculators are permitted.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.1; D06 p.2; D03 p.1; D03 p.1; D06 p.1 +baseline,test,C01,conflicting,What is the minimum attendance required to appear for end-semester examinations?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.00144778399999268,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1],Conflict: Attendance Regulations 2023 say 75%; Circular 2025/014 revises it to 80% from 2025-26 (supersedes).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D01 p.1; D03 p.1; D01 p.2; D02 p.1 +baseline,test,C02,conflicting,Up to what percentage can an attendance shortage be condoned on medical grounds?,flag_conflict,answered,False,False,True,False,False,missed conflict,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0014865839998492447,"The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]",Conflict: 10% under the 2023 regulations; limited to 5% by the 2025 circular.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D01 p.1; D01 p.2; D04 p.1; D02 p.1 +baseline,test,C03,conflicting,What is the condonation fee per course for attendance shortage?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0014352729999700387,"A condonation fee of INR 500 per course is payable before the condonation order is issued. [1] The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]","Conflict: INR 500 (2023 regulations) vs INR 1,000 (2025 circular).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D01 p.1; D01 p.2; D02 p.1; D03 p.1 +baseline,test,C04,conflicting,"According to the examination eligibility rules, what attendance is needed in a course to sit its end-semester exam?",flag_conflict,answered,False,False,False,False,True,missed conflict,0,2,0.6,0.5,1.0,1.0,0.5,0.5,,0.0013655520001520927,These rules determine whether a student may appear for the end-semester examination of a course. [1] Students declared not eligible must re-register for the course when it is next offered and satisfy all eligibility conditions afresh. [2],"Conflict: the eligibility rules (2024) state 75%, but the 2025 circular raises the requirement to 80%.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.1; D03 p.2; D03 p.1; D03 p.2; D03 p.1 +baseline,test,C05,conflicting,What is the last date to apply for a scholarship for 2025-26?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,0.5,1.0,1.0,1.0,1.0,,0.0012908749999951397,The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [1],Conflict: 31 August 2025 (policy) vs extended to 15 September 2025 (notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D08 p.1; D08 p.1; D07 p.2; D07 p.2; D14 p.1 +baseline,test,C06,conflicting,What is the family income limit for the need-based scholarship?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.0011820210002042586,"A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1]","Conflict: INR 6,00,000 (policy) vs INR 8,00,000 (revised notice).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D08 p.1; D08 p.1; D07 p.1; D07 p.2 +baseline,test,C07,conflicting,Are late assignment submissions accepted?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.0013040759999967122,Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [1],Conflict: the Assignment Policy accepts up to 3 days late with 10%/day penalty; the IA Guidelines say late assignments will not be accepted for IA.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D05 p.1; D04 p.2; D09 p.1; D05 p.1 +baseline,dev,C08,conflicting,What is the penalty for submitting an assignment one day late?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,0.5,1.0,1.0,1.0,1.0,,0.0012954889998582075,Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [1],Conflict: 10% of maximum marks per day (Assignment Policy) vs not accepted at all (IA Guidelines).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D09 p.1; D05 p.1; D05 p.1; D14 p.1 +baseline,test,C09,conflicting,How many books can a postgraduate student borrow from the library?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0012200459996165591,Postgraduate students may borrow up to 5 books for 14 days. [1] Library hours during examination periods are extended until 12:00 midnight on working days. [2],Conflict: 5 books (2023 regulations) vs 6 books from 1 August 2025 (notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D12 p.1; D11 p.2; D12 p.1; D11 p.2 +baseline,test,C10,conflicting,For how many days can a postgraduate student keep a borrowed library book?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,0.5,1.0,0.5,0.5,,0.001298246999795083,Postgraduate students may borrow up to 5 books for 14 days. [2] Reference books cannot be borrowed and must be used within the library. [1],Conflict: 14 days (2023) vs 21 days (2025 notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.2; D11 p.1; D12 p.1; D12 p.1; D03 p.2 +baseline,dev,C11,conflicting,What is the library overdue fine per book per day?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.001265635999970982,An overdue fine of INR 5 per book per day is charged. [1] Reference books cannot be borrowed and must be used within the library. [1],Conflict: INR 5 (2023) vs INR 10 (2025 notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.2; D12 p.1; D12 p.1; D11 p.2; D11 p.1 +baseline,dev,C12,conflicting,How long is the add/drop period for elective courses?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0013273479999043047,Add/drop period for electives: 7 working days from the start of classes. [2],Conflict: 10 working days (Registration Guidelines) vs 7 working days (Academic Calendar).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.2; D14 p.1; D09 p.1; D01 p.1; D12 p.1 +baseline,dev,C13,conflicting,What minimum aggregate percentage is needed to pass a postgraduate course?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,0.3333333333333333,0.5,,0.0014029230001142423,"PG students must obtain at least 50% marks in aggregate to pass a course. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [2]",Conflict: 40% (Grading Policy) vs 50% for PG courses (PG Handbook).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D15 p.1; D01 p.1; D15 p.1; D13 p.1; D13 p.1 +baseline,test,C14,conflicting,On what date do the odd semester end-semester examinations begin?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0013656689998242655,The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1] Odd semester classes begin on 21 July 2025. [3] Key Dates - Odd Semester 2025-26. [3],"Conflict: 1 December 2025 (Timetable, Oct 2025) vs 3 December 2025 (Academic Calendar, June 2025).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D14 p.1; D14 p.1; D06 p.2; D14 p.2 +baseline,test,C15,conflicting,Can I drop an elective course 9 working days after classes start?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0012497660000008182,Students may add or drop elective courses within 10 working days from the start of classes. [1],Conflict: allowed under the Registration Guidelines (10 working days) but not under the Academic Calendar (7 working days).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.2; D14 p.1; D04 p.2; D12 p.1; D04 p.1 +baseline,dev,C16,conflicting,"If my attendance in a course is 78%, am I eligible for the end-semester examination?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,0.5,1.0,1.0,1.0,1.0,,0.0014919010000085109,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1],"Conflict: eligible under the 2023 rule (75%), but below the 80% minimum under the 2025 circular (condonable between 75% and 80%).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D03 p.1; D03 p.1; D01 p.1; D13 p.1 +baseline,test,C17,conflicting,"If a PG student scores 45% in aggregate in a course, do they pass?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.0013045709997641097,PG students must obtain at least 50% marks in aggregate to pass a course. [1],"Conflict: pass under the Grading Policy (40%), fail under the PG Handbook (50%).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D15 p.1; D15 p.1; D13 p.1; D13 p.1; D09 p.1 +baseline,test,C18,conflicting,What is the lowest attendance percentage that can be condoned on medical grounds?,flag_conflict,answered,False,False,True,False,False,missed conflict,2,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.0013228400002844865,"The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2]",Conflict: 65% under the 2023 regulations vs 75% under the 2025 circular.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D01 p.1; D01 p.1; D04 p.1; D02 p.1 +baseline,test,C19,conflicting,"Which attendance rule is the latest, and what minimum attendance does it require?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.0013170960000934429,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1],"Conflict: the 2025 circular (latest) requires 80%, superseding the 75% of the 2023 regulations.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D02 p.1; D01 p.1; D10 p.1; D01 p.1 +baseline,dev,C20,conflicting,"According to the academic calendar, what is the scholarship application deadline, and has it changed?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.0014336330000332964,Last date for scholarship applications: 31 August 2025. [1],"Conflict: the calendar says 31 August 2025, but the notice extends it to 15 September 2025.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D14 p.1; D08 p.1; D08 p.1; D07 p.1; D14 p.1 +rerank,test,A01,answerable,How many marks are allotted to internal assessment in a theory course?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.002539550000165036,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],40 marks are allotted to internal assessment (the end-semester exam carries 60).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.2; D13 p.1; D03 p.1 +rerank,test,A02,answerable,How many marks does the end-semester examination of a theory course carry?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.002587716999641998,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],60 marks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D13 p.1; D13 p.1; D03 p.1; D06 p.1 +rerank,test,A03,answerable,What is the duration of an internal test?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0022772950001126446,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],Internal tests are 60 minutes long.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D14 p.1 +rerank,test,A04,answerable,Within how many working days must a medical certificate be submitted to take a make-up test?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0024216060000981088,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Within 3 working days of the missed test.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.2; D10 p.1; D14 p.1; D04 p.1 +rerank,test,A05,answerable,By what time on the due date must assignments be submitted on AVU-Learn?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,0.5,0.5,,0.0024892390001696185,"All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [5]",By 11:59 PM on the due date.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D04 p.2; D05 p.1; D07 p.1; D07 p.2 +rerank,dev,A06,answerable,What is the maximum file size allowed for an assignment submission?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.002249718999792094,Assignments must be submitted as a single PDF file of no more than 10 MB. [1] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1],A single PDF of no more than 10 MB.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D05 p.1; D05 p.2; D05 p.1; D10 p.1 +rerank,dev,A07,answerable,What is the maximum number of members allowed in a group assignment?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.3333333333333333,0.3333333333333333,,0.0023366730001725955,"Group assignments may have at most 4 members, and each member must state their individual contribution. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [3] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [2]",At most 4 members.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D05 p.1; D01 p.1; D09 p.1; D13 p.2 +rerank,test,A08,answerable,What happens if an assignment has a similarity index above 40%?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0026383910003460187,"A similarity index above 40% results in zero marks and referral to the Academic Integrity Committee. [1] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",It receives zero marks and is referred to the Academic Integrity Committee.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D13 p.2; D07 p.1; D03 p.1; D13 p.1 +rerank,test,A09,answerable,On what date do the odd semester end-semester examinations conclude?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,,0.0026621560000421596,The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1] Key Dates - Odd Semester 2025-26. [4],12 December 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D14 p.1; D06 p.2; D14 p.1; D01 p.2 +rerank,test,A10,answerable,What are the timings of the afternoon examination session?,answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,0.5,1.0,1.0,1.0,,0.002523472999655496,Afternoon session: 2:00 PM to 5:00 PM. [2],2:00 PM to 5:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D06 p.1; D06 p.1; D06 p.1; D06 p.2 +rerank,dev,A11,answerable,How early must students report before an examination session starts?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.002486767999926087,Students must report 30 minutes before the start of the session. [1],30 minutes before the start of the session.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D06 p.2 +rerank,dev,A12,answerable,On which date is the MDS302 Generative AI and LLMs examination?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,,0.002554904999669816,03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session. [1] All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [2],"03 December 2025, morning session.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D05 p.1; D04 p.2; D08 p.1; D14 p.1 +rerank,dev,A13,answerable,What type of calculator is permitted in the examination hall?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.002369778999764094,Only non-programmable scientific calculators are permitted in the examination hall. [1],Only non-programmable scientific calculators.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D03 p.1; D09 p.1; D03 p.1; D06 p.1 +rerank,test,A14,answerable,By when will the odd semester examination results be announced?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.002465374999701453,Results of the odd semester examinations will be announced by 15 January 2026. [1],By 15 January 2026.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D03 p.2; D06 p.1; D06 p.1; D06 p.1 +rerank,dev,A15,answerable,What tuition fee waiver does a student with a CGPA of 9.0 or above receive?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.001997927000047639,Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],A 50% tuition fee waiver.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D03 p.1; D03 p.1; D13 p.2; D10 p.2 +rerank,test,A16,answerable,What tuition fee waiver is given to students with a CGPA between 8.5 and 8.99?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0019718700000339595,Students with a CGPA between 8.5 and 8.99 receive a 25% tuition fee waiver. [1],A 25% tuition fee waiver.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D01 p.1 +rerank,test,A17,answerable,What is the amount of the need-based scholarship?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.001723024000057194,"A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1]","INR 30,000 per year.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D08 p.1; D07 p.1; D07 p.2; D08 p.1 +rerank,test,A18,answerable,What CGPA is required for a scholarship to be renewed?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0018071690001306706,Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [1],A CGPA of at least 8.0 (and no disciplinary action).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.2; D07 p.2; D07 p.1; D11 p.2; D08 p.1 +rerank,test,A19,answerable,Can a student hold an external scholarship together with a university scholarship?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0017851669999799924,Students may simultaneously hold one external (government or private) scholarship. [1],"Yes, a student may simultaneously hold one external (government or private) scholarship.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.2; D15 p.1; D08 p.1; D07 p.1; D08 p.1 +rerank,dev,A20,answerable,How many credits must a PG student register for in a semester?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0018172579998463334,PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1],A minimum of 18 and a maximum of 26 credits.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D15 p.1; D15 p.1; D09 p.2; D03 p.1 +rerank,test,A21,answerable,What is the fee for late course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0017873609999696782,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (late registration allowed until 22 July 2025).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D16 p.1; D10 p.2; D05 p.1; D09 p.1 +rerank,test,A22,answerable,How many open electives can a student register for per semester?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0018353930004195718,A student may register for a maximum of 2 open electives per semester. [1],A maximum of 2 open electives per semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D09 p.2; D14 p.1; D16 p.2; D11 p.1 +rerank,dev,A23,answerable,For how many semesters can a student take academic leave during the programme?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0019046319998778927,A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1],A maximum of two semesters.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D10 p.2; D10 p.1; D10 p.1; D13 p.1 +rerank,test,A24,answerable,How far in advance must an application for academic leave be submitted?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0019612480000432697,"Applications must be submitted to the Dean of Academics at least 30 days before the start of the semester, except in medical emergencies. [1] A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1]",At least 30 days before the start of the semester (except medical emergencies).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D10 p.1; D07 p.1; D10 p.2; D10 p.1 +rerank,test,A25,answerable,What fee must a student pay per semester while on academic leave?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.001811438000004273,"Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [1]","A registration retention fee of INR 5,000 per semester (no tuition fee).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D10 p.1; D10 p.1; D10 p.1; D10 p.2 +rerank,test,A26,answerable,What is the maximum duration allowed to complete a programme?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.002138392999768257,"The maximum duration to complete a programme is the normal duration plus two years, including any academic leave. [1]","The normal duration plus two years, including any academic leave.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D10 p.1; D04 p.1; D15 p.1; D15 p.1 +rerank,dev,A27,answerable,What are the Central Library's opening hours on Saturdays?,answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,0.5,0.5,,0.002104841000345914,"The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1] A contact hour is one scheduled hour of lecture, tutorial or laboratory work. [5]",9:00 AM to 5:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D11 p.2; D11 p.1; D11 p.2; D01 p.1 +rerank,test,A28,answerable,How many books can research scholars borrow and for how long?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.002115129999765486,Research scholars may borrow up to 8 books for 30 days. [1],Up to 8 books for 30 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D12 p.1; D11 p.2; D04 p.1; D10 p.1 +rerank,test,A29,answerable,Which grade is awarded for marks between 80 and 89?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.002284363999933703,Grade A+ (grade point 9): 80 to 89 marks. [1] Grades are awarded on a 10-point scale as follows. [1],Grade A+ (grade point 9).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.1; D13 p.2; D13 p.1; D13 p.1; D13 p.2 +rerank,test,A30,answerable,What minimum mark is needed in the end-semester examination to pass a course?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,0.5,1.0,0.5,0.5,,0.0022403200000553625,"To pass a course, a student must secure at least 40% marks in aggregate (internal assessment plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60). [2] A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [4]",At least 35% in the end-semester examination (21 out of 60).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D13 p.1; D13 p.1; D01 p.1; D01 p.1 +rerank,test,M01,multi_passage,"What minimum internal assessment marks are needed for exam eligibility, and how many marks is each internal test worth?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.002262139999857027,"Internal assessment consists of Internal Test 1 (15 marks), Internal Test 2 (15 marks), Assignment (5 marks), and Class participation and quizzes (5 marks). [1]",At least 16 out of 40 IA marks (40%); each internal test is worth 15 marks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D03 p.1; D04 p.1; D04 p.2; D04 p.1 +rerank,test,M02,multi_passage,"When is Internal Test 1 held this semester, and what must a student do to take a make-up test if they miss it through illness?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,1.0,1.0,1.0,1.0,1.0,1.0,,0.002266925999720115,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",1-5 September 2025; submit a medical certificate within 3 working days to take one make-up test.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D14 p.1 +rerank,dev,M03,multi_passage,"What happens to a student whose attendance is still short after condonation, and to whom can an eligibility decision be appealed?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.2,0.5,1.0,1.0,0.5,0.5,,0.0023346949997176125,"A student may appeal against an eligibility decision to the Controller of Examinations within 3 working days of the publication of the eligibility list. [1] Condonation on medical grounds is limited to 5% (that is, attendance between 75% and 80%). [2]",They are marked NE (Not Eligible) and must re-register; appeals go to the Controller of Examinations within 3 working days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.2; D02 p.1; D01 p.1; D03 p.1; D01 p.1 +rerank,test,M04,multi_passage,"Does approved medical leave count as attendance, and for how many days can a Head of Department approve medical leave?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0021950719997221313,Medical leave of up to 15 days within a semester may be approved by the Head of Department on submission of a medical certificate from a registered medical practitioner. [1] Approved medical leave does not count as attendance; it is considered only for condonation. [1],"No, it does not count as attendance (only for condonation); up to 15 days per semester.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D01 p.2; D10 p.1; D10 p.1; D02 p.1 +rerank,test,M05,multi_passage,"Do library dues affect examination eligibility, and what is charged for a lost library book?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0023288639999918814,Library dues do not affect examination eligibility but must be cleared before results are released. [1] An overdue fine of INR 5 per book per day is charged. [2] Lost books must be replaced or paid for at twice the current price. [2],"No, but they must be cleared before results are released; lost books cost twice the current price.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.2; D11 p.2; D03 p.1; D03 p.1; D12 p.1 +rerank,test,M06,multi_passage,"What CGPA is needed for First Class with Distinction, and what CGPA earns a 50% merit tuition waiver?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.002153816000372899,First Class with Distinction is awarded for a CGPA of 8.0 or above. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],8.0 or above for First Class with Distinction; 9.0 or above for a 50% waiver.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D13 p.2; D13 p.2; D03 p.1; D15 p.1 +rerank,test,M07,multi_passage,"Can reference books be borrowed, and how many times can a borrowed book be renewed?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.6666666666666666,0.5,,0.0020928179997099505,"A borrowed book may be renewed once if it has not been reserved by another member. [1] Reference books cannot be borrowed and must be used within the library. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [5]",Reference books cannot be borrowed; a borrowed book can be renewed once if not reserved.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.2; D12 p.1; D11 p.1; D07 p.2; D07 p.2 +rerank,test,M08,multi_passage,"How many internal assessment marks are given for assignments, and in what file format must assignments be submitted?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.8,1.0,0.5,1.0,1.0,0.5,,0.0022326819998852443,Assignments submitted after the deadline will not be accepted for internal assessment. [1] IA marks are published on AVU-Learn within 10 working days of each test. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [2],5 marks; as a single PDF file (max 10 MB).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.2; D05 p.1; D05 p.1; D04 p.1; D04 p.1 +rerank,test,M09,multi_passage,"When does odd semester course registration close, and what is the last date for late registration?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,0.5,1.0,0.6666666666666666,0.5,,0.0022173289999045664,"Course registration for the odd semester opens on 1 July 2025 and closes on 15 July 2025. [2] Last date for scholarship applications: 31 August 2025. [1] Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [2]",Closes 15 July 2025; late registration until 22 July 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D14 p.1; D09 p.1; D08 p.1; D14 p.1; D05 p.1 +rerank,dev,M10,multi_passage,When do odd semester classes begin and what is the last working day of the odd semester?,answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0021987249997437175,Last working day of the odd semester: 21 November 2025. [2] Odd semester classes begin on 21 July 2025. [1],Classes begin 21 July 2025; last working day 21 November 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D14 p.1; D14 p.1; D14 p.2; D09 p.2; D12 p.1 +rerank,test,M11,multi_passage,"What documents must be submitted for the need-based scholarship, and how recent must the income certificate be?",answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,2,0.4,1.0,1.0,1.0,0.5,0.5,,0.00206243299999187,"A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1] A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [5]","An income certificate from a competent authority issued within the last 6 months, and the previous year's marks card.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D08 p.1; D07 p.1; D08 p.1; D04 p.1 +rerank,dev,M12,multi_passage,"If a student qualifies for both the merit and need-based scholarships, what do they receive, and what is needed to renew it?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.4,1.0,0.5,1.0,0.3333333333333333,0.3333333333333333,,0.0022157429998515,"Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [5]",Only the higher-value scholarship; renewal needs a CGPA of at least 8.0 and no disciplinary action.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D07 p.2; D07 p.2; D05 p.1; D07 p.1 +rerank,dev,M13,multi_passage,How long is each internal test and in which weeks of the semester are they conducted?,answer,answered,False,False,True,True,False,correct,3,3,0.6,1.0,1.0,1.0,1.0,1.0,,0.0021184689999245165,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],60 minutes; in the 7th and 13th weeks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.2; D04 p.1; D04 p.1; D14 p.1 +rerank,dev,M14,multi_passage,"Within how many days are internal assessment marks published after a test, and how long do students have to request a review?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.002381407000029867,Students may request a review of IA marks within 5 working days of publication. [1] IA marks are published on AVU-Learn within 10 working days of each test. [1] Assignments submitted after the deadline will not be accepted for internal assessment. [1],Within 10 working days; review requests within 5 working days of publication.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.2; D04 p.1; D04 p.1; D04 p.1; D03 p.1 +rerank,dev,M15,multi_passage,"How long an extension can an instructor grant for an assignment, and what happens if the similarity index is above 20%?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0022379709998858743,A similarity index above 20% requires resubmission within 3 days. [1] Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [2],Up to 5 days if requested before the deadline; similarity above 20% requires resubmission within 3 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D05 p.1; D13 p.2; D07 p.1; D05 p.1 +rerank,test,M16,multi_passage,"Which MSc Data Science Semester 3 examination is held in the afternoon session, and what are the afternoon session timings?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.6,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,,0.002500170000075741,10 December 2025 (Wednesday): MDS305 Security for Data Science - Afternoon session. [2] MSc Data Science - Semester 3. [1] Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [5],MDS305 Security for Data Science on 10 December 2025; 2:00 PM to 5:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D13 p.2 +rerank,test,M17,multi_passage,"When are supplementary examinations held, and what is the maximum grade that can be awarded in them?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0024615480001557444,Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1],In June and July; the maximum grade is A.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D13 p.1; D13 p.2; D13 p.1; D13 p.1 +rerank,test,M18,multi_passage,"How many backlog courses prevent promotion to the next year, and when can backlogs be cleared through supplementary examinations?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.6666666666666666,0.5,,0.0025102069998865773,A student with more than 4 backlog courses at the end of an academic year will not be promoted to the next year. [1] Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1] Library dues do not affect examination eligibility but must be cleared before results are released. [2],More than 4 backlog courses; supplementary exams are held in June and July.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D03 p.2; D03 p.2; D11 p.2; D03 p.1 +rerank,test,M19,multi_passage,"How is participation in university-approved events treated for attendance, and who must approve it?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0024267779999718186,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1]",Counted as present for up to 10 contact hours per semester with prior approval of the Head of Department.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.2; D04 p.1; D04 p.1; D01 p.1; D02 p.1 +rerank,test,M20,multi_passage,"A student returning from academic leave must re-register within which window, and what are the regular odd semester registration dates?",answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,2,0.6,1.0,1.0,1.0,0.5,0.5,,0.002488232999894535,Students returning from leave must re-register within the regular registration window. [1] Key Dates - Odd Semester 2025-26. [4],Within the regular registration window: 1 July 2025 to 15 July 2025.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.2; D10 p.2; D09 p.1; D14 p.1; D10 p.1 +rerank,dev,N01,missing,What is the fee for revaluation of answer scripts?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.002249636000215105,Answer scripts of internal tests are retained by the department for one year. [1] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [2],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.2; D07 p.1; D01 p.1; D03 p.1; D03 p.1 +rerank,test,N02,missing,Who is the current Vice-Chancellor of Aranya Valley University?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0020933879995936877,(d) The student must have registered for the course in the current semester. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.1; D11 p.2; D01 p.1; D10 p.2; D11 p.2 +rerank,test,N03,missing,What is the annual hostel fee for PhD students?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0022529090001626173,"A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [2] Late payment of hostel dues attracts a fine of INR 500. [1] The mess fee is INR 4,500 per month, payable by the 10th of each month. [1]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D16 p.1; D07 p.1; D16 p.1; D16 p.2; D07 p.1 +rerank,test,N04,missing,Does the university offer a sports quota scholarship?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0022386030000234314,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [2]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.2; D07 p.2; D08 p.1; D07 p.1; D08 p.1 +rerank,test,N05,missing,What is the dress code during end-semester examinations?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0024942590002865472,The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D14 p.1; D01 p.2; D06 p.2; D03 p.1 +rerank,test,N06,missing,Can students take the end-semester examinations online from home?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0024529830002393282,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [4] The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D01 p.2; D14 p.1; D04 p.1; D06 p.2 +rerank,test,N07,missing,What minimum CGPA is required to sit for campus placements?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.002299146000041219,Scholarship holders must maintain a minimum of 75% attendance in every course. [1] Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [1] Campus Wi-Fi is available to residents with a daily limit of 5 GB. [2],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.2; D16 p.2; D16 p.1; D11 p.2; D16 p.1 +rerank,test,N08,missing,How many total credits are required to graduate from the MSc Data Science programme?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0024688159996912873,MSc Data Science - Semester 3. [1] The PG dissertation carries 12 credits and is evaluated by an internal guide and an external examiner. [3],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D15 p.1; D09 p.1; D06 p.2 +rerank,dev,N09,missing,What is the fee for a duplicate hall ticket?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.002520176999951218,Hall tickets are issued through the AVU-Learn portal 5 days before the first examination. [1] (c) The student must have no outstanding tuition fee dues. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.1; D06 p.2; D07 p.1; D01 p.1; D03 p.1 +rerank,test,N10,missing,On what date will the 2026 convocation ceremony be held?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0023785489997862896,Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1] Instructors must announce assignment topics at least two weeks before the due date. [4],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D14 p.2; D06 p.2; D04 p.2; D05 p.1 +rerank,dev,N11,missing,What is the university policy on using generative AI tools such as ChatGPT in assignments?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0024162640002032276,03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session. [1] Subscribed e-journals can be accessed off campus through the library remote access service using university credentials. [2],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D11 p.2; D05 p.1; D05 p.2; D04 p.2 +rerank,test,N12,missing,What is the parking fee for students' two-wheelers on campus?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.002155000000129803,"The mess fee is INR 4,500 per month, payable by the 10th of each month. [1] Campus Wi-Fi is available to residents with a daily limit of 5 GB. [2]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D16 p.1; D16 p.2; D16 p.1; D11 p.2; D07 p.1 +rerank,test,N13,missing,What is the late fine for paying tuition fees after the due date?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0025885420000122394,"Late payment of hostel dues attracts a fine of INR 500. [1] Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [4] Instructors must announce assignment topics at least two weeks before the due date. [2]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D16 p.1; D04 p.2; D05 p.1; D10 p.2; D09 p.1 +rerank,test,N14,missing,Does the university offer a tuition fee concession for siblings?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.0023206450000543555,"Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [4]",The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D01 p.1 +rerank,dev,N15,missing,What is the timetable for the even semester examinations in May 2026?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,,0.002395234000232449,Even semester classes begin on 5 January 2026. [2] Only non-programmable scientific calculators are permitted in the examination hall. [1],The documents do not contain this information; the system should abstain.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D14 p.2; D06 p.1; D06 p.1; D06 p.1 +rerank,test,I01,misleading,"Given that internal assessment carries 50 marks, how many marks does the end-semester examination carry?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.002593490999970527,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],The premise is wrong: IA carries 40 marks and the end-semester examination carries 60 marks.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D13 p.1; D13 p.1; D03 p.1; D15 p.1 +rerank,test,I02,misleading,"Since PG students can register for up to 30 credits, what is the minimum number of credits?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.5,0.5,,0.0023750550003569515,"PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2]","The maximum is 26, not 30; the minimum is 18.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D01 p.1; D15 p.1; D15 p.1; D09 p.2 +rerank,dev,I03,misleading,"As research scholars can borrow 10 books, what is their loan period?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.5,0.5,,0.0025678830002107134,"Research scholars may borrow up to 8 books for 30 days. [1] With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2]",Research scholars may borrow up to 8 books (not 10) for 30 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D12 p.1; D11 p.2; D06 p.1; D14 p.1 +rerank,test,I04,misleading,"Since a CGPA of 8.0 earns a 50% merit tuition waiver, what does a CGPA of 9.0 earn?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,,0.0023910079999041045,Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],The 50% waiver requires a CGPA of 9.0 or above; 8.5-8.99 earns 25%.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D07 p.1; D13 p.2; D07 p.2; D07 p.2; D15 p.1 +rerank,test,I05,misleading,"Given that academic leave can be taken for up to four semesters, how early must a student apply?",correct_premise,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.002389404000041395,A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1],Academic leave is limited to two semesters; apply at least 30 days before the semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D10 p.1; D10 p.2; D10 p.1; D10 p.1; D10 p.2 +rerank,test,I06,misleading,"As the MDS301 Deep Learning exam is in the afternoon session, what time does it start?",correct_premise,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.6,1.0,1.0,1.0,1.0,1.0,,0.0025926019998223637,01 December 2025 (Monday): MDS301 Deep Learning - Morning session. [1],"It is in the morning session (01 December 2025), which starts at 10:00 AM.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D07 p.2 +rerank,test,I07,misleading,"Since make-up internal tests are allowed for any reason, how many can a student take per semester?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0022734210001544852,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Make-up tests are only for medical grounds; one make-up test per semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D04 p.1; D04 p.1; D04 p.2; D04 p.1; D14 p.1 +rerank,dev,I08,misleading,What is the late fee for course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0022656719997939945,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (not the INR 500 hostel fine).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.1; D16 p.1; D10 p.2; D05 p.1; D09 p.1 +rerank,test,I09,misleading,Above what similarity percentage must an assignment be resubmitted?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.6666666666666666,0.5,,0.0023408800002471253,"A similarity index above 20% requires resubmission within 3 days. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",Above 20%.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.2; D01 p.1; D13 p.2; D07 p.1; D05 p.1 +rerank,dev,I10,misleading,At what time does the Central Library close on working days?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.0023085779998837097,The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1],10:00 PM.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D11 p.1; D12 p.1; D12 p.1; D03 p.2 +rerank,test,I11,misleading,How many days before the examinations is the attendance shortage list published?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0024746330000198213,The list of students with attendance shortage is published 7 days before the commencement of end-semester examinations. [1],7 days before the commencement of end-semester examinations.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.2; D03 p.2; D01 p.1; D01 p.1; D04 p.2 +rerank,dev,I12,misleading,How many contact hours of approved event participation can be counted as present?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,,0.002428366999993159,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1]",Up to 10 contact hours per semester.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.2; D01 p.1; D01 p.2; D10 p.1; D10 p.1 +rerank,test,I13,misleading,What is the minimum CGPA for First Class (without distinction)?,answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.4,1.0,1.0,1.0,0.5,0.5,,0.00246540600028311,First Class with Distinction is awarded for a CGPA of 8.0 or above. [1] Scholarship holders must maintain a minimum of 75% attendance in every course. [3],6.5 (First Class is CGPA 6.5 to 7.99).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D13 p.2; D13 p.2; D07 p.2; D03 p.1; D01 p.1 +rerank,test,I14,misleading,For how many days can a course instructor extend an assignment deadline?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,,0.0024232569999185216,Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [1] The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [5] Assignments must be submitted as a single PDF file of no more than 10 MB. [2],Up to 5 days.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D05 p.1; D04 p.2; D05 p.2; D08 p.1 +rerank,test,I15,misleading,Is a calculator with programmable memory allowed in the examination hall?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,,0.0024443439997412497,Only non-programmable scientific calculators are permitted in the examination hall. [1],No - only non-programmable scientific calculators are permitted.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D06 p.2; D03 p.1; D03 p.1; D06 p.1; D03 p.1 +rerank,test,C01,conflicting,What is the minimum attendance required to appear for end-semester examinations?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0024303649997818866,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1],Conflict: Attendance Regulations 2023 say 75%; Circular 2025/014 revises it to 80% from 2025-26 (supersedes).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D01 p.1; D03 p.1; D01 p.2; D02 p.1 +rerank,test,C02,conflicting,Up to what percentage can an attendance shortage be condoned on medical grounds?,flag_conflict,answered,False,False,True,False,False,missed conflict,2,2,1.0,1.0,1.0,1.0,1.0,1.0,,0.0023597469999003806,"The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [5]",Conflict: 10% under the 2023 regulations; limited to 5% by the 2025 circular.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D01 p.1; D02 p.1; D02 p.1; D01 p.1 +rerank,test,C03,conflicting,What is the condonation fee per course for attendance shortage?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.002495157999874209,"A condonation fee of INR 500 per course is payable before the condonation order is issued. [1] The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]","Conflict: INR 500 (2023 regulations) vs INR 1,000 (2025 circular).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D01 p.2; D01 p.1; D02 p.1; D02 p.1 +rerank,test,C04,conflicting,"According to the examination eligibility rules, what attendance is needed in a course to sit its end-semester exam?",flag_conflict,answered,False,False,False,False,True,missed conflict,0,2,0.4,0.5,1.0,1.0,0.5,0.5,,0.0025974129998758144,These rules determine whether a student may appear for the end-semester examination of a course. [1] A student may appeal against an eligibility decision to the Controller of Examinations within 3 working days of the publication of the eligibility list. [4],"Conflict: the eligibility rules (2024) state 75%, but the 2025 circular raises the requirement to 80%.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.1; D03 p.1; D06 p.1; D03 p.2; D01 p.1 +rerank,test,C05,conflicting,What is the last date to apply for a scholarship for 2025-26?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0023870340000939905,The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [1],Conflict: 31 August 2025 (policy) vs extended to 15 September 2025 (notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D08 p.1; D14 p.1; D07 p.1; D14 p.1; D07 p.1 +rerank,test,C06,conflicting,What is the family income limit for the need-based scholarship?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,0.5,0.5,,0.0021601469998131506,"The family income ceiling for the need-based scholarship is revised to INR 8,00,000. [1] Students may avail maternity leave of up to 6 months, which is counted within the academic leave limit. [5]","Conflict: INR 6,00,000 (policy) vs INR 8,00,000 (revised notice).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D08 p.1; D07 p.1; D07 p.1; D08 p.1; D10 p.1 +rerank,test,C07,conflicting,Are late assignment submissions accepted?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.002346767999824806,Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [1],Conflict: the Assignment Policy accepts up to 3 days late with 10%/day penalty; the IA Guidelines say late assignments will not be accepted for IA.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D05 p.1; D04 p.2; D09 p.1; D16 p.1 +rerank,dev,C08,conflicting,What is the penalty for submitting an assignment one day late?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.2,0.5,1.0,1.0,0.6666666666666666,0.5,,0.002386585999829549,Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] Assignments must be submitted as a single PDF file of no more than 10 MB. [1] Room allotment is valid for one academic year. [2],Conflict: 10% of maximum marks per day (Assignment Policy) vs not accepted at all (IA Guidelines).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D05 p.1; D16 p.1; D09 p.1; D14 p.1; D11 p.2 +rerank,test,C09,conflicting,How many books can a postgraduate student borrow from the library?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.0023536549997515976,Postgraduate students may borrow up to 5 books for 14 days. [1] Library hours during examination periods are extended until 12:00 midnight on working days. [2],Conflict: 5 books (2023 regulations) vs 6 books from 1 August 2025 (notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.1; D12 p.1; D11 p.2; D15 p.1; D15 p.1 +rerank,test,C10,conflicting,For how many days can a postgraduate student keep a borrowed library book?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,0.5,1.0,0.5,0.5,,0.002320097999927384,"With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2] Reference books cannot be borrowed and must be used within the library. [1]",Conflict: 14 days (2023) vs 21 days (2025 notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.2; D12 p.1; D11 p.1; D11 p.1; D12 p.1 +rerank,dev,C11,conflicting,What is the library overdue fine per book per day?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.002301929999703134,An overdue fine of INR 5 per book per day is charged. [1] Reference books cannot be borrowed and must be used within the library. [1],Conflict: INR 5 (2023) vs INR 10 (2025 notice).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D11 p.2; D12 p.1; D16 p.1; D14 p.1; D05 p.1 +rerank,dev,C12,conflicting,How long is the add/drop period for elective courses?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.002357706000111648,Add/drop period for electives: 7 working days from the start of classes. [2],Conflict: 10 working days (Registration Guidelines) vs 7 working days (Academic Calendar).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.2; D14 p.1; D12 p.1; D06 p.1; D09 p.1 +rerank,dev,C13,conflicting,What minimum aggregate percentage is needed to pass a postgraduate course?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,0.6666666666666666,0.5,,0.0024179179999919143,"PG students must obtain at least 50% marks in aggregate to pass a course. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [3] About this Handbook This handbook summarises key academic rules for postgraduate (PG) students. [1]",Conflict: 40% (Grading Policy) vs 50% for PG courses (PG Handbook).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D15 p.1; D15 p.1; D01 p.1; D13 p.1; D13 p.1 +rerank,test,C14,conflicting,On what date do the odd semester end-semester examinations begin?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0024492469997312583,Odd semester classes begin on 21 July 2025. [1] Key Dates - Odd Semester 2025-26. [1] The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [2],"Conflict: 1 December 2025 (Timetable, Oct 2025) vs 3 December 2025 (Academic Calendar, June 2025).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D14 p.1; D06 p.1; D14 p.1; D06 p.2; D14 p.2 +rerank,test,C15,conflicting,Can I drop an elective course 9 working days after classes start?,flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,1.0,1.0,1.0,1.0,1.0,,0.002476747000400792,Students may add or drop elective courses within 10 working days from the start of classes. [1],Conflict: allowed under the Registration Guidelines (10 working days) but not under the Academic Calendar (7 working days).,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D09 p.2; D14 p.1; D04 p.2; D12 p.1; D13 p.1 +rerank,dev,C16,conflicting,"If my attendance in a course is 78%, am I eligible for the end-semester examination?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.4,0.5,0.5,1.0,1.0,1.0,,0.0025277449999521195,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [2],"Conflict: eligible under the 2023 rule (75%), but below the 80% minimum under the 2025 circular (condonable between 75% and 80%).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D03 p.1; D01 p.1; D01 p.1; D03 p.1; D01 p.2 +rerank,test,C17,conflicting,"If a PG student scores 45% in aggregate in a course, do they pass?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,,0.0023926799999571813,PG students must obtain at least 50% marks in aggregate to pass a course. [1],"Conflict: pass under the Grading Policy (40%), fail under the PG Handbook (50%).","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D15 p.1; D15 p.1; D13 p.1; D13 p.1; D09 p.1 +rerank,test,C18,conflicting,What is the lowest attendance percentage that can be condoned on medical grounds?,flag_conflict,answered,False,False,True,False,False,missed conflict,2,2,1.0,1.0,1.0,1.0,1.0,1.0,,0.0024716409998291056,"The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [5]",Conflict: 65% under the 2023 regulations vs 75% under the 2025 circular.,"Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D02 p.1; D02 p.1; D01 p.1; D01 p.1 +rerank,test,C19,conflicting,"Which attendance rule is the latest, and what minimum attendance does it require?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,1.0,1.0,,0.0024092449998533993,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1],"Conflict: the 2025 circular (latest) requires 80%, superseding the 75% of the 2023 regulations.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D01 p.1; D02 p.1; D01 p.1; D07 p.2; D09 p.1 +rerank,dev,C20,conflicting,"According to the academic calendar, what is the scholarship application deadline, and has it changed?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,0.5,0.5,,0.002269583999805036,Last date for scholarship applications: 31 August 2025. [1] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [3],"Conflict: the calendar says 31 August 2025, but the notice extends it to 15 September 2025.","Baseline RAG always answers from the top retrieved passages; it performs no sufficiency, contradiction or citation checks.",D14 p.1; D07 p.1; D05 p.1; D08 p.1; D08 p.1 +verify,test,A01,answerable,How many marks are allotted to internal assessment in a theory course?,answer,answered,False,False,True,True,False,correct,1,1,0.25,1.0,1.0,1.0,1.0,1.0,0.705,0.008396505999826331,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],40 marks are allotted to internal assessment (the end-semester exam carries 60).,"Answered: relevance 0.58, coverage 0.69, 1/1 sentences verified against their citations.",D04 p.1; D04 p.1; D04 p.2; D04 p.2; D03 p.1; D13 p.1; D13 p.1; D14 p.1 +verify,test,A02,answerable,How many marks does the end-semester examination of a theory course carry?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.823,0.007180700999924738,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],60 marks.,"Answered: relevance 0.56, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D13 p.1; D13 p.1; D03 p.1; D03 p.1 +verify,test,A03,answerable,What is the duration of an internal test?,answer,answered,False,False,True,True,False,correct,1,1,0.5,1.0,1.0,1.0,1.0,1.0,0.953,0.006055558000298333,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],Internal tests are 60 minutes long.,"Answered: relevance 0.88, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D10 p.2; D10 p.1 +verify,test,A04,answerable,Within how many working days must a medical certificate be submitted to take a make-up test?,answer,answered,False,False,True,True,False,correct,1,1,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.95,0.005087377000108972,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Within 3 working days of the missed test.,"Answered: relevance 0.87, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D10 p.1; D04 p.2; D04 p.1; D10 p.1; D14 p.1 +verify,test,A05,answerable,By what time on the due date must assignments be submitted on AVU-Learn?,answer,answered,False,False,True,True,False,correct,1,1,0.3333333333333333,1.0,1.0,1.0,0.5,0.5,0.776,0.004482366000047477,"All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [5]",By 11:59 PM on the due date.,"Answered: relevance 0.67, coverage 0.77, 2/2 sentences verified against their citations.",D05 p.1; D04 p.2; D05 p.1; D07 p.1; D07 p.2; D03 p.1 +verify,dev,A06,answerable,What is the maximum file size allowed for an assignment submission?,answer,answered,False,False,True,True,False,correct,1,1,0.5,1.0,1.0,1.0,1.0,1.0,0.699,0.005024531000344723,Assignments must be submitted as a single PDF file of no more than 10 MB. [1] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [2],A single PDF of no more than 10 MB.,"Answered: relevance 0.57, coverage 0.68, 2/2 sentences verified against their citations.",D05 p.1; D05 p.1; D05 p.1; D05 p.2; D09 p.1; D04 p.2 +verify,dev,A07,answerable,What is the maximum number of members allowed in a group assignment?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,0.3333333333333333,0.3333333333333333,0.714,0.004094434999842633,"Group assignments may have at most 4 members, and each member must state their individual contribution. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [3]",At most 4 members.,"Answered: relevance 0.48, coverage 0.80, 3/3 sentences verified against their citations.",D05 p.2; D01 p.1; D05 p.1; D09 p.1; D05 p.1; D04 p.2 +verify,test,A08,answerable,What happens if an assignment has a similarity index above 40%?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,0.786,0.00457892999975229,"A similarity index above 40% results in zero marks and referral to the Academic Integrity Committee. [1] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",It receives zero marks and is referred to the Academic Integrity Committee.,"Answered: relevance 0.70, coverage 0.76, 2/2 sentences verified against their citations.",D05 p.2; D03 p.1; D13 p.1; D04 p.1; D05 p.1 +verify,test,A09,answerable,On what date do the odd semester end-semester examinations conclude?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,0.766,0.004989072000171291,The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1] Key Dates - Odd Semester 2025-26. [3],12 December 2025.,"Answered: relevance 0.66, coverage 0.76, 2/2 sentences verified against their citations.",D06 p.1; D14 p.1; D14 p.1; D06 p.2; D01 p.2 +verify,test,A10,answerable,What are the timings of the afternoon examination session?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.6,1.0,1.0,,,,0.0,0.0010756470001069829,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,2:00 PM to 5:00 PM.,"Abstained: evidence is insufficient (best passage relevance 0.53, query coverage 0.58; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: timings.",D06 p.1; D06 p.2; D06 p.1; D06 p.1; D06 p.2 +verify,dev,A11,answerable,How early must students report before an examination session starts?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,0.597,0.004854754000007233,Students must report 30 minutes before the start of the session. [1],30 minutes before the start of the session.,"Answered: relevance 0.34, coverage 0.65, 1/1 sentences verified against their citations.",D06 p.1; D06 p.1; D06 p.1; D06 p.2; D06 p.2 +verify,dev,A12,answerable,On which date is the MDS302 Generative AI and LLMs examination?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,0.873,0.003413606999856711,03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session. [1] All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [2],"03 December 2025, morning session.","Answered: relevance 0.75, coverage 0.93, 2/2 sentences verified against their citations.",D06 p.1; D05 p.1; D03 p.1; D04 p.2; D14 p.1 +verify,dev,A13,answerable,What type of calculator is permitted in the examination hall?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.652,0.002206385000135924,Only non-programmable scientific calculators are permitted in the examination hall. [1],Only non-programmable scientific calculators.,"Answered: relevance 0.42, coverage 0.71, 1/1 sentences verified against their citations.",D06 p.2; D03 p.1; D09 p.1; D03 p.1; D03 p.1 +verify,test,A14,answerable,By when will the odd semester examination results be announced?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.913,0.003305505999833258,Results of the odd semester examinations will be announced by 15 January 2026. [1],By 15 January 2026.,"Answered: relevance 0.78, coverage 1.00, 1/1 sentences verified against their citations.",D06 p.2; D06 p.1; D14 p.1; D14 p.1; D14 p.2 +verify,dev,A15,answerable,What tuition fee waiver does a student with a CGPA of 9.0 or above receive?,answer,answered,False,False,True,True,False,correct,1,1,0.14285714285714285,1.0,1.0,1.0,1.0,1.0,0.959,0.005044103999807703,Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],A 50% tuition fee waiver.,"Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D07 p.1; D03 p.1; D03 p.1; D13 p.2; D13 p.1; D13 p.2; D10 p.2 +verify,test,A16,answerable,What tuition fee waiver is given to students with a CGPA between 8.5 and 8.99?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.966,0.004403749999710271,Students with a CGPA between 8.5 and 8.99 receive a 25% tuition fee waiver. [1],A 25% tuition fee waiver.,"Answered: relevance 0.92, coverage 1.00, 1/1 sentences verified against their citations.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D13 p.2; D13 p.2 +verify,test,A17,answerable,What is the amount of the need-based scholarship?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,1,0.4,1.0,1.0,,,,0.0,0.0010570240001470665,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,"INR 30,000 per year.","Abstained: evidence is insufficient (best passage relevance 0.50, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: amount.",D07 p.1; D07 p.1; D08 p.1; D08 p.1; D07 p.2 +verify,test,A18,answerable,What CGPA is required for a scholarship to be renewed?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.921,0.004893504999927245,Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [1],A CGPA of at least 8.0 (and no disciplinary action).,"Answered: relevance 0.80, coverage 1.00, 1/1 sentences verified against their citations.",D07 p.2; D07 p.2; D07 p.1; D08 p.1; D13 p.2 +verify,test,A19,answerable,Can a student hold an external scholarship together with a university scholarship?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.676,0.0021029559998169134,Students may simultaneously hold one external (government or private) scholarship. [1],"Yes, a student may simultaneously hold one external (government or private) scholarship.","Answered: relevance 0.53, coverage 0.66, 1/1 sentences verified against their citations.",D07 p.2; D08 p.1; D07 p.2; D07 p.1; D08 p.1 +verify,dev,A20,answerable,How many credits must a PG student register for in a semester?,answer,answered,False,False,True,True,False,correct,2,2,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.913,0.005446904000109498,PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1],A minimum of 18 and a maximum of 26 credits.,"Answered: relevance 0.78, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D15 p.1; D09 p.2; D15 p.1; D03 p.1; D04 p.1 +verify,test,A21,answerable,What is the fee for late course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.2857142857142857,1.0,1.0,1.0,1.0,1.0,0.961,0.007294393999927706,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (late registration allowed until 22 July 2025).","Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D09 p.1; D09 p.2; D05 p.1; D10 p.2; D16 p.1; D04 p.2 +verify,test,A22,answerable,How many open electives can a student register for per semester?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.943,0.005150417000095331,A student may register for a maximum of 2 open electives per semester. [1],A maximum of 2 open electives per semester.,"Answered: relevance 0.86, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D09 p.2; D14 p.1; D03 p.1; D16 p.2; D12 p.1 +verify,dev,A23,answerable,For how many semesters can a student take academic leave during the programme?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,0.706,0.0050993099998777325,A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1],A maximum of two semesters.,"Answered: relevance 0.61, coverage 0.65, 1/1 sentences verified against their citations.",D10 p.1; D10 p.2; D10 p.1; D10 p.2; D10 p.1 +verify,test,A24,answerable,How far in advance must an application for academic leave be submitted?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,1,0.6,1.0,1.0,,,,0.0,0.0010877670001718798,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,At least 30 days before the start of the semester (except medical emergencies).,"Abstained: evidence is insufficient (best passage relevance 0.28, query coverage 0.50; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: far, advance.",D10 p.1; D10 p.1; D10 p.2; D10 p.2; D10 p.1 +verify,test,A25,answerable,What fee must a student pay per semester while on academic leave?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.944,0.005280663000121422,"Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [1]","A registration retention fee of INR 5,000 per semester (no tuition fee).","Answered: relevance 0.86, coverage 1.00, 1/1 sentences verified against their citations.",D10 p.2; D10 p.1; D10 p.1; D10 p.2; D10 p.1 +verify,test,A26,answerable,What is the maximum duration allowed to complete a programme?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.975,0.003979828999945312,"The maximum duration to complete a programme is the normal duration plus two years, including any academic leave. [1]","The normal duration plus two years, including any academic leave.","Answered: relevance 0.94, coverage 1.00, 1/1 sentences verified against their citations.",D10 p.2; D10 p.1; D09 p.1; D04 p.1; D15 p.1 +verify,dev,A27,answerable,What are the Central Library's opening hours on Saturdays?,answer,answered,False,False,True,True,False,correct,2,2,0.2857142857142857,1.0,1.0,1.0,0.5,0.5,0.641,0.003952480999942054,The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1] Library hours during examination periods are extended until 12:00 midnight on working days. [5],9:00 AM to 5:00 PM.,"Answered: relevance 0.38, coverage 0.73, 2/2 sentences verified against their citations.",D11 p.1; D11 p.2; D11 p.1; D11 p.2; D12 p.1; D16 p.2; D06 p.1 +verify,test,A28,answerable,How many books can research scholars borrow and for how long?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,0.96,0.005599469000117097,Research scholars may borrow up to 8 books for 30 days. [1],Up to 8 books for 30 days.,"Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D11 p.1; D11 p.2; D12 p.1; D04 p.1; D10 p.1 +verify,test,A29,answerable,Which grade is awarded for marks between 80 and 89?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,0.837,0.0037909739999122394,Grade A+ (grade point 9): 80 to 89 marks. [1] Grades are awarded on a 10-point scale as follows. [1],Grade A+ (grade point 9).,"Answered: relevance 0.72, coverage 0.87, 2/2 sentences verified against their citations.",D13 p.1; D13 p.2; D13 p.1; D13 p.2; D13 p.1 +verify,test,A30,answerable,What minimum mark is needed in the end-semester examination to pass a course?,answer,answered,False,False,True,True,False,correct,1,1,0.2857142857142857,1.0,1.0,1.0,0.5,0.5,0.719,0.009070761999737442,"To pass a course, a student must secure at least 40% marks in aggregate (internal assessment plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60). [1] A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [3]",At least 35% in the end-semester examination (21 out of 60).,"Answered: relevance 0.40, coverage 0.89, 2/2 sentences verified against their citations.",D13 p.1; D13 p.1; D01 p.1; D01 p.1; D03 p.1; D03 p.1; D04 p.1 +verify,test,M01,multi_passage,"What minimum internal assessment marks are needed for exam eligibility, and how many marks is each internal test worth?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.8,1.0,1.0,,,,0.0,0.001132696000240685,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,At least 16 out of 40 IA marks (40%); each internal test is worth 15 marks.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.49; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: minimum, exam, worth.",D04 p.1; D04 p.1; D04 p.1; D03 p.1; D04 p.2 +verify,test,M02,multi_passage,"When is Internal Test 1 held this semester, and what must a student do to take a make-up test if they miss it through illness?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,1.0,1.0,1.0,,,,0.0,0.001379105000069103,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,1-5 September 2025; submit a medical certificate within 3 working days to take one make-up test.,"Abstained: evidence is insufficient (best passage relevance 0.33, query coverage 0.56; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: held, through, illness.",D04 p.1; D04 p.1; D14 p.1; D04 p.1; D14 p.1 +verify,dev,M03,multi_passage,"What happens to a student whose attendance is still short after condonation, and to whom can an eligibility decision be appealed?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.2,0.5,1.0,,,,0.0,0.0012516830001914059,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,They are marked NE (Not Eligible) and must re-register; appeals go to the Controller of Examinations within 3 working days.,"Abstained: evidence is insufficient (best passage relevance 0.19, query coverage 0.42; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: happens, still, short.",D03 p.2; D01 p.1; D03 p.1; D01 p.1; D02 p.1 +verify,test,M04,multi_passage,"Does approved medical leave count as attendance, and for how many days can a Head of Department approve medical leave?",answer,answered,False,False,True,True,False,correct,2,2,0.42857142857142855,1.0,1.0,1.0,1.0,1.0,0.816,0.006429419999676611,Medical leave of up to 15 days within a semester may be approved by the Head of Department on submission of a medical certificate from a registered medical practitioner. [1] Approved medical leave does not count as attendance; it is considered only for condonation. [1],"No, it does not count as attendance (only for condonation); up to 15 days per semester.","Answered: relevance 0.73, coverage 0.81, 2/2 sentences verified against their citations.",D10 p.1; D10 p.1; D10 p.1; D01 p.2; D10 p.2; D04 p.1; D02 p.1 +verify,test,M05,multi_passage,"Do library dues affect examination eligibility, and what is charged for a lost library book?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,0.722,0.004015384000013,Library dues do not affect examination eligibility but must be cleared before results are released. [1] An overdue fine of INR 5 per book per day is charged. [2] Lost books must be replaced or paid for at twice the current price. [2],"No, but they must be cleared before results are released; lost books cost twice the current price.","Answered: relevance 0.53, coverage 0.78, 3/3 sentences verified against their citations.",D03 p.2; D11 p.2; D03 p.2; D03 p.1; D03 p.1 +verify,test,M06,multi_passage,"What CGPA is needed for First Class with Distinction, and what CGPA earns a 50% merit tuition waiver?",answer,answered,False,False,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.639,0.004307245999825682,First Class with Distinction is awarded for a CGPA of 8.0 or above. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],8.0 or above for First Class with Distinction; 9.0 or above for a 50% waiver.,"Answered: relevance 0.42, coverage 0.68, 2/2 sentences verified against their citations.",D07 p.1; D13 p.2; D13 p.2; D13 p.1; D07 p.2; D03 p.1 +verify,test,M07,multi_passage,"Can reference books be borrowed, and how many times can a borrowed book be renewed?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.6666666666666666,0.5,0.798,0.0045842370000173105,"A borrowed book may be renewed once if it has not been reserved by another member. [1] Reference books cannot be borrowed and must be used within the library. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [5]",Reference books cannot be borrowed; a borrowed book can be renewed once if not reserved.,"Answered: relevance 0.72, coverage 0.78, 3/3 sentences verified against their citations.",D11 p.2; D11 p.1; D12 p.1; D07 p.2; D07 p.2 +verify,test,M08,multi_passage,"How many internal assessment marks are given for assignments, and in what file format must assignments be submitted?",answer,conflict,False,True,False,False,True,wrong/irrelevant answer content,0,2,0.6666666666666666,1.0,0.5,1.0,1.0,0.5,0.661,0.008036675000312243,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [1] +- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [4] +The more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** IA marks are published on AVU-Learn within 10 working days of each test. [1]",5 marks; as a single PDF file (max 10 MB).,Answered with a conflict warning: 'Internal Assessment Guidelines 2024' and 'Assignment Submission Policy 2024' disagree (one passage permits what the other rules out).,D04 p.2; D05 p.1; D04 p.1; D05 p.1; D04 p.1; D14 p.1 +verify,test,M09,multi_passage,"When does odd semester course registration close, and what is the last date for late registration?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,0.6666666666666666,0.5,0.679,0.004349885000010545,"Course registration for the odd semester opens on 1 July 2025 and closes on 15 July 2025. [1] Last date for scholarship applications: 31 August 2025. [2] Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]",Closes 15 July 2025; late registration until 22 July 2025.,"Answered: relevance 0.36, coverage 0.84, 3/3 sentences verified against their citations.",D09 p.1; D14 p.1; D09 p.1; D09 p.2; D14 p.1 +verify,dev,M10,multi_passage,When do odd semester classes begin and what is the last working day of the odd semester?,answer,answered,False,False,True,True,False,correct,2,2,0.25,1.0,1.0,1.0,1.0,1.0,0.874,0.006995606999680604,Last working day of the odd semester: 21 November 2025. [2] Odd semester classes begin on 21 July 2025. [1],Classes begin 21 July 2025; last working day 21 November 2025.,"Answered: relevance 0.68, coverage 1.00, 2/2 sentences verified against their citations.",D14 p.1; D14 p.1; D14 p.2; D06 p.1; D06 p.2; D09 p.2; D12 p.1; D09 p.1 +verify,test,M11,multi_passage,"What documents must be submitted for the need-based scholarship, and how recent must the income certificate be?",answer,conflict,False,True,False,False,True,wrong/irrelevant answer content,0,2,0.4,1.0,1.0,1.0,0.3333333333333333,0.3333333333333333,0.751,0.005015601000195602,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Scholarship Policy 2025-26* (issued 2025-05-01): A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1] +- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The family income ceiling for the need-based scholarship is revised to INR 8,00,000. [2] +The more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [5]","An income certificate from a competent authority issued within the last 6 months, and the previous year's marks card.","Answered with a conflict warning: 'Scholarship Policy 2025-26' and 'Notice: Revision of Scholarship Deadline and Income Ceiling' disagree (inr: 600000 vs 800000 (context: family, income)).",D07 p.1; D08 p.1; D08 p.1; D07 p.1; D04 p.1 +verify,dev,M12,multi_passage,"If a student qualifies for both the merit and need-based scholarships, what do they receive, and what is needed to renew it?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.4,1.0,0.5,1.0,0.3333333333333333,0.3333333333333333,0.611,0.0023926949997985503,"Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [3]",Only the higher-value scholarship; renewal needs a CGPA of at least 8.0 and no disciplinary action.,"Answered: relevance 0.34, coverage 0.68, 3/3 sentences verified against their citations.",D07 p.1; D07 p.2; D07 p.1; D07 p.2; D05 p.1 +verify,dev,M13,multi_passage,How long is each internal test and in which weeks of the semester are they conducted?,answer,answered,False,False,True,True,False,correct,3,3,0.5,1.0,1.0,1.0,1.0,1.0,0.938,0.006314732000191725,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],60 minutes; in the 7th and 13th weeks.,"Answered: relevance 0.85, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D04 p.2; D10 p.2 +verify,dev,M14,multi_passage,"Within how many days are internal assessment marks published after a test, and how long do students have to request a review?",answer,answered,False,False,True,True,False,correct,2,2,0.14285714285714285,1.0,1.0,1.0,1.0,1.0,0.943,0.007832408000012947,Students may request a review of IA marks within 5 working days of publication. [1] IA marks are published on AVU-Learn within 10 working days of each test. [1] Assignments submitted after the deadline will not be accepted for internal assessment. [1],Within 10 working days; review requests within 5 working days of publication.,"Answered: relevance 0.86, coverage 1.00, 3/3 sentences verified against their citations.",D04 p.2; D04 p.1; D04 p.1; D04 p.1; D03 p.1; D03 p.2; D14 p.1 +verify,dev,M15,multi_passage,"How long an extension can an instructor grant for an assignment, and what happens if the similarity index is above 20%?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,0.647,0.0033030580002559873,A similarity index above 20% requires resubmission within 3 days. [1] Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [2],Up to 5 days if requested before the deadline; similarity above 20% requires resubmission within 3 days.,"Answered: relevance 0.44, coverage 0.68, 2/2 sentences verified against their citations.",D05 p.2; D05 p.1; D05 p.1; D14 p.2; D06 p.2 +verify,test,M16,multi_passage,"Which MSc Data Science Semester 3 examination is held in the afternoon session, and what are the afternoon session timings?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.6,1.0,1.0,1.0,1.0,1.0,0.646,0.004123691000131657,10 December 2025 (Wednesday): MDS305 Security for Data Science - Afternoon session. [2] MSc Data Science - Semester 3. [1],MDS305 Security for Data Science on 10 December 2025; 2:00 PM to 5:00 PM.,"Answered: relevance 0.50, coverage 0.62, 2/2 sentences verified against their citations.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D06 p.2 +verify,test,M17,multi_passage,"When are supplementary examinations held, and what is the maximum grade that can be awarded in them?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,0.966,0.0025977390000662126,Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1],In June and July; the maximum grade is A.,"Answered: relevance 0.92, coverage 1.00, 1/1 sentences verified against their citations.",D13 p.2; D13 p.2; D13 p.1; D13 p.1; D13 p.1 +verify,test,M18,multi_passage,"How many backlog courses prevent promotion to the next year, and when can backlogs be cleared through supplementary examinations?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.2,1.0,1.0,,,,0.0,0.001216815999669052,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,More than 4 backlog courses; supplementary exams are held in June and July.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.52; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: prevent, promotion, through.",D13 p.2; D03 p.2; D09 p.2; D04 p.2; D07 p.1 +verify,test,M19,multi_passage,"How is participation in university-approved events treated for attendance, and who must approve it?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.2,1.0,1.0,,,,0.0,0.001302092000059929,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Counted as present for up to 10 contact hours per semester with prior approval of the Head of Department.,"Abstained: evidence is insufficient (best passage relevance 0.49, query coverage 0.56; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: treated, approve.",D01 p.2; D01 p.1; D01 p.1; D02 p.1; D04 p.1 +verify,test,M20,multi_passage,"A student returning from academic leave must re-register within which window, and what are the regular odd semester registration dates?",answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,2,0.4,0.5,1.0,1.0,0.5,0.5,0.817,0.0025424049999855924,Students returning from leave must re-register within the regular registration window. [1] Key Dates - Odd Semester 2025-26. [5],Within the regular registration window: 1 July 2025 to 15 July 2025.,"Answered: relevance 0.64, coverage 0.90, 2/2 sentences verified against their citations.",D10 p.2; D10 p.2; D10 p.1; D10 p.1; D14 p.1 +verify,dev,N01,missing,What is the fee for revaluation of answer scripts?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0010842490000868565,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.45, query coverage 0.60; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: revaluation.",D04 p.2; D07 p.1; D01 p.1; D03 p.1; D03 p.1 +verify,test,N02,missing,Who is the current Vice-Chancellor of Aranya Valley University?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0011627659996520379,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.00, query coverage 0.00; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: current, vice-chancellor.",D10 p.2; D01 p.1; D04 p.2; D12 p.1; D03 p.2 +verify,test,N03,missing,What is the annual hostel fee for PhD students?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012063419999321923,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.30, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: phd.",D16 p.1; D16 p.1; D07 p.1; D07 p.1; D16 p.2 +verify,test,N04,missing,Does the university offer a sports quota scholarship?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012462469999263703,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.19, query coverage 0.36; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: offer, quota.",D08 p.1; D07 p.1; D07 p.2; D07 p.2; D01 p.2 +verify,test,N05,missing,What is the dress code during end-semester examinations?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012533809999695222,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.26, query coverage 0.22; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: dress, code.",D14 p.1; D06 p.1; D01 p.2; D03 p.1; D06 p.2 +verify,test,N06,missing,Can students take the end-semester examinations online from home?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012361500002953107,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.20, query coverage 0.17; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: take, online, home.",D06 p.1; D14 p.1; D01 p.2; D03 p.2; D03 p.1 +verify,test,N07,missing,What minimum CGPA is required to sit for campus placements?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012470700003177626,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.22, query coverage 0.36; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: sit, placements.",D16 p.2; D13 p.2; D07 p.2; D16 p.1; D01 p.1 +verify,test,N08,missing,How many total credits are required to graduate from the MSc Data Science programme?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012112119998164417,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: total, graduate.",D06 p.1; D06 p.1; D15 p.1; D09 p.1; D15 p.1 +verify,dev,N09,missing,What is the fee for a duplicate hall ticket?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,0.69,0.004948065000007773,Hall tickets are issued through the AVU-Learn portal 5 days before the first examination. [1] (c) The student must have no outstanding tuition fee dues. [1],The documents do not contain this information; the system should abstain.,"Answered: relevance 0.57, coverage 0.65, 2/2 sentences verified against their citations.",D03 p.1; D06 p.2; D07 p.1; D01 p.1; D03 p.1; D05 p.1 +verify,test,N10,missing,On what date will the 2026 convocation ceremony be held?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0011628859997472318,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.15, query coverage 0.28; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: date, convocation, ceremony.",D13 p.2; D14 p.2; D06 p.2; D04 p.2; D05 p.1 +verify,dev,N11,missing,What is the university policy on using generative AI tools such as ChatGPT in assignments?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012507999999797903,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.28, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: tools, chatgpt.",D06 p.1; D11 p.2; D05 p.1; D05 p.2; D04 p.2 +verify,test,N12,missing,What is the parking fee for students' two-wheelers on campus?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0012552230000437703,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.25, query coverage 0.33; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: parking, two-wheelers.",D16 p.2; D16 p.1; D07 p.1; D16 p.1; D11 p.2 +verify,test,N13,missing,What is the late fine for paying tuition fees after the due date?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,0.603,0.003932251999685832,"Late payment of hostel dues attracts a fine of INR 500. [2] Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [1]",The documents do not contain this information; the system should abstain.,"Answered: relevance 0.30, coverage 0.71, 2/2 sentences verified against their citations.",D10 p.2; D16 p.1; D05 p.1; D09 p.1; D07 p.1; D11 p.2 +verify,test,N14,missing,Does the university offer a tuition fee concession for siblings?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0011374069999874337,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.24, query coverage 0.27; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: offer, concession, siblings.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D10 p.1 +verify,dev,N15,missing,What is the timetable for the even semester examinations in May 2026?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,0.74,0.0049485489998915,Even semester classes begin on 5 January 2026. [3] Only non-programmable scientific calculators are permitted in the examination hall. [1],The documents do not contain this information; the system should abstain.,"Answered: relevance 0.52, coverage 0.83, 2/2 sentences verified against their citations.",D06 p.2; D06 p.1; D14 p.2; D14 p.1; D06 p.1 +verify,test,I01,misleading,"Given that internal assessment carries 50 marks, how many marks does the end-semester examination carry?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.775,0.008564137000121264,"**Note:** The question assumes 50 marks, but the documents state 40 marks. + +Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1]",The premise is wrong: IA carries 40 marks and the end-semester examination carries 60 marks.,"Answered: relevance 0.54, coverage 0.90, 1/1 sentences verified against their citations.",D04 p.1; D04 p.1; D13 p.1; D15 p.1; D13 p.1; D03 p.1 +verify,test,I02,misleading,"Since PG students can register for up to 30 credits, what is the minimum number of credits?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.5,0.5,0.709,0.004187723000086407,"**Note:** The question assumes 30 credits, but the documents state 26 credits. + +PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [4]","The maximum is 26, not 30; the minimum is 18.","Answered: relevance 0.51, coverage 0.76, 2/2 sentences verified against their citations.",D09 p.1; D15 p.1; D15 p.1; D01 p.1; D09 p.2 +verify,dev,I03,misleading,"As research scholars can borrow 10 books, what is their loan period?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.16666666666666666,1.0,1.0,1.0,0.5,0.5,0.687,0.005969724999886239,"**Note:** The question assumes 10 books, but the documents state 8 books. + +Research scholars may borrow up to 8 books for 30 days. [1] With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2]",Research scholars may borrow up to 8 books (not 10) for 30 days.,"Answered: relevance 0.52, coverage 0.70, 2/2 sentences verified against their citations.",D11 p.1; D12 p.1; D11 p.2; D05 p.1; D14 p.1; D14 p.2 +verify,test,I04,misleading,"Since a CGPA of 8.0 earns a 50% merit tuition waiver, what does a CGPA of 9.0 earn?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.698,0.003905069999746047,"**Note:** The question assumes 50, but the documents state 25. + +Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1]",The 50% waiver requires a CGPA of 9.0 or above; 8.5-8.99 earns 25%.,"Answered: relevance 0.48, coverage 0.77, 1/1 sentences verified against their citations.",D07 p.1; D07 p.2; D13 p.2; D07 p.2; D13 p.2; D03 p.1 +verify,test,I05,misleading,"Given that academic leave can be taken for up to four semesters, how early must a student apply?",correct_premise,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.6,1.0,1.0,,,,0.0,0.0011155600000165578,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Academic leave is limited to two semesters; apply at least 30 days before the semester.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.35; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: taken, four, early.",D10 p.1; D10 p.1; D10 p.2; D10 p.2; D10 p.1 +verify,test,I06,misleading,"As the MDS301 Deep Learning exam is in the afternoon session, what time does it start?",correct_premise,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.6,1.0,1.0,1.0,1.0,1.0,0.705,0.003932786999939708,01 December 2025 (Monday): MDS301 Deep Learning - Morning session. [1],"It is in the morning session (01 December 2025), which starts at 10:00 AM.","Answered: relevance 0.53, coverage 0.73, 1/1 sentences verified against their citations.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D07 p.2 +verify,test,I07,misleading,"Since make-up internal tests are allowed for any reason, how many can a student take per semester?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.702,0.003346067000165931,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Make-up tests are only for medical grounds; one make-up test per semester.,"Answered: relevance 0.56, coverage 0.70, 1/1 sentences verified against their citations.",D04 p.1; D04 p.2; D04 p.1; D04 p.1; D14 p.1; D10 p.1 +verify,dev,I08,misleading,What is the late fee for course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.2857142857142857,1.0,1.0,1.0,1.0,1.0,0.961,0.00735691299996688,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (not the INR 500 hostel fine).","Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D09 p.1; D09 p.2; D05 p.1; D10 p.2; D16 p.1; D04 p.2 +verify,test,I09,misleading,Above what similarity percentage must an assignment be resubmitted?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,0.6666666666666666,0.5,0.612,0.005436486000235163,"A similarity index above 20% requires resubmission within 3 days. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",Above 20%.,"Answered: relevance 0.41, coverage 0.62, 3/3 sentences verified against their citations.",D05 p.2; D01 p.1; D05 p.1; D05 p.1; D05 p.1; D13 p.1 +verify,dev,I10,misleading,At what time does the Central Library close on working days?,answer,partial,False,False,True,True,False,correct,1,1,0.2857142857142857,1.0,1.0,1.0,1.0,1.0,0.616,0.004988451999906829,The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1],10:00 PM.,"Partially answered: query coverage 0.59; not covered: time, close.",D11 p.1; D11 p.2; D12 p.1; D11 p.1; D12 p.1; D16 p.2; D06 p.1 +verify,test,I11,misleading,How many days before the examinations is the attendance shortage list published?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.927,0.004916921999665647,The list of students with attendance shortage is published 7 days before the commencement of end-semester examinations. [1],7 days before the commencement of end-semester examinations.,"Answered: relevance 0.82, coverage 1.00, 1/1 sentences verified against their citations.",D01 p.2; D01 p.1; D01 p.1; D03 p.2; D04 p.2 +verify,dev,I12,misleading,How many contact hours of approved event participation can be counted as present?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,0.5,0.5,0.863,0.0031055290000949753,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1] Medical leave of up to 15 days within a semester may be approved by the Head of Department on submission of a medical certificate from a registered medical practitioner. [3]",Up to 10 contact hours per semester.,"Answered: relevance 0.66, coverage 1.00, 2/2 sentences verified against their citations.",D01 p.2; D01 p.1; D10 p.1; D01 p.2; D10 p.1 +verify,test,I13,misleading,What is the minimum CGPA for First Class (without distinction)?,answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.4,1.0,1.0,1.0,0.5,0.5,0.678,0.0025382999997418665,First Class with Distinction is awarded for a CGPA of 8.0 or above. [1] Scholarship holders must maintain a minimum of 75% attendance in every course. [3],6.5 (First Class is CGPA 6.5 to 7.99).,"Answered: relevance 0.52, coverage 0.68, 2/2 sentences verified against their citations.",D13 p.2; D13 p.2; D07 p.2; D01 p.1; D13 p.1 +verify,test,I14,misleading,For how many days can a course instructor extend an assignment deadline?,answer,answered,False,False,True,True,False,correct,1,1,0.2857142857142857,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,0.722,0.005916249000165408,Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [1] The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [5] Assignments must be submitted as a single PDF file of no more than 10 MB. [2],Up to 5 days.,"Answered: relevance 0.51, coverage 0.79, 3/3 sentences verified against their citations.",D05 p.1; D05 p.1; D04 p.2; D08 p.1; D08 p.1; D02 p.1; D04 p.1 +verify,test,I15,misleading,Is a calculator with programmable memory allowed in the examination hall?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,1,0.2,1.0,0.5,,,,0.0,0.0011702619999596209,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,No - only non-programmable scientific calculators are permitted.,"Abstained: evidence is insufficient (best passage relevance 0.22, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: programmable, memory.",D03 p.1; D06 p.2; D03 p.1; D03 p.1; D06 p.1 +verify,test,C01,conflicting,What is the minimum attendance required to appear for end-semester examinations?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.42857142857142855,1.0,1.0,1.0,1.0,1.0,0.89,0.008005195999885473,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Attendance Regulations 2023* (issued 2023-06-15): A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1] +- *Circular: Amendment to Attendance Regulations* (issued 2025-06-02): With effect from the academic year 2025-26, the minimum attendance requirement for each course is revised to 80%. [5] +The more recent document is *Circular: Amendment to Attendance Regulations*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.",Conflict: Attendance Regulations 2023 say 75%; Circular 2025/014 revises it to 80% from 2025-26 (supersedes).,"Answered with a conflict warning: 'Attendance Regulations 2023' and 'Circular: Amendment to Attendance Regulations' disagree (%: 75 vs 80 (context: attendance, minimum)).",D01 p.1; D01 p.1; D03 p.1; D01 p.2; D02 p.1; D03 p.1; D03 p.2 +verify,test,C02,conflicting,Up to what percentage can an attendance shortage be condoned on medical grounds?,flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.6,1.0,1.0,,,,0.0,0.001197469000089768,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Conflict: 10% under the 2023 regulations; limited to 5% by the 2025 circular.,"Abstained: evidence is insufficient (best passage relevance 0.43, query coverage 0.50; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: percentage, condoned.",D01 p.1; D01 p.1; D01 p.2; D04 p.1; D02 p.1 +verify,test,C03,conflicting,What is the condonation fee per course for attendance shortage?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5714285714285714,1.0,1.0,1.0,1.0,1.0,0.937,0.012298363999889261,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Attendance Regulations 2023* (issued 2023-06-15): A condonation fee of INR 500 per course is payable before the condonation order is issued. [1] +- *Circular: Amendment to Attendance Regulations* (issued 2025-06-02): The condonation fee is revised to INR 1,000 per course. [4] +The more recent document is *Circular: Amendment to Attendance Regulations*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]","Conflict: INR 500 (2023 regulations) vs INR 1,000 (2025 circular).","Answered with a conflict warning: 'Attendance Regulations 2023' and 'Circular: Amendment to Attendance Regulations' disagree (inr: 500 vs 1000 (context: condonation, fee)).",D01 p.1; D01 p.1; D01 p.2; D02 p.1; D03 p.1; D02 p.1; D03 p.2 +verify,test,C04,conflicting,"According to the examination eligibility rules, what attendance is needed in a course to sit its end-semester exam?",flag_conflict,answered,False,False,False,False,True,missed conflict,0,2,0.6,0.5,1.0,1.0,0.5,0.5,0.647,0.0027169219997631444,These rules determine whether a student may appear for the end-semester examination of a course. [1] Students declared not eligible must re-register for the course when it is next offered and satisfy all eligibility conditions afresh. [2],"Conflict: the eligibility rules (2024) state 75%, but the 2025 circular raises the requirement to 80%.","Answered: relevance 0.49, coverage 0.62, 2/2 sentences verified against their citations.",D03 p.1; D03 p.2; D03 p.1; D03 p.2; D03 p.1 +verify,test,C05,conflicting,What is the last date to apply for a scholarship for 2025-26?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.42857142857142855,1.0,1.0,1.0,1.0,0.5,0.756,0.006123624999872845,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [1] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Last date for scholarship applications: 31 August 2025. [5] +The more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.",Conflict: 31 August 2025 (policy) vs extended to 15 September 2025 (notice).,"Answered with a conflict warning: 'Notice: Revision of Scholarship Deadline and Income Ceiling' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (date: 15 september 2025 vs 31 august 2025 (context: application, date, last, scholarship)).",D08 p.1; D08 p.1; D07 p.2; D07 p.2; D14 p.1; D14 p.1; D07 p.1 +verify,test,C06,conflicting,What is the family income limit for the need-based scholarship?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.8,1.0,1.0,1.0,1.0,1.0,0.791,0.004857865000303718,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Scholarship Policy 2025-26* (issued 2025-05-01): A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1] +- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The family income ceiling for the need-based scholarship is revised to INR 8,00,000. [2] +The more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.","Conflict: INR 6,00,000 (policy) vs INR 8,00,000 (revised notice).","Answered with a conflict warning: 'Scholarship Policy 2025-26' and 'Notice: Revision of Scholarship Deadline and Income Ceiling' disagree (inr: 600000 vs 800000 (context: family, income)).",D07 p.1; D08 p.1; D08 p.1; D07 p.1; D07 p.2 +verify,test,C07,conflicting,Are late assignment submissions accepted?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.8,1.0,1.0,1.0,1.0,1.0,0.94,0.006881173999772727,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] +- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [3] +The more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Assignments must be submitted as a single PDF file of no more than 10 MB. [1]",Conflict: the Assignment Policy accepts up to 3 days late with 10%/day penalty; the IA Guidelines say late assignments will not be accepted for IA.,Answered with a conflict warning: 'Assignment Submission Policy 2024' and 'Internal Assessment Guidelines 2024' disagree (one passage permits what the other rules out).,D05 p.1; D05 p.1; D04 p.2; D09 p.1; D05 p.1 +verify,dev,C08,conflicting,What is the penalty for submitting an assignment one day late?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.6666666666666666,1.0,1.0,1.0,1.0,1.0,0.737,0.005233553999914875,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] +- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [6] +The more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Assignments must be submitted as a single PDF file of no more than 10 MB. [1]",Conflict: 10% of maximum marks per day (Assignment Policy) vs not accepted at all (IA Guidelines).,Answered with a conflict warning: 'Assignment Submission Policy 2024' and 'Internal Assessment Guidelines 2024' disagree (one passage permits what the other rules out).,D05 p.1; D09 p.1; D05 p.1; D05 p.1; D14 p.1; D04 p.2 +verify,test,C09,conflicting,How many books can a postgraduate student borrow from the library?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.924,0.007949415999974008,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Central Library Regulations 2023* (issued 2023-07-01): Postgraduate students may borrow up to 5 books for 14 days. [1] +- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2] +The more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Library hours during examination periods are extended until 12:00 midnight on working days. [2]",Conflict: 5 books (2023 regulations) vs 6 books from 1 August 2025 (notice).,"Answered with a conflict warning: 'Central Library Regulations 2023' and 'Library Notice: Revised Borrowing Rules' disagree (books: 5 vs 6 (context: borrow, day, postgraduate)).",D11 p.1; D12 p.1; D11 p.2; D12 p.1; D11 p.2; D14 p.2 +verify,test,C10,conflicting,For how many days can a postgraduate student keep a borrowed library book?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5,1.0,0.5,1.0,0.6666666666666666,0.6666666666666666,0.665,0.00790857199990569,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Central Library Regulations 2023* (issued 2023-07-01): Postgraduate students may borrow up to 5 books for 14 days. [2] +- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [3] +The more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Reference books cannot be borrowed and must be used within the library. [1]",Conflict: 14 days (2023) vs 21 days (2025 notice).,"Answered with a conflict warning: 'Central Library Regulations 2023' and 'Library Notice: Revised Borrowing Rules' disagree (days: 14 vs 21 (context: book, borrow, postgraduate)).",D11 p.2; D11 p.1; D12 p.1; D12 p.1; D03 p.2; D14 p.2 +verify,dev,C11,conflicting,What is the library overdue fine per book per day?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.944,0.00814609000008204,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Central Library Regulations 2023* (issued 2023-07-01): An overdue fine of INR 5 per book per day is charged. [1] +- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): The overdue fine is revised to INR 10 per book per day. [2] +The more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Reference books cannot be borrowed and must be used within the library. [1]",Conflict: INR 5 (2023) vs INR 10 (2025 notice).,"Answered with a conflict warning: 'Central Library Regulations 2023' and 'Library Notice: Revised Borrowing Rules' disagree (inr: 5 vs 10 (context: book, day, fine, overdue)).",D11 p.2; D12 p.1; D12 p.1; D11 p.2; D11 p.1; D02 p.1; D11 p.1; D14 p.2 +verify,dev,C12,conflicting,How long is the add/drop period for elective courses?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,0.868,0.005213903999901959,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Course Registration Guidelines 2025* (issued 2025-06-05): Students may add or drop elective courses within 10 working days from the start of classes. [1] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Add/drop period for electives: 7 working days from the start of classes. [2] +The more recent document is *Academic Calendar 2025-26 (Odd Semester)*. Please confirm with the issuing office before relying on either version.",Conflict: 10 working days (Registration Guidelines) vs 7 working days (Academic Calendar).,"Answered with a conflict warning: 'Course Registration Guidelines 2025' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (working days: 10 vs 7 (context: add, class, drop, elective)).",D09 p.2; D14 p.1; D09 p.1; D01 p.1; D12 p.1 +verify,dev,C13,conflicting,What minimum aggregate percentage is needed to pass a postgraduate course?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5714285714285714,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,0.687,0.009258293000129925,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Postgraduate Programme Handbook 2025-26 (Extract)* (issued 2025-07-05): PG students must obtain at least 50% marks in aggregate to pass a course. [1] +- *Grading and Academic Progression Policy 2024* (issued 2024-04-02): To pass a course, a student must secure at least 40% marks in aggregate (internal assessment plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60). [4] +The more recent document is *Postgraduate Programme Handbook 2025-26 (Extract)*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2]",Conflict: 40% (Grading Policy) vs 50% for PG courses (PG Handbook).,"Answered with a conflict warning: 'Postgraduate Programme Handbook 2025-26 (Extract)' and 'Grading and Academic Progression Policy 2024' disagree (%: 50 vs 40 (context: aggregate, mark, pass)).",D15 p.1; D01 p.1; D15 p.1; D13 p.1; D13 p.1; D03 p.1; D04 p.1 +verify,test,C14,conflicting,On what date do the odd semester end-semester examinations begin?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.769,0.007638670999767783,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *End-Semester Examination Timetable - Odd Semester 2025-26* (issued 2025-10-20): The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): End-semester examinations: from 3 December 2025. [2] +The more recent document is *End-Semester Examination Timetable - Odd Semester 2025-26*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Odd semester classes begin on 21 July 2025. [3]","Conflict: 1 December 2025 (Timetable, Oct 2025) vs 3 December 2025 (Academic Calendar, June 2025).","Answered with a conflict warning: 'End-Semester Examination Timetable - Odd Semester 2025-26' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (date: 12 december 2025 vs 3 december 2025 (context: end-semester, examination)).",D06 p.1; D14 p.1; D14 p.1; D06 p.2; D14 p.2; D09 p.1 +verify,test,C15,conflicting,Can I drop an elective course 9 working days after classes start?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.798,0.005038296000293485,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Course Registration Guidelines 2025* (issued 2025-06-05): Students may add or drop elective courses within 10 working days from the start of classes. [1] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Add/drop period for electives: 7 working days from the start of classes. [2] +The more recent document is *Academic Calendar 2025-26 (Odd Semester)*. Please confirm with the issuing office before relying on either version.",Conflict: allowed under the Registration Guidelines (10 working days) but not under the Academic Calendar (7 working days).,"Answered with a conflict warning: 'Course Registration Guidelines 2025' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (working days: 10 vs 7 (context: add, class, drop, elective)).",D09 p.2; D14 p.1; D04 p.2; D12 p.1; D04 p.1; D12 p.1 +verify,dev,C16,conflicting,"If my attendance in a course is 78%, am I eligible for the end-semester examination?",flag_conflict,partial,False,False,False,False,False,missed conflict,1,2,0.4,0.5,1.0,1.0,1.0,1.0,0.633,0.0052528780001921405,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1],"Conflict: eligible under the 2023 rule (75%), but below the 80% minimum under the 2025 circular (condonable between 75% and 80%).",Partially answered: query coverage 0.56; not covered: 78%.,D01 p.1; D03 p.1; D03 p.1; D01 p.1; D13 p.1 +verify,test,C17,conflicting,"If a PG student scores 45% in aggregate in a course, do they pass?",flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.8,1.0,1.0,,,,0.0,0.001140153000051214,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,"Conflict: pass under the Grading Policy (40%), fail under the PG Handbook (50%).","Abstained: evidence is insufficient (best passage relevance 0.41, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: scores, 45%.",D15 p.1; D15 p.1; D13 p.1; D13 p.1; D09 p.1 +verify,test,C18,conflicting,What is the lowest attendance percentage that can be condoned on medical grounds?,flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.8,1.0,1.0,,,,0.0,0.0013763769998149655,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Conflict: 65% under the 2023 regulations vs 75% under the 2025 circular.,"Abstained: evidence is insufficient (best passage relevance 0.27, query coverage 0.30; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: lowest, percentage, condoned.",D01 p.1; D01 p.1; D01 p.1; D04 p.1; D02 p.1 +verify,test,C19,conflicting,"Which attendance rule is the latest, and what minimum attendance does it require?",flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.8,1.0,1.0,,,,0.0,0.0013397719999375113,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,"Conflict: the 2025 circular (latest) requires 80%, superseding the 75% of the 2023 regulations.","Abstained: evidence is insufficient (best passage relevance 0.38, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: latest.",D01 p.1; D02 p.1; D01 p.1; D10 p.1; D01 p.1 +verify,dev,C20,conflicting,"According to the academic calendar, what is the scholarship application deadline, and has it changed?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.8,1.0,1.0,1.0,1.0,1.0,0.581,0.003806237999924633,Last date for scholarship applications: 31 August 2025. [1],"Conflict: the calendar says 31 August 2025, but the notice extends it to 15 September 2025.","Answered: relevance 0.31, coverage 0.64, 1/1 sentences verified against their citations.",D14 p.1; D08 p.1; D08 p.1; D07 p.1; D14 p.1 +full,test,A01,answerable,How many marks are allotted to internal assessment in a theory course?,answer,answered,False,False,True,True,False,correct,1,1,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.705,0.009600066000075458,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],40 marks are allotted to internal assessment (the end-semester exam carries 60).,"Answered: relevance 0.58, coverage 0.69, 1/1 sentences verified against their citations.",D04 p.1; D04 p.1; D04 p.2; D13 p.1; D03 p.1; D14 p.1 +full,test,A02,answerable,How many marks does the end-semester examination of a theory course carry?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.823,0.009150366000085342,Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1],60 marks.,"Answered: relevance 0.56, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D13 p.1; D13 p.1; D03 p.1; D06 p.1 +full,test,A03,answerable,What is the duration of an internal test?,answer,answered,False,False,True,True,False,correct,1,1,0.5,1.0,1.0,1.0,1.0,1.0,0.953,0.008009520000086923,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],Internal tests are 60 minutes long.,"Answered: relevance 0.88, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D14 p.1; D10 p.2 +full,test,A04,answerable,Within how many working days must a medical certificate be submitted to take a make-up test?,answer,answered,False,False,True,True,False,correct,1,1,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.95,0.0063697179998598585,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Within 3 working days of the missed test.,"Answered: relevance 0.87, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D04 p.2; D10 p.1; D14 p.1; D04 p.1; D14 p.1 +full,test,A05,answerable,By what time on the due date must assignments be submitted on AVU-Learn?,answer,answered,False,False,True,True,False,correct,1,1,0.3333333333333333,1.0,1.0,1.0,0.5,0.5,0.776,0.005188836999877822,"All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [5]",By 11:59 PM on the due date.,"Answered: relevance 0.67, coverage 0.77, 2/2 sentences verified against their citations.",D05 p.1; D04 p.2; D05 p.1; D07 p.1; D07 p.2; D03 p.1 +full,dev,A06,answerable,What is the maximum file size allowed for an assignment submission?,answer,answered,False,False,True,True,False,correct,1,1,0.5,1.0,1.0,1.0,1.0,1.0,0.699,0.006257888000163803,Assignments must be submitted as a single PDF file of no more than 10 MB. [1] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1],A single PDF of no more than 10 MB.,"Answered: relevance 0.57, coverage 0.68, 2/2 sentences verified against their citations.",D05 p.1; D05 p.1; D05 p.2; D05 p.1; D10 p.1; D04 p.2 +full,dev,A07,answerable,What is the maximum number of members allowed in a group assignment?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,0.3333333333333333,0.3333333333333333,0.714,0.005306646999997611,"Group assignments may have at most 4 members, and each member must state their individual contribution. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [3] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [2]",At most 4 members.,"Answered: relevance 0.48, coverage 0.80, 3/3 sentences verified against their citations.",D05 p.2; D05 p.1; D01 p.1; D09 p.1; D13 p.2; D04 p.2 +full,test,A08,answerable,What happens if an assignment has a similarity index above 40%?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,0.786,0.006054114999642479,"A similarity index above 40% results in zero marks and referral to the Academic Integrity Committee. [1] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",It receives zero marks and is referred to the Academic Integrity Committee.,"Answered: relevance 0.70, coverage 0.76, 2/2 sentences verified against their citations.",D05 p.2; D13 p.2; D07 p.1; D03 p.1; D13 p.1 +full,test,A09,answerable,On what date do the odd semester end-semester examinations conclude?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,0.766,0.006045518000064476,The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [1] Key Dates - Odd Semester 2025-26. [4],12 December 2025.,"Answered: relevance 0.66, coverage 0.76, 2/2 sentences verified against their citations.",D06 p.1; D14 p.1; D06 p.2; D14 p.1; D01 p.2 +full,test,A10,answerable,What are the timings of the afternoon examination session?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.6,1.0,0.5,,,,0.0,0.0018772210000861378,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,2:00 PM to 5:00 PM.,"Abstained: evidence is insufficient (best passage relevance 0.53, query coverage 0.58; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: timings.",D06 p.2; D06 p.1; D06 p.1; D06 p.1; D06 p.2 +full,dev,A11,answerable,How early must students report before an examination session starts?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,0.597,0.005918256999848381,Students must report 30 minutes before the start of the session. [1],30 minutes before the start of the session.,"Answered: relevance 0.34, coverage 0.65, 1/1 sentences verified against their citations.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D06 p.2 +full,dev,A12,answerable,On which date is the MDS302 Generative AI and LLMs examination?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,0.5,0.5,0.873,0.004773797999860108,03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session. [1] All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date. [2],"03 December 2025, morning session.","Answered: relevance 0.75, coverage 0.93, 2/2 sentences verified against their citations.",D06 p.1; D05 p.1; D04 p.2; D08 p.1; D14 p.1 +full,dev,A13,answerable,What type of calculator is permitted in the examination hall?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.652,0.0029702789997827495,Only non-programmable scientific calculators are permitted in the examination hall. [1],Only non-programmable scientific calculators.,"Answered: relevance 0.42, coverage 0.71, 1/1 sentences verified against their citations.",D06 p.2; D03 p.1; D09 p.1; D03 p.1; D06 p.1 +full,test,A14,answerable,By when will the odd semester examination results be announced?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.913,0.006496087999948941,Results of the odd semester examinations will be announced by 15 January 2026. [1],By 15 January 2026.,"Answered: relevance 0.78, coverage 1.00, 1/1 sentences verified against their citations.",D06 p.2; D03 p.2; D06 p.1; D06 p.1; D06 p.1; D14 p.1 +full,dev,A15,answerable,What tuition fee waiver does a student with a CGPA of 9.0 or above receive?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.959,0.005352466000204004,Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],A 50% tuition fee waiver.,"Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D07 p.1; D03 p.1; D03 p.1; D13 p.2; D10 p.2 +full,test,A16,answerable,What tuition fee waiver is given to students with a CGPA between 8.5 and 8.99?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.966,0.005769994999809569,Students with a CGPA between 8.5 and 8.99 receive a 25% tuition fee waiver. [1],A 25% tuition fee waiver.,"Answered: relevance 0.92, coverage 1.00, 1/1 sentences verified against their citations.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D01 p.1; D13 p.2 +full,test,A17,answerable,What is the amount of the need-based scholarship?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,1,0.4,1.0,1.0,,,,0.0,0.0017612690003261378,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,"INR 30,000 per year.","Abstained: evidence is insufficient (best passage relevance 0.50, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: amount.",D07 p.1; D08 p.1; D07 p.1; D07 p.2; D08 p.1 +full,test,A18,answerable,What CGPA is required for a scholarship to be renewed?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.921,0.008319109000240132,Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [1],A CGPA of at least 8.0 (and no disciplinary action).,"Answered: relevance 0.80, coverage 1.00, 1/1 sentences verified against their citations.",D07 p.2; D07 p.2; D07 p.1; D11 p.2; D08 p.1 +full,test,A19,answerable,Can a student hold an external scholarship together with a university scholarship?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.676,0.002758883999831596,Students may simultaneously hold one external (government or private) scholarship. [1],"Yes, a student may simultaneously hold one external (government or private) scholarship.","Answered: relevance 0.53, coverage 0.66, 1/1 sentences verified against their citations.",D07 p.2; D15 p.1; D08 p.1; D07 p.1; D08 p.1 +full,dev,A20,answerable,How many credits must a PG student register for in a semester?,answer,answered,False,False,True,True,False,correct,2,2,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.913,0.006609226999898965,PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1],A minimum of 18 and a maximum of 26 credits.,"Answered: relevance 0.78, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D15 p.1; D15 p.1; D09 p.2; D03 p.1; D04 p.1 +full,test,A21,answerable,What is the fee for late course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.961,0.007944514999962848,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (late registration allowed until 22 July 2025).","Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D16 p.1; D10 p.2; D05 p.1; D09 p.1 +full,test,A22,answerable,How many open electives can a student register for per semester?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.943,0.006480368000211456,A student may register for a maximum of 2 open electives per semester. [1],A maximum of 2 open electives per semester.,"Answered: relevance 0.86, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D09 p.2; D14 p.1; D16 p.2; D11 p.1; D12 p.1 +full,dev,A23,answerable,For how many semesters can a student take academic leave during the programme?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,0.706,0.007250710999869625,A student may apply for academic leave (leave of absence) for a maximum of two semesters during the entire programme. [1],A maximum of two semesters.,"Answered: relevance 0.61, coverage 0.65, 1/1 sentences verified against their citations.",D10 p.1; D10 p.2; D10 p.1; D10 p.1; D13 p.1 +full,test,A24,answerable,How far in advance must an application for academic leave be submitted?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,1,0.6,1.0,1.0,,,,0.0,0.0018245280002702202,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,At least 30 days before the start of the semester (except medical emergencies).,"Abstained: evidence is insufficient (best passage relevance 0.28, query coverage 0.50; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: far, advance.",D10 p.1; D10 p.1; D07 p.1; D10 p.2; D10 p.1 +full,test,A25,answerable,What fee must a student pay per semester while on academic leave?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.944,0.006977784999889991,"Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [1]","A registration retention fee of INR 5,000 per semester (no tuition fee).","Answered: relevance 0.86, coverage 1.00, 1/1 sentences verified against their citations.",D10 p.2; D10 p.1; D10 p.1; D10 p.1; D10 p.2 +full,test,A26,answerable,What is the maximum duration allowed to complete a programme?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.975,0.005324344000200654,"The maximum duration to complete a programme is the normal duration plus two years, including any academic leave. [1]","The normal duration plus two years, including any academic leave.","Answered: relevance 0.94, coverage 1.00, 1/1 sentences verified against their citations.",D10 p.2; D10 p.1; D04 p.1; D15 p.1; D15 p.1 +full,dev,A27,answerable,What are the Central Library's opening hours on Saturdays?,answer,answered,False,False,True,True,False,correct,2,2,0.2857142857142857,1.0,1.0,1.0,0.5,0.5,0.641,0.0049316260001432966,"The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1] A contact hour is one scheduled hour of lecture, tutorial or laboratory work. [5]",9:00 AM to 5:00 PM.,"Answered: relevance 0.38, coverage 0.73, 2/2 sentences verified against their citations.",D11 p.1; D11 p.2; D11 p.1; D11 p.2; D01 p.1; D16 p.2; D06 p.1 +full,test,A28,answerable,How many books can research scholars borrow and for how long?,answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,0.96,0.006980878999911511,Research scholars may borrow up to 8 books for 30 days. [1],Up to 8 books for 30 days.,"Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D11 p.1; D12 p.1; D11 p.2; D04 p.1; D10 p.1 +full,test,A29,answerable,Which grade is awarded for marks between 80 and 89?,answer,answered,False,False,True,True,False,correct,1,1,0.6,1.0,1.0,1.0,1.0,1.0,0.837,0.004887426000095729,Grade A+ (grade point 9): 80 to 89 marks. [1] Grades are awarded on a 10-point scale as follows. [1],Grade A+ (grade point 9).,"Answered: relevance 0.72, coverage 0.87, 2/2 sentences verified against their citations.",D13 p.1; D13 p.2; D13 p.1; D13 p.1; D13 p.2 +full,test,A30,answerable,What minimum mark is needed in the end-semester examination to pass a course?,answer,answered,False,False,True,True,False,correct,1,1,0.3333333333333333,1.0,0.5,1.0,0.5,0.5,0.702,0.010946673000034934,"To pass a course, a student must secure at least 40% marks in aggregate (internal assessment plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60). [2] A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [4]",At least 35% in the end-semester examination (21 out of 60).,"Answered: relevance 0.47, coverage 0.79, 2/2 sentences verified against their citations.",D04 p.1; D13 p.1; D13 p.1; D01 p.1; D01 p.1; D03 p.1 +full,test,M01,multi_passage,"What minimum internal assessment marks are needed for exam eligibility, and how many marks is each internal test worth?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.8,1.0,1.0,,,,0.0,0.0020532419998744444,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,At least 16 out of 40 IA marks (40%); each internal test is worth 15 marks.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.49; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: minimum, exam, worth.",D04 p.1; D03 p.1; D04 p.1; D04 p.2; D04 p.1 +full,test,M02,multi_passage,"When is Internal Test 1 held this semester, and what must a student do to take a make-up test if they miss it through illness?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,1.0,1.0,1.0,,,,0.0,0.0021857259998796508,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,1-5 September 2025; submit a medical certificate within 3 working days to take one make-up test.,"Abstained: evidence is insufficient (best passage relevance 0.33, query coverage 0.56; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: held, through, illness.",D04 p.1; D04 p.1; D04 p.1; D14 p.1; D14 p.1 +full,dev,M03,multi_passage,"What happens to a student whose attendance is still short after condonation, and to whom can an eligibility decision be appealed?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.2,0.5,1.0,,,,0.0,0.002130190000116272,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,They are marked NE (Not Eligible) and must re-register; appeals go to the Controller of Examinations within 3 working days.,"Abstained: evidence is insufficient (best passage relevance 0.19, query coverage 0.42; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: happens, still, short.",D03 p.2; D02 p.1; D01 p.1; D03 p.1; D01 p.1 +full,test,M04,multi_passage,"Does approved medical leave count as attendance, and for how many days can a Head of Department approve medical leave?",answer,answered,False,False,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.816,0.007714199000020017,Medical leave of up to 15 days within a semester may be approved by the Head of Department on submission of a medical certificate from a registered medical practitioner. [1] Approved medical leave does not count as attendance; it is considered only for condonation. [1],"No, it does not count as attendance (only for condonation); up to 15 days per semester.","Answered: relevance 0.73, coverage 0.81, 2/2 sentences verified against their citations.",D10 p.1; D01 p.2; D10 p.1; D10 p.1; D02 p.1; D04 p.1 +full,test,M05,multi_passage,"Do library dues affect examination eligibility, and what is charged for a lost library book?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,0.722,0.005036817000018345,Library dues do not affect examination eligibility but must be cleared before results are released. [1] An overdue fine of INR 5 per book per day is charged. [2] Lost books must be replaced or paid for at twice the current price. [2],"No, but they must be cleared before results are released; lost books cost twice the current price.","Answered: relevance 0.53, coverage 0.78, 3/3 sentences verified against their citations.",D03 p.2; D11 p.2; D03 p.1; D03 p.1; D12 p.1 +full,test,M06,multi_passage,"What CGPA is needed for First Class with Distinction, and what CGPA earns a 50% merit tuition waiver?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,0.639,0.005225123999935022,First Class with Distinction is awarded for a CGPA of 8.0 or above. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1],8.0 or above for First Class with Distinction; 9.0 or above for a 50% waiver.,"Answered: relevance 0.42, coverage 0.68, 2/2 sentences verified against their citations.",D07 p.1; D13 p.2; D13 p.2; D03 p.1; D15 p.1 +full,test,M07,multi_passage,"Can reference books be borrowed, and how many times can a borrowed book be renewed?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.6666666666666666,0.5,0.798,0.0057380050002393546,"A borrowed book may be renewed once if it has not been reserved by another member. [1] Reference books cannot be borrowed and must be used within the library. [1] A student may hold only one university scholarship at a time; if eligible for more than one, the higher-value scholarship is awarded. [5]",Reference books cannot be borrowed; a borrowed book can be renewed once if not reserved.,"Answered: relevance 0.72, coverage 0.78, 3/3 sentences verified against their citations.",D11 p.2; D12 p.1; D11 p.1; D07 p.2; D07 p.2 +full,test,M08,multi_passage,"How many internal assessment marks are given for assignments, and in what file format must assignments be submitted?",answer,conflict,False,True,False,False,True,wrong/irrelevant answer content,0,2,0.6666666666666666,1.0,0.5,1.0,1.0,0.5,0.661,0.009438232000320568,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [1] +- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [2] +The more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** IA marks are published on AVU-Learn within 10 working days of each test. [1]",5 marks; as a single PDF file (max 10 MB).,Answered with a conflict warning: 'Internal Assessment Guidelines 2024' and 'Assignment Submission Policy 2024' disagree (one passage permits what the other rules out).,D04 p.2; D05 p.1; D05 p.1; D04 p.1; D04 p.1; D14 p.1 +full,test,M09,multi_passage,"When does odd semester course registration close, and what is the last date for late registration?",answer,answered,False,False,True,True,False,correct,2,2,0.2,1.0,0.5,1.0,0.6666666666666666,0.5,0.679,0.00559464099978868,"Course registration for the odd semester opens on 1 July 2025 and closes on 15 July 2025. [2] Last date for scholarship applications: 31 August 2025. [1] Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [2]",Closes 15 July 2025; late registration until 22 July 2025.,"Answered: relevance 0.36, coverage 0.84, 3/3 sentences verified against their citations.",D14 p.1; D09 p.1; D08 p.1; D14 p.1; D05 p.1 +full,dev,M10,multi_passage,When do odd semester classes begin and what is the last working day of the odd semester?,answer,answered,False,False,True,True,False,correct,2,2,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.874,0.007348861000082252,Last working day of the odd semester: 21 November 2025. [2] Odd semester classes begin on 21 July 2025. [1],Classes begin 21 July 2025; last working day 21 November 2025.,"Answered: relevance 0.68, coverage 1.00, 2/2 sentences verified against their citations.",D14 p.1; D14 p.1; D14 p.2; D09 p.2; D12 p.1; D09 p.1 +full,test,M11,multi_passage,"What documents must be submitted for the need-based scholarship, and how recent must the income certificate be?",answer,conflict,False,True,False,False,True,wrong/irrelevant answer content,0,2,0.4,1.0,1.0,1.0,0.3333333333333333,0.3333333333333333,0.751,0.0061469819997910236,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Scholarship Policy 2025-26* (issued 2025-05-01): A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [1] +- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The family income ceiling for the need-based scholarship is revised to INR 8,00,000. [2] +The more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [5]","An income certificate from a competent authority issued within the last 6 months, and the previous year's marks card.","Answered with a conflict warning: 'Scholarship Policy 2025-26' and 'Notice: Revision of Scholarship Deadline and Income Ceiling' disagree (inr: 600000 vs 800000 (context: family, income)).",D07 p.1; D08 p.1; D07 p.1; D08 p.1; D04 p.1 +full,dev,M12,multi_passage,"If a student qualifies for both the merit and need-based scholarships, what do they receive, and what is needed to renew it?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.4,1.0,0.5,1.0,0.3333333333333333,0.3333333333333333,0.611,0.0030871939998178277,"Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action. [2] Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1] A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [5]",Only the higher-value scholarship; renewal needs a CGPA of at least 8.0 and no disciplinary action.,"Answered: relevance 0.34, coverage 0.68, 3/3 sentences verified against their citations.",D07 p.1; D07 p.2; D07 p.2; D05 p.1; D07 p.1 +full,dev,M13,multi_passage,How long is each internal test and in which weeks of the semester are they conducted?,answer,answered,False,False,True,True,False,correct,3,3,0.5,1.0,1.0,1.0,1.0,1.0,0.938,0.007988646000285371,Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester. [1],60 minutes; in the 7th and 13th weeks.,"Answered: relevance 0.85, coverage 1.00, 1/1 sentences verified against their citations.",D04 p.1; D04 p.2; D04 p.1; D04 p.1; D14 p.1; D10 p.2 +full,dev,M14,multi_passage,"Within how many days are internal assessment marks published after a test, and how long do students have to request a review?",answer,answered,False,False,True,True,False,correct,2,2,0.125,1.0,1.0,1.0,1.0,1.0,0.943,0.010044879999895784,Students may request a review of IA marks within 5 working days of publication. [1] IA marks are published on AVU-Learn within 10 working days of each test. [1] Assignments submitted after the deadline will not be accepted for internal assessment. [1],Within 10 working days; review requests within 5 working days of publication.,"Answered: relevance 0.86, coverage 1.00, 3/3 sentences verified against their citations.",D04 p.2; D04 p.1; D04 p.1; D04 p.1; D03 p.1; D03 p.2; D01 p.2; D14 p.1 +full,dev,M15,multi_passage,"How long an extension can an instructor grant for an assignment, and what happens if the similarity index is above 20%?",answer,answered,False,False,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,0.647,0.004601490999903035,A similarity index above 20% requires resubmission within 3 days. [1] Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [2],Up to 5 days if requested before the deadline; similarity above 20% requires resubmission within 3 days.,"Answered: relevance 0.44, coverage 0.68, 2/2 sentences verified against their citations.",D05 p.2; D05 p.1; D13 p.2; D07 p.1; D05 p.1 +full,test,M16,multi_passage,"Which MSc Data Science Semester 3 examination is held in the afternoon session, and what are the afternoon session timings?",answer,answered,False,False,False,False,False,incomplete answer (some key facts missing),1,2,0.6,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,0.646,0.005474213000070449,10 December 2025 (Wednesday): MDS305 Security for Data Science - Afternoon session. [2] MSc Data Science - Semester 3. [1] Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [5],MDS305 Security for Data Science on 10 December 2025; 2:00 PM to 5:00 PM.,"Answered: relevance 0.50, coverage 0.62, 3/3 sentences verified against their citations.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D13 p.2 +full,test,M17,multi_passage,"When are supplementary examinations held, and what is the maximum grade that can be awarded in them?",answer,answered,False,False,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,0.966,0.0034191419999842765,Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A. [1],In June and July; the maximum grade is A.,"Answered: relevance 0.92, coverage 1.00, 1/1 sentences verified against their citations.",D13 p.2; D13 p.1; D13 p.2; D13 p.1; D13 p.1 +full,test,M18,multi_passage,"How many backlog courses prevent promotion to the next year, and when can backlogs be cleared through supplementary examinations?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.2,1.0,1.0,,,,0.0,0.0019350930001564848,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,More than 4 backlog courses; supplementary exams are held in June and July.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.52; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: prevent, promotion, through.",D13 p.2; D03 p.2; D03 p.2; D11 p.2; D03 p.1 +full,test,M19,multi_passage,"How is participation in university-approved events treated for attendance, and who must approve it?",answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.2,1.0,1.0,,,,0.0,0.002013205999901402,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Counted as present for up to 10 contact hours per semester with prior approval of the Head of Department.,"Abstained: evidence is insufficient (best passage relevance 0.49, query coverage 0.56; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: treated, approve.",D01 p.2; D04 p.1; D04 p.1; D01 p.1; D02 p.1 +full,test,M20,multi_passage,"A student returning from academic leave must re-register within which window, and what are the regular odd semester registration dates?",answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,2,0.6,1.0,1.0,1.0,0.5,0.5,0.794,0.004008889000033378,Students returning from leave must re-register within the regular registration window. [1] Key Dates - Odd Semester 2025-26. [4],Within the regular registration window: 1 July 2025 to 15 July 2025.,"Answered: relevance 0.64, coverage 0.84, 2/2 sentences verified against their citations.",D10 p.2; D10 p.2; D09 p.1; D14 p.1; D10 p.1 +full,dev,N01,missing,What is the fee for revaluation of answer scripts?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0018353510004089912,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.45, query coverage 0.60; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: revaluation.",D04 p.2; D07 p.1; D01 p.1; D03 p.1; D03 p.1 +full,test,N02,missing,Who is the current Vice-Chancellor of Aranya Valley University?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0018309110000700457,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.31, query coverage 0.41; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: vice-chancellor.",D03 p.1; D11 p.2; D01 p.1; D10 p.2; D11 p.2 +full,test,N03,missing,What is the annual hostel fee for PhD students?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.001980606999950396,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.30, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: phd.",D16 p.1; D07 p.1; D16 p.1; D16 p.2; D07 p.1 +full,test,N04,missing,Does the university offer a sports quota scholarship?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0019109219997517357,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.19, query coverage 0.36; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: offer, quota.",D01 p.2; D07 p.2; D08 p.1; D07 p.1; D08 p.1 +full,test,N05,missing,What is the dress code during end-semester examinations?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0020464369999899645,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.26, query coverage 0.22; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: dress, code.",D06 p.1; D14 p.1; D01 p.2; D06 p.2; D03 p.1 +full,test,N06,missing,Can students take the end-semester examinations online from home?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.002005459999963932,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.20, query coverage 0.17; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: take, online, home.",D06 p.1; D01 p.2; D14 p.1; D04 p.1; D06 p.2 +full,test,N07,missing,What minimum CGPA is required to sit for campus placements?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0019865780000145605,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.22, query coverage 0.36; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: sit, placements.",D07 p.2; D16 p.2; D16 p.1; D11 p.2; D16 p.1 +full,test,N08,missing,How many total credits are required to graduate from the MSc Data Science programme?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0020450309998523153,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.51; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: total, graduate.",D06 p.1; D06 p.1; D15 p.1; D09 p.1; D06 p.2 +full,dev,N09,missing,What is the fee for a duplicate hall ticket?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,0.69,0.006111887000315619,Hall tickets are issued through the AVU-Learn portal 5 days before the first examination. [1] (c) The student must have no outstanding tuition fee dues. [1],The documents do not contain this information; the system should abstain.,"Answered: relevance 0.57, coverage 0.65, 2/2 sentences verified against their citations.",D03 p.1; D06 p.2; D07 p.1; D01 p.1; D03 p.1; D05 p.1 +full,test,N10,missing,On what date will the 2026 convocation ceremony be held?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0018075500001941691,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.15, query coverage 0.28; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: date, convocation, ceremony.",D13 p.2; D14 p.2; D06 p.2; D04 p.2; D05 p.1 +full,dev,N11,missing,What is the university policy on using generative AI tools such as ChatGPT in assignments?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.001980124000056094,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.28, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: tools, chatgpt.",D06 p.1; D11 p.2; D05 p.1; D05 p.2; D04 p.2 +full,test,N12,missing,What is the parking fee for students' two-wheelers on campus?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.001906872999825282,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.25, query coverage 0.33; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: parking, two-wheelers.",D16 p.1; D16 p.2; D16 p.1; D11 p.2; D07 p.1 +full,test,N13,missing,What is the late fine for paying tuition fees after the due date?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,0.566,0.004928844000005483,"Late payment of hostel dues attracts a fine of INR 500. [1] Students on academic leave are not charged tuition fees for the leave semester but must pay a registration retention fee of INR 5,000 per semester. [4] Instructors must announce assignment topics at least two weeks before the due date. [2]",The documents do not contain this information; the system should abstain.,"Answered: relevance 0.30, coverage 0.62, 3/3 sentences verified against their citations.",D16 p.1; D04 p.2; D05 p.1; D10 p.2; D09 p.1; D05 p.1 +full,test,N14,missing,Does the university offer a tuition fee concession for siblings?,abstain,abstained,True,False,True,True,False,correct,0,0,,,,,,,0.0,0.0017916960000547988,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,The documents do not contain this information; the system should abstain.,"Abstained: evidence is insufficient (best passage relevance 0.24, query coverage 0.27; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: offer, concession, siblings.",D07 p.1; D03 p.1; D03 p.1; D10 p.2; D01 p.1 +full,dev,N15,missing,What is the timetable for the even semester examinations in May 2026?,abstain,answered,False,False,False,False,True,answered unanswerable question (hallucination risk),0,0,,,,1.0,0.0,0.0,0.74,0.006405010999969818,Even semester classes begin on 5 January 2026. [2] Only non-programmable scientific calculators are permitted in the examination hall. [1],The documents do not contain this information; the system should abstain.,"Answered: relevance 0.52, coverage 0.83, 2/2 sentences verified against their citations.",D06 p.2; D14 p.2; D06 p.1; D06 p.1; D06 p.1; D14 p.1 +full,test,I01,misleading,"Given that internal assessment carries 50 marks, how many marks does the end-semester examination carry?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,1.0,1.0,0.775,0.010131447999810916,"**Note:** The question assumes 50 marks, but the documents state 40 marks. + +Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks for the end-semester examination. [1]",The premise is wrong: IA carries 40 marks and the end-semester examination carries 60 marks.,"Answered: relevance 0.54, coverage 0.90, 1/1 sentences verified against their citations.",D04 p.1; D13 p.1; D13 p.1; D03 p.1; D15 p.1 +full,test,I02,misleading,"Since PG students can register for up to 30 credits, what is the minimum number of credits?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.2,1.0,1.0,1.0,0.5,0.5,0.709,0.0051478420000421465,"**Note:** The question assumes 30 credits, but the documents state 26 credits. + +PG students must register for a minimum of 18 and a maximum of 26 credits per semester. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2]","The maximum is 26, not 30; the minimum is 18.","Answered: relevance 0.51, coverage 0.76, 2/2 sentences verified against their citations.",D09 p.1; D01 p.1; D15 p.1; D15 p.1; D09 p.2 +full,dev,I03,misleading,"As research scholars can borrow 10 books, what is their loan period?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.16666666666666666,1.0,1.0,1.0,0.5,0.5,0.687,0.006781119000152103,"**Note:** The question assumes 10 books, but the documents state 8 books. + +Research scholars may borrow up to 8 books for 30 days. [1] With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2]",Research scholars may borrow up to 8 books (not 10) for 30 days.,"Answered: relevance 0.52, coverage 0.70, 2/2 sentences verified against their citations.",D11 p.1; D12 p.1; D11 p.2; D06 p.1; D14 p.1; D14 p.2 +full,test,I04,misleading,"Since a CGPA of 8.0 earns a 50% merit tuition waiver, what does a CGPA of 9.0 earn?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.16666666666666666,1.0,1.0,1.0,1.0,1.0,0.698,0.004830072000004293,"**Note:** The question assumes 50, but the documents state 25. + +Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver. [1]",The 50% waiver requires a CGPA of 9.0 or above; 8.5-8.99 earns 25%.,"Answered: relevance 0.48, coverage 0.77, 1/1 sentences verified against their citations.",D07 p.1; D13 p.2; D07 p.2; D07 p.2; D15 p.1; D03 p.1 +full,test,I05,misleading,"Given that academic leave can be taken for up to four semesters, how early must a student apply?",correct_premise,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.6,1.0,1.0,,,,0.0,0.001961440999821207,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Academic leave is limited to two semesters; apply at least 30 days before the semester.,"Abstained: evidence is insufficient (best passage relevance 0.35, query coverage 0.35; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: taken, four, early.",D10 p.1; D10 p.2; D10 p.1; D10 p.1; D10 p.2 +full,test,I06,misleading,"As the MDS301 Deep Learning exam is in the afternoon session, what time does it start?",correct_premise,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.6,1.0,1.0,1.0,1.0,1.0,0.705,0.0048938579998321075,01 December 2025 (Monday): MDS301 Deep Learning - Morning session. [1],"It is in the morning session (01 December 2025), which starts at 10:00 AM.","Answered: relevance 0.53, coverage 0.73, 1/1 sentences verified against their citations.",D06 p.1; D06 p.1; D06 p.2; D06 p.1; D07 p.2 +full,test,I07,misleading,"Since make-up internal tests are allowed for any reason, how many can a student take per semester?",correct_premise,answered,False,False,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.702,0.004625584000223171,"A student who misses an internal test on medical grounds may take one make-up test per semester, provided a medical certificate is submitted within 3 working days of the missed test. [1]",Make-up tests are only for medical grounds; one make-up test per semester.,"Answered: relevance 0.56, coverage 0.70, 1/1 sentences verified against their citations.",D04 p.1; D04 p.1; D04 p.2; D04 p.1; D14 p.1; D10 p.1 +full,dev,I08,misleading,What is the late fee for course registration?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.961,0.007838333000108832,"Late registration is permitted until 22 July 2025 with a late fee of INR 2,000. [1]","INR 2,000 (not the INR 500 hostel fine).","Answered: relevance 0.90, coverage 1.00, 1/1 sentences verified against their citations.",D09 p.1; D16 p.1; D10 p.2; D05 p.1; D09 p.1 +full,test,I09,misleading,Above what similarity percentage must an assignment be resubmitted?,answer,answered,False,False,True,True,False,correct,1,1,0.16666666666666666,1.0,1.0,1.0,0.6666666666666666,0.5,0.612,0.006484402999831218,"A similarity index above 20% requires resubmission within 3 days. [1] Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [2] Group assignments may have at most 4 members, and each member must state their individual contribution. [1]",Above 20%.,"Answered: relevance 0.41, coverage 0.62, 3/3 sentences verified against their citations.",D05 p.2; D01 p.1; D13 p.2; D07 p.1; D05 p.1; D13 p.1 +full,dev,I10,misleading,At what time does the Central Library close on working days?,answer,partial,False,False,True,True,False,correct,1,1,0.2857142857142857,1.0,1.0,1.0,1.0,1.0,0.616,0.006243595999876561,The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to 5:00 PM on Saturdays. [1],10:00 PM.,"Partially answered: query coverage 0.59; not covered: time, close.",D11 p.1; D11 p.1; D12 p.1; D12 p.1; D03 p.2; D16 p.2; D06 p.1 +full,test,I11,misleading,How many days before the examinations is the attendance shortage list published?,answer,answered,False,False,True,True,False,correct,1,1,0.2,1.0,1.0,1.0,1.0,1.0,0.927,0.006044699000085529,The list of students with attendance shortage is published 7 days before the commencement of end-semester examinations. [1],7 days before the commencement of end-semester examinations.,"Answered: relevance 0.82, coverage 1.00, 1/1 sentences verified against their citations.",D01 p.2; D03 p.2; D01 p.1; D01 p.1; D04 p.2 +full,dev,I12,misleading,How many contact hours of approved event participation can be counted as present?,answer,answered,False,False,True,True,False,correct,1,1,0.4,1.0,1.0,1.0,1.0,1.0,0.863,0.004145095000239962,"Participation in university-approved events such as sports, cultural festivals and NCC camps is counted as present for up to 10 contact hours per semester, with prior approval of the Head of Department. [1]",Up to 10 contact hours per semester.,"Answered: relevance 0.66, coverage 1.00, 1/1 sentences verified against their citations.",D01 p.2; D01 p.1; D01 p.2; D10 p.1; D10 p.1 +full,test,I13,misleading,What is the minimum CGPA for First Class (without distinction)?,answer,answered,False,False,False,False,True,wrong/irrelevant answer content,0,1,0.4,1.0,1.0,1.0,0.5,0.5,0.678,0.0031959369998730836,First Class with Distinction is awarded for a CGPA of 8.0 or above. [1] Scholarship holders must maintain a minimum of 75% attendance in every course. [3],6.5 (First Class is CGPA 6.5 to 7.99).,"Answered: relevance 0.52, coverage 0.68, 2/2 sentences verified against their citations.",D13 p.2; D13 p.2; D07 p.2; D03 p.1; D01 p.1 +full,test,I14,misleading,For how many days can a course instructor extend an assignment deadline?,answer,answered,False,False,True,True,False,correct,1,1,0.2857142857142857,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,0.722,0.0073092350003207684,Extensions of up to 5 days may be granted by the course instructor on medical or compassionate grounds if requested before the deadline. [1] The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [5] Assignments must be submitted as a single PDF file of no more than 10 MB. [2],Up to 5 days.,"Answered: relevance 0.51, coverage 0.79, 3/3 sentences verified against their citations.",D05 p.1; D05 p.1; D04 p.2; D05 p.2; D08 p.1; D02 p.1; D04 p.1 +full,test,I15,misleading,Is a calculator with programmable memory allowed in the examination hall?,answer,abstained,True,False,False,False,False,over-abstention (answer was available),0,1,0.2,1.0,1.0,,,,0.0,0.0018682589998206822,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,No - only non-programmable scientific calculators are permitted.,"Abstained: evidence is insufficient (best passage relevance 0.22, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: programmable, memory.",D06 p.2; D03 p.1; D03 p.1; D06 p.1; D03 p.1 +full,test,C01,conflicting,What is the minimum attendance required to appear for end-semester examinations?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.42857142857142855,1.0,1.0,1.0,1.0,1.0,0.89,0.009348322999812808,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Attendance Regulations 2023* (issued 2023-06-15): A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [1] +- *Circular: Amendment to Attendance Regulations* (issued 2025-06-02): With effect from the academic year 2025-26, the minimum attendance requirement for each course is revised to 80%. [5] +The more recent document is *Circular: Amendment to Attendance Regulations*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.",Conflict: Attendance Regulations 2023 say 75%; Circular 2025/014 revises it to 80% from 2025-26 (supersedes).,"Answered with a conflict warning: 'Attendance Regulations 2023' and 'Circular: Amendment to Attendance Regulations' disagree (%: 75 vs 80 (context: attendance, minimum)).",D01 p.1; D01 p.1; D03 p.1; D01 p.2; D02 p.1; D03 p.1; D03 p.2 +full,test,C02,conflicting,Up to what percentage can an attendance shortage be condoned on medical grounds?,flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,1.0,1.0,1.0,,,,0.0,0.0018257629999425262,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Conflict: 10% under the 2023 regulations; limited to 5% by the 2025 circular.,"Abstained: evidence is insufficient (best passage relevance 0.43, query coverage 0.50; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: percentage, condoned.",D01 p.1; D01 p.1; D02 p.1; D02 p.1; D01 p.1 +full,test,C03,conflicting,What is the condonation fee per course for attendance shortage?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.6666666666666666,1.0,1.0,1.0,1.0,1.0,0.937,0.01217137300000104,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Attendance Regulations 2023* (issued 2023-06-15): A condonation fee of INR 500 per course is payable before the condonation order is issued. [1] +- *Circular: Amendment to Attendance Regulations* (issued 2025-06-02): The condonation fee is revised to INR 1,000 per course. [4] +The more recent document is *Circular: Amendment to Attendance Regulations*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** The Dean of Academics may condone a shortage of attendance of up to 10% (that is, attendance between 65% and 75%) on documented medical grounds. [1]","Conflict: INR 500 (2023 regulations) vs INR 1,000 (2025 circular).","Answered with a conflict warning: 'Attendance Regulations 2023' and 'Circular: Amendment to Attendance Regulations' disagree (inr: 500 vs 1000 (context: condonation, fee)).",D01 p.1; D01 p.2; D01 p.1; D02 p.1; D02 p.1; D03 p.2 +full,test,C04,conflicting,"According to the examination eligibility rules, what attendance is needed in a course to sit its end-semester exam?",flag_conflict,answered,False,False,False,False,True,missed conflict,0,2,0.4,0.5,1.0,1.0,0.5,0.5,0.647,0.003973093000240624,These rules determine whether a student may appear for the end-semester examination of a course. [1] A student may appeal against an eligibility decision to the Controller of Examinations within 3 working days of the publication of the eligibility list. [4],"Conflict: the eligibility rules (2024) state 75%, but the 2025 circular raises the requirement to 80%.","Answered: relevance 0.49, coverage 0.62, 2/2 sentences verified against their citations.",D03 p.1; D03 p.1; D06 p.1; D03 p.2; D01 p.1 +full,test,C05,conflicting,What is the last date to apply for a scholarship for 2025-26?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.6666666666666666,1.0,1.0,1.0,1.0,0.5,0.756,0.0069882020002296485,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The last date for scholarship applications for 2025-26 is extended to 15 September 2025. [1] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Last date for scholarship applications: 31 August 2025. [2] +The more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version.",Conflict: 31 August 2025 (policy) vs extended to 15 September 2025 (notice).,"Answered with a conflict warning: 'Notice: Revision of Scholarship Deadline and Income Ceiling' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (date: 15 september 2025 vs 31 august 2025 (context: application, date, last, scholarship)).",D08 p.1; D14 p.1; D07 p.1; D14 p.1; D07 p.1; D08 p.1 +full,test,C06,conflicting,What is the family income limit for the need-based scholarship?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.8,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,0.791,0.005946321000010357,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Notice: Revision of Scholarship Deadline and Income Ceiling* (issued 2025-08-25): The family income ceiling for the need-based scholarship is revised to INR 8,00,000. [1] +- *Scholarship Policy 2025-26* (issued 2025-05-01): A need-based scholarship of INR 30,000 per year is available to students whose annual family income does not exceed INR 6,00,000. [2] +The more recent document is *Notice: Revision of Scholarship Deadline and Income Ceiling*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Students may avail maternity leave of up to 6 months, which is counted within the academic leave limit. [5]","Conflict: INR 6,00,000 (policy) vs INR 8,00,000 (revised notice).","Answered with a conflict warning: 'Notice: Revision of Scholarship Deadline and Income Ceiling' and 'Scholarship Policy 2025-26' disagree (inr: 800000 vs 600000 (context: family, income)).",D08 p.1; D07 p.1; D07 p.1; D08 p.1; D10 p.1 +full,test,C07,conflicting,Are late assignment submissions accepted?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.6,1.0,1.0,1.0,1.0,1.0,0.94,0.008024170999760827,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] +- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [3] +The more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Assignments must be submitted as a single PDF file of no more than 10 MB. [1]",Conflict: the Assignment Policy accepts up to 3 days late with 10%/day penalty; the IA Guidelines say late assignments will not be accepted for IA.,Answered with a conflict warning: 'Assignment Submission Policy 2024' and 'Internal Assessment Guidelines 2024' disagree (one passage permits what the other rules out).,D05 p.1; D05 p.1; D04 p.2; D09 p.1; D16 p.1 +full,dev,C08,conflicting,What is the penalty for submitting an assignment one day late?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.766,0.00661874200022794,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Assignment Submission Policy 2024* (issued 2024-06-10): Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [1] +- *Internal Assessment Guidelines 2024* (issued 2024-05-20): Assignments submitted after the deadline will not be accepted for internal assessment. [6] +The more recent document is *Assignment Submission Policy 2024*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Assignments must be submitted as a single PDF file of no more than 10 MB. [1]",Conflict: 10% of maximum marks per day (Assignment Policy) vs not accepted at all (IA Guidelines).,Answered with a conflict warning: 'Assignment Submission Policy 2024' and 'Internal Assessment Guidelines 2024' disagree (one passage permits what the other rules out).,D05 p.1; D16 p.1; D09 p.1; D14 p.1; D11 p.2; D04 p.2 +full,test,C09,conflicting,How many books can a postgraduate student borrow from the library?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.3333333333333333,1.0,1.0,1.0,1.0,1.0,0.924,0.008908287999929598,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Central Library Regulations 2023* (issued 2023-07-01): Postgraduate students may borrow up to 5 books for 14 days. [1] +- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2] +The more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Library hours during examination periods are extended until 12:00 midnight on working days. [2]",Conflict: 5 books (2023 regulations) vs 6 books from 1 August 2025 (notice).,"Answered with a conflict warning: 'Central Library Regulations 2023' and 'Library Notice: Revised Borrowing Rules' disagree (books: 5 vs 6 (context: borrow, day, postgraduate)).",D11 p.1; D12 p.1; D11 p.2; D15 p.1; D15 p.1; D14 p.2 +full,test,C10,conflicting,For how many days can a postgraduate student keep a borrowed library book?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.6666666666666666,1.0,0.5,1.0,0.6666666666666666,0.6666666666666666,0.665,0.008786556999893946,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days. [2] +- *Central Library Regulations 2023* (issued 2023-07-01): Postgraduate students may borrow up to 5 books for 14 days. [3] +The more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Reference books cannot be borrowed and must be used within the library. [1]",Conflict: 14 days (2023) vs 21 days (2025 notice).,"Answered with a conflict warning: 'Library Notice: Revised Borrowing Rules' and 'Central Library Regulations 2023' disagree (days: 21 vs 14 (context: book, borrow, postgraduate)).",D11 p.2; D12 p.1; D11 p.1; D11 p.1; D12 p.1; D14 p.2 +full,dev,C11,conflicting,What is the library overdue fine per book per day?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.25,1.0,1.0,1.0,1.0,1.0,0.944,0.009147218999714823,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Central Library Regulations 2023* (issued 2023-07-01): An overdue fine of INR 5 per book per day is charged. [1] +- *Library Notice: Revised Borrowing Rules* (issued 2025-07-10): The overdue fine is revised to INR 10 per book per day. [2] +The more recent document is *Library Notice: Revised Borrowing Rules*, which explicitly revises the earlier rule. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Reference books cannot be borrowed and must be used within the library. [1]",Conflict: INR 5 (2023) vs INR 10 (2025 notice).,"Answered with a conflict warning: 'Central Library Regulations 2023' and 'Library Notice: Revised Borrowing Rules' disagree (inr: 5 vs 10 (context: book, day, fine, overdue)).",D11 p.2; D12 p.1; D16 p.1; D14 p.1; D05 p.1; D02 p.1; D11 p.1; D14 p.2 +full,dev,C12,conflicting,How long is the add/drop period for elective courses?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,0.868,0.006238780999865412,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Course Registration Guidelines 2025* (issued 2025-06-05): Students may add or drop elective courses within 10 working days from the start of classes. [1] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Add/drop period for electives: 7 working days from the start of classes. [2] +The more recent document is *Academic Calendar 2025-26 (Odd Semester)*. Please confirm with the issuing office before relying on either version.",Conflict: 10 working days (Registration Guidelines) vs 7 working days (Academic Calendar).,"Answered with a conflict warning: 'Course Registration Guidelines 2025' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (working days: 10 vs 7 (context: add, class, drop, elective)).",D09 p.2; D14 p.1; D12 p.1; D06 p.1; D09 p.1 +full,dev,C13,conflicting,What minimum aggregate percentage is needed to pass a postgraduate course?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5714285714285714,1.0,1.0,1.0,0.6666666666666666,0.6666666666666666,0.687,0.012744970000312605,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Postgraduate Programme Handbook 2025-26 (Extract)* (issued 2025-07-05): PG students must obtain at least 50% marks in aggregate to pass a course. [1] +- *Grading and Academic Progression Policy 2024* (issued 2024-04-02): To pass a course, a student must secure at least 40% marks in aggregate (internal assessment plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60). [4] +The more recent document is *Postgraduate Programme Handbook 2025-26 (Extract)*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Attendance percentage is the number of contact hours attended divided by the number of contact hours conducted in a course, multiplied by 100. [3]",Conflict: 40% (Grading Policy) vs 50% for PG courses (PG Handbook).,"Answered with a conflict warning: 'Postgraduate Programme Handbook 2025-26 (Extract)' and 'Grading and Academic Progression Policy 2024' disagree (%: 50 vs 40 (context: aggregate, mark, pass)).",D15 p.1; D15 p.1; D01 p.1; D13 p.1; D13 p.1; D03 p.1; D04 p.1 +full,test,C14,conflicting,On what date do the odd semester end-semester examinations begin?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.5,1.0,1.0,1.0,1.0,1.0,0.769,0.011838200000056531,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *End-Semester Examination Timetable - Odd Semester 2025-26* (issued 2025-10-20): The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025. [2] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): End-semester examinations: from 3 December 2025. [3] +The more recent document is *End-Semester Examination Timetable - Odd Semester 2025-26*. Please confirm with the issuing office before relying on either version. +**Most relevant evidence:** Odd semester classes begin on 21 July 2025. [1] Key Dates - Odd Semester 2025-26. [1]","Conflict: 1 December 2025 (Timetable, Oct 2025) vs 3 December 2025 (Academic Calendar, June 2025).","Answered with a conflict warning: 'End-Semester Examination Timetable - Odd Semester 2025-26' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (date: 12 december 2025 vs 3 december 2025 (context: end-semester, examination)).",D14 p.1; D06 p.1; D14 p.1; D06 p.2; D14 p.2; D09 p.1 +full,test,C15,conflicting,Can I drop an elective course 9 working days after classes start?,flag_conflict,conflict,False,True,True,True,False,correct,2,2,0.4,1.0,1.0,1.0,1.0,1.0,0.798,0.012262178000128188,"โš ๏ธ **Conflicting evidence found.** The documents disagree: +- *Course Registration Guidelines 2025* (issued 2025-06-05): Students may add or drop elective courses within 10 working days from the start of classes. [1] +- *Academic Calendar 2025-26 (Odd Semester)* (issued 2025-06-15): Add/drop period for electives: 7 working days from the start of classes. [2] +The more recent document is *Academic Calendar 2025-26 (Odd Semester)*. Please confirm with the issuing office before relying on either version.",Conflict: allowed under the Registration Guidelines (10 working days) but not under the Academic Calendar (7 working days).,"Answered with a conflict warning: 'Course Registration Guidelines 2025' and 'Academic Calendar 2025-26 (Odd Semester)' disagree (working days: 10 vs 7 (context: add, class, drop, elective)).",D09 p.2; D14 p.1; D04 p.2; D12 p.1; D13 p.1 +full,dev,C16,conflicting,"If my attendance in a course is 78%, am I eligible for the end-semester examination?",flag_conflict,partial,False,False,False,False,False,missed conflict,1,2,0.3333333333333333,0.5,0.5,1.0,1.0,1.0,0.633,0.011192907000349805,A student must secure a minimum of 75% attendance in each course to be eligible to appear for the end-semester examination of that course. [2],"Conflict: eligible under the 2023 rule (75%), but below the 80% minimum under the 2025 circular (condonable between 75% and 80%).",Partially answered: query coverage 0.56; not covered: 78%.,D03 p.1; D01 p.1; D01 p.1; D03 p.1; D01 p.2; D03 p.2 +full,test,C17,conflicting,"If a PG student scores 45% in aggregate in a course, do they pass?",flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.8,1.0,1.0,,,,0.0,0.002280513999721734,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,"Conflict: pass under the Grading Policy (40%), fail under the PG Handbook (50%).","Abstained: evidence is insufficient (best passage relevance 0.41, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: scores, 45%.",D15 p.1; D15 p.1; D13 p.1; D13 p.1; D09 p.1 +full,test,C18,conflicting,What is the lowest attendance percentage that can be condoned on medical grounds?,flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,1.0,1.0,1.0,,,,0.0,0.0019156950002070516,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,Conflict: 65% under the 2023 regulations vs 75% under the 2025 circular.,"Abstained: evidence is insufficient (best passage relevance 0.27, query coverage 0.30; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: lowest, percentage, condoned.",D01 p.1; D02 p.1; D02 p.1; D01 p.1; D01 p.1 +full,test,C19,conflicting,"Which attendance rule is the latest, and what minimum attendance does it require?",flag_conflict,abstained,True,False,False,False,False,over-abstention (answer was available),0,2,0.6,1.0,1.0,,,,0.0,0.001834799999869574,I could not find sufficient evidence in the uploaded documents to answer this question. Please check with the relevant university office.,"Conflict: the 2025 circular (latest) requires 80%, superseding the 75% of the 2023 regulations.","Abstained: evidence is insufficient (best passage relevance 0.38, query coverage 0.46; thresholds 0.15 / 0.60). Question terms not found in the retrieved passages: latest.",D01 p.1; D02 p.1; D01 p.1; D07 p.2; D09 p.1 +full,dev,C20,conflicting,"According to the academic calendar, what is the scholarship application deadline, and has it changed?",flag_conflict,answered,False,False,False,False,False,missed conflict,1,2,0.6,1.0,1.0,1.0,0.5,0.5,0.581,0.004201775000183261,Last date for scholarship applications: 31 August 2025. [1] Late submissions are accepted for up to 3 calendar days after the deadline with a penalty of 10% of the maximum marks per day. [3],"Conflict: the calendar says 31 August 2025, but the notice extends it to 15 September 2025.","Answered: relevance 0.31, coverage 0.64, 2/2 sentences verified against their citations.",D14 p.1; D07 p.1; D05 p.1; D08 p.1; D08 p.1 diff --git a/results/significance.json b/results/significance.json new file mode 100644 index 0000000000000000000000000000000000000000..65286293d41cdbce97a63a2507be62d264ed6331 --- /dev/null +++ b/results/significance.json @@ -0,0 +1,158 @@ +{ + "behaviour_accuracy|all|baseline_vs_rerank": { + "n": 100, + "baseline": 0.55, + "rerank": 0.54, + "difference": -0.01, + "ci95": [ + -0.03, + 0.0 + ], + "only_other_true": 0, + "only_baseline_true": 1, + "mcnemar_exact_p": 1.0 + }, + "behaviour_accuracy|all|baseline_vs_verify": { + "n": 100, + "baseline": 0.55, + "verify": 0.73, + "difference": 0.18, + "ci95": [ + 0.08, + 0.28 + ], + "only_other_true": 25, + "only_baseline_true": 7, + "mcnemar_exact_p": 0.002102 + }, + "behaviour_accuracy|all|baseline_vs_full": { + "n": 100, + "baseline": 0.55, + "full": 0.73, + "difference": 0.18, + "ci95": [ + 0.08, + 0.28 + ], + "only_other_true": 25, + "only_baseline_true": 7, + "mcnemar_exact_p": 0.002102 + }, + "behaviour_accuracy|test|baseline_vs_rerank": { + "n": 71, + "baseline": 0.5352, + "rerank": 0.5211, + "difference": -0.0141, + "ci95": [ + -0.0423, + 0.0 + ], + "only_other_true": 0, + "only_baseline_true": 1, + "mcnemar_exact_p": 1.0 + }, + "behaviour_accuracy|test|baseline_vs_verify": { + "n": 71, + "baseline": 0.5352, + "verify": 0.7042, + "difference": 0.169, + "ci95": [ + 0.0423, + 0.2958 + ], + "only_other_true": 19, + "only_baseline_true": 7, + "mcnemar_exact_p": 0.028959 + }, + "behaviour_accuracy|test|baseline_vs_full": { + "n": 71, + "baseline": 0.5352, + "full": 0.7042, + "difference": 0.169, + "ci95": [ + 0.0423, + 0.2958 + ], + "only_other_true": 19, + "only_baseline_true": 7, + "mcnemar_exact_p": 0.028959 + }, + "unsupported_answer|all|baseline_vs_rerank": { + "n": 100, + "baseline": 0.19, + "rerank": 0.2, + "difference": 0.01, + "ci95": [ + 0.0, + 0.03 + ], + "only_other_true": 1, + "only_baseline_true": 0, + "mcnemar_exact_p": 1.0 + }, + "unsupported_answer|all|baseline_vs_verify": { + "n": 100, + "baseline": 0.19, + "verify": 0.09, + "difference": -0.1, + "ci95": [ + -0.17, + -0.03 + ], + "only_other_true": 2, + "only_baseline_true": 12, + "mcnemar_exact_p": 0.012939 + }, + "unsupported_answer|all|baseline_vs_full": { + "n": 100, + "baseline": 0.19, + "full": 0.09, + "difference": -0.1, + "ci95": [ + -0.17, + -0.03 + ], + "only_other_true": 2, + "only_baseline_true": 12, + "mcnemar_exact_p": 0.012939 + }, + "unsupported_answer|test|baseline_vs_rerank": { + "n": 71, + "baseline": 0.2113, + "rerank": 0.2254, + "difference": 0.0141, + "ci95": [ + 0.0, + 0.0423 + ], + "only_other_true": 1, + "only_baseline_true": 0, + "mcnemar_exact_p": 1.0 + }, + "unsupported_answer|test|baseline_vs_verify": { + "n": 71, + "baseline": 0.2113, + "verify": 0.0986, + "difference": -0.1127, + "ci95": [ + -0.2113, + -0.0282 + ], + "only_other_true": 2, + "only_baseline_true": 10, + "mcnemar_exact_p": 0.038574 + }, + "unsupported_answer|test|baseline_vs_full": { + "n": 71, + "baseline": 0.2113, + "full": 0.0986, + "difference": -0.1127, + "ci95": [ + -0.2113, + -0.0282 + ], + "only_other_true": 2, + "only_baseline_true": 10, + "mcnemar_exact_p": 0.038574 + } +} \ No newline at end of file diff --git a/scripts/build_report.py b/scripts/build_report.py new file mode 100644 index 0000000000000000000000000000000000000000..047c3ddfc774ba38953d561fcef5c402697703d0 --- /dev/null +++ b/scripts/build_report.py @@ -0,0 +1,492 @@ +""" +Builds the MSc project report content (reports/report_model.json) from the ACTUAL result files, +then renders DOCX (scripts/render_report_docx.js) and PDF (LibreOffice). Also refreshes the results +table in README.md. No number in the report is typed by hand - all are read from results/. + +Usage: python scripts/build_report.py [--author "Name"] [--usn USN] +""" +import argparse +import json +import subprocess +import sys +from collections import Counter +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT)) +sys.path.insert(0, str(ROOT / "scripts")) + +from corpus_content import DOCUMENTS # noqa: E402 +from src.research import FOUNDATION, FUTURE, LIMITATIONS, OBJECTIVES, PAPERS, RESEARCH_GAP # noqa: E402 + +RES = ROOT / "results" +M = json.loads((RES / "metrics.json").read_text()) +SIG = json.loads((RES / "significance.json").read_text()) +CAL = json.loads((RES / "calibrated_thresholds.json").read_text()) +FAIL = json.loads((RES / "failure_cases.json").read_text()) +QS = json.loads((ROOT / "evaluation_data" / "questions.json").read_text()) +ORDER = ["baseline", "rerank", "verify", "full"] +NAMES = M["config_names"] +B = [] # blocks + + +def H1(t): B.append({"t": "h1", "text": t}) +def H2(t): B.append({"t": "h2", "text": t}) +def P(t): B.append({"t": "p", "text": t}) +def BUL(items): B.append({"t": "bullets", "items": list(items)}) +def NUM(items): B.append({"t": "numbers", "items": list(items)}) +def TABLE(header, rows, widths=None, size=8): B.append({"t": "table", "header": header, "rows": rows, "widths": widths, "size": size}) +def IMG(path, w=16, cap=""): B.append({"t": "img", "path": str(path), "width_cm": w, "caption": cap}) +def CAP(t): B.append({"t": "caption", "text": t}) +def BR(): B.append({"t": "pagebreak"}) +def CODE(t): B.append({"t": "code", "text": t}) + + +def plain(t): + """Strip the app's markdown (bold/italic markers, list dashes, emoji badges) for report tables.""" + import re + t = re.sub(r"\*{1,2}|(?=70% of tokens occur in the retrieved context"], + ["Answer", "Evidence-grounded faithfulness", "Same check against the gold evidence pages only"], + ["Answer", "Answer relevance", "TF-IDF cosine between question and answer (lexical proxy for RAGAS answer relevance)"], + ["Answer", "Context precision / recall", "Rank-weighted AP@5 of gold pages / share of key facts present in the context"], + ["Reliability", "Unsupported answer rate", "Non-abstaining answers to unanswerable questions or containing none of the key facts"], + ["Reliability", "Abstention accuracy, P/R/F1", "Abstain decision vs. 'missing information' label"], + ["Reliability", "Contradiction P/R/F1", "Conflict flag vs. 'conflicting' label"], + ["Reliability", "Citation support accuracy", "Share of cited passages that are gold evidence pages"], + ["Efficiency", "Response / retrieval / generation time", "Mean wall-clock seconds per question"]], + widths=[2.2, 4.4, 9.4], size=7.5) + CAP("Table 5. Metrics. Definitions follow RAGAS [7] and ALCE [4] but are computed deterministically against gold labels.") + BR() + + # --------------------------------------------------------------- 14 results + H1("14. Results") + P(f"All numbers below are read from results/metrics.json (run of {meta['date']}). " + "Experiments use synthetic documents of a fictional university and do not establish real-world accuracy.") + keys = [("precision_at_k", "Precision@5"), ("recall_at_k", "Recall@5"), ("mrr", "MRR"), + ("answer_correctness", "Answer correctness"), ("behaviour_accuracy", "Expected-behaviour accuracy"), + ("faithfulness", "Faithfulness (to context)"), ("grounded_faithfulness", "Evidence-grounded faithfulness"), + ("answer_relevance", "Answer relevance (lexical)"), ("context_precision", "Context precision"), + ("context_recall", "Context recall"), ("unsupported_answer_rate", "Unsupported answer rate (lower better)"), + ("abstention_accuracy", "Abstention accuracy"), ("abstention_precision", "Abstention precision"), + ("abstention_recall", "Abstention recall"), ("abstention_f1", "Abstention F1"), + ("contradiction_precision", "Contradiction precision"), ("contradiction_recall", "Contradiction recall"), + ("contradiction_f1", "Contradiction F1"), ("citation_support_accuracy", "Citation support accuracy"), + ("avg_response_time_s", "Avg response time (s)"), ("avg_retrieval_time_s", "Avg retrieval + rerank time (s)"), + ("avg_verification_time_s", "Avg verification time (s)"), ("avg_generation_time_s", "Avg generation time (s)")] + for split, label, tno in ((T, f"held-out TEST split ({meta['test_questions']} questions)", 6), (A, "all 100 questions", 7)): + rows = [[lab] + [f(m(split, c, k), 4 if "time" in k else 3) for c in ORDER] for k, lab in keys] + TABLE(["Metric"] + [NAMES[c] for c in ORDER], rows, widths=[5.6, 2.6, 2.6, 2.6, 2.6], size=8) + CAP(f"Table {tno}. Four-configuration comparison on the {label}.") + IMG(RES / "charts" / "reliability_comparison.png", 16) + CAP("Figure 8. Reliability metrics (all 100 questions).") + IMG(RES / "charts" / "answer_quality_comparison.png", 16) + CAP("Figure 9. Answer quality metrics (all 100 questions).") + IMG(RES / "charts" / "retrieval_comparison.png", 16) + CAP("Figure 10. Retrieval metrics (all 100 questions).") + IMG(RES / "charts" / "category_breakdown.png", 16) + CAP("Figure 11. Expected-behaviour accuracy by question category.") + IMG(RES / "charts" / "response_time.png", 15) + CAP("Figure 12. Mean time per question.") + H2("14.1 Statistical significance") + TABLE(["Comparison (paired)", "Baseline", "EvidenceGuard", "Difference [95% CI]", "Discordant (EG only / base only)", "Exact McNemar p"], + [[name, f"{s['baseline']:.3f}", f"{s['full']:.3f}", f"{s['difference']:+.3f} [{s['ci95'][0]:+.3f}, {s['ci95'][1]:+.3f}]", + f"{s['only_other_true']} / {s['only_baseline_true']}", f"{s['mcnemar_exact_p']:.4f}"] + for name, s in (("Behaviour accuracy - test", sig_b), ("Behaviour accuracy - all", sig_ba), + ("Unsupported answer - test", sig_u), + ("Unsupported answer - all", SIG["unsupported_answer|all|baseline_vs_full"]))], + widths=[4.2, 1.8, 2.2, 3.4, 2.6, 1.8], size=7.5) + CAP("Table 8. Paired significance tests, baseline vs. complete EvidenceGuard (results/significance.json).") + rr = SIG["behaviour_accuracy|test|baseline_vs_rerank"] + P(f"Reranking alone (configuration 2) did not change behaviour accuracy significantly " + f"({rr['difference']:+.3f}, p = {rr['mcnemar_exact_p']:.2f}).") + BR() + + # --------------------------------------------------------------- 15-16 + H1("15. Comparative Analysis") + cb, cf = M["by_category"]["baseline"], M["by_category"]["full"] + TABLE(["Category", "n", "Baseline behaviour acc.", "EvidenceGuard behaviour acc.", "Baseline abstention rate", "EvidenceGuard abstention rate"], + [[c, str(cb[c]["n"]), f(cb[c]["behaviour_accuracy"]), f(cf[c]["behaviour_accuracy"]), + f(cb[c]["abstention_rate"]), f(cf[c]["abstention_rate"])] + for c in ["answerable", "multi_passage", "missing", "misleading", "conflicting"]], + widths=[3.2, 1.0, 3.0, 3.2, 2.8, 2.8], size=8) + CAP("Table 9. Per-category comparison (all 100 questions).") + BUL([f"RQ1 - unsupported answers: the baseline answered every missing-information question " + f"(behaviour accuracy {cb['missing']['behaviour_accuracy']:.2f}); EvidenceGuard abstained correctly on " + f"{cf['missing']['behaviour_accuracy']:.0%} of them and lowered the overall unsupported-answer rate from " + f"{m(A,'baseline','unsupported_answer_rate'):.2f} to {m(A,'full','unsupported_answer_rate'):.2f}.", + f"RQ2 - conflicts: the baseline cannot flag conflicts (F1 = 0 by construction). EvidenceGuard reached " + f"precision {m(A,'full','contradiction_precision'):.2f} and recall {m(A,'full','contradiction_recall'):.2f}; " + f"the conflict-search retrieval step was needed for amendment circulars that were not in the top-5.", + f"RQ3 - cost: answerable accuracy fell from {cb['answerable']['behaviour_accuracy']:.2f} to " + f"{cf['answerable']['behaviour_accuracy']:.2f} and multi-passage from {cb['multi_passage']['behaviour_accuracy']:.2f} " + f"to {cf['multi_passage']['behaviour_accuracy']:.2f} because of over-abstention; abstention precision is only " + f"{m(A,'full','abstention_precision'):.2f}. Mean latency rose from {m(A,'baseline','avg_response_time_s')*1000:.1f} ms " + f"to {m(A,'full','avg_response_time_s')*1000:.1f} ms with offline components (an LLM would dominate latency).", + "RQ4 - retrieval: recall@5 was already high for the dense LSA baseline on this small corpus, so hybrid " + "retrieval and the lexical reranker added little; the improvements come from the verification layer " + "(configurations 3 and 4 are almost identical).", + f"Note on abstention accuracy: the baseline's {m(A,'baseline','abstention_accuracy'):.2f} is the majority-class rate " + "(it never abstains while 85% of questions are answerable); abstention F1 is the informative measure.", + "Faithfulness to context is 1.0 for all configurations because the offline extractive composer can only copy " + "retrieved sentences; evidence-grounded faithfulness shows the real difference (sentences taken from the right pages)."]) + IMG(RES / "charts" / "error_analysis.png", 16) + CAP("Figure 13. Error taxonomy, baseline vs. EvidenceGuard (results/error_analysis.csv).") + H2("15.1 Failure case examples") + ex, seen_t = [], Counter() + for e in FAIL["evidenceguard_failures"]: # diverse: at most 2 per error type + if seen_t[e["error_type"]] < 2: + ex.append(e) + seen_t[e["error_type"]] += 1 + TABLE(["ID", "Question", "Error type", "EvidenceGuard output (truncated)"], + [[e["id"], e["question"], e["error_type"], plain(e["answer"])[:220]] for e in ex], + widths=[1.1, 5.0, 3.0, 6.9], size=7) + CAP("Table 10. Examples of EvidenceGuard failures (full list in results/failure_cases.json).") + wins, seen_c = [], Counter() + for w in FAIL["evidenceguard_fixes_over_baseline"]: # one or two per category + if seen_c[w["category"]] < (2 if w["category"] == "conflicting" else 1): + wins.append(w) + seen_c[w["category"]] += 1 + TABLE(["ID", "Question", "Baseline answer", "EvidenceGuard answer"], + [[w["id"], w["question"], plain(w["baseline_answer"])[:170], plain(w["evidenceguard_answer"])[:170]] for w in wins], + widths=[1.1, 4.3, 5.3, 5.3], size=7) + CAP("Table 11. Examples where EvidenceGuard corrected a baseline failure.") + BR() + + H1("16. Discussion") + P("The experiment supports the central claim within its scope: a training-free verification layer can stop a " + "RAG assistant from answering questions its documents cannot support and can surface conflicting rule " + "versions instead of silently choosing one. This matches the failure modes reported in RGB [1] and " + "WikiContradict [6], and turns the post-hoc citation evaluation of ALCE [4] into an in-pipeline filter. The " + "price is over-abstention, the same trade-off Yoran et al. [5] observed for NLI filtering: when a question " + "is paraphrased away from the document wording, or needs two passages, coverage drops below the threshold. " + "A practical deployment should therefore present abstentions as 'not found - please check with the office' " + "with the retrieved passages visible, which the application does.") + P("Two results temper the conclusions. First, the behaviour-accuracy gain partly reflects the benchmark design: " + "conflict questions require a conflict flag that the baseline cannot produce. The unsupported-answer rate, " + "which does not depend on that design, is the cleaner evidence and is also significant. Second, the rule " + "components were designed while inspecting failures on the same question set; only thresholds were " + "calibrated on the DEV split. The test results are therefore optimistic and should be confirmed on new, " + "independently written questions and on real documents.") + + H1("17. Limitations") + BUL(LIMITATIONS) + H1("18. Future Enhancements") + BUL(FUTURE) + H1("19. Conclusion") + P(f"EvidenceGuard AI demonstrates that evidence verification can be added to a RAG assistant with free, " + f"CPU-only components. On a synthetic university benchmark it reduced unsupported answers by " + f"{abs(sig_u['difference']):.1%} absolute on held-out questions, detected conflicting rule versions with F1 " + f"{m(T,'full','contradiction_f1'):.2f}, and explained every decision, at the cost of some over-abstention. The " + "complete system - data generator, two RAG systems, verification module, evaluation suite and seven-tab " + "Gradio application - is reproducible from the repository and prepared for Hugging Face Spaces.") + BR() + + # --------------------------------------------------------------- references + H1("20. References") + refs = [f"{p['authors']}, \"{p['title']},\" {p['venue']}, {p['year']}. [Online]. Available: {p['link']}" + for p in PAPERS] + FOUNDATION + B.append({"t": "refs", "items": refs}) + H1("Appendix A. Reproducing the results") + CODE("pip install -r requirements.txt\npython scripts/generate_dataset.py # 16 PDFs + 100 questions\n" + "python scripts/run_evaluation.py --backend lite --llm extractive # this report\n" + "python scripts/run_evaluation.py --backend full --llm hf_api # HF models (needs HF_TOKEN)\n" + "python scripts/significance.py\npython -m pytest -q\npython app.py") + + +def readme_table(): + meta = M["meta"] + keys = [("recall_at_k", "Recall@5"), ("mrr", "MRR"), ("answer_correctness", "Answer correctness"), + ("behaviour_accuracy", "Expected-behaviour accuracy"), ("grounded_faithfulness", "Evidence-grounded faithfulness"), + ("unsupported_answer_rate", "Unsupported answer rate โ†“"), ("abstention_f1", "Abstention F1"), + ("contradiction_f1", "Contradiction F1"), ("citation_support_accuracy", "Citation support accuracy"), + ("avg_response_time_s", "Avg response time (s)")] + lines = [f"Held-out TEST split ({meta['test_questions']} questions), backend `{meta['backend']}` " + f"(offline fallback components), run {meta['date']}:\n", + "| Metric | " + " | ".join(NAMES[c] for c in ORDER) + " |", "|---|" + "---|" * 4] + for k, lab in keys: + lines.append(f"| {lab} | " + " | ".join(f(m('test', c, k), 4 if 'time' in k else 3) for c in ORDER) + " |") + sb, su = SIG["behaviour_accuracy|test|baseline_vs_full"], SIG["unsupported_answer|test|baseline_vs_full"] + lines.append(f"\nPaired exact McNemar test, baseline vs EvidenceGuard (test split): behaviour accuracy " + f"{sb['difference']:+.3f} (p = {sb['mcnemar_exact_p']:.3f}); unsupported answers " + f"{su['difference']:+.3f} (p = {su['mcnemar_exact_p']:.3f}).") + return "\n".join(lines) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--author", default="Leeshal Princia Monteiro") + ap.add_argument("--usn", default="SCA25MSD042") + ap.add_argument("--programme", default="MSc Data Science, School of Computer Applications") + ap.add_argument("--institution", default="Dayananda Sagar University, Bengaluru") + a = ap.parse_args() + build(a.author, a.usn, a.programme, a.institution) + out = ROOT / "reports" + out.mkdir(exist_ok=True) + (out / "report_model.json").write_text(json.dumps(B, indent=1)) + readme = ROOT / "README.md" + if readme.exists(): + s = readme.read_text() + if "" in s: + pre, rest = s.split("", 1) + post = rest.split("", 1)[1] + readme.write_text(pre + "\n" + readme_table() + "\n" + post) + subprocess.run(["node", str(ROOT / "scripts" / "render_report_docx.js"), str(out / "report_model.json"), + str(out / "project_report.docx")], check=True) + subprocess.run(["soffice", "--headless", "--convert-to", "pdf", "--outdir", str(out), + str(out / "project_report.docx")], check=True, capture_output=True) + print("report written:", out / "project_report.docx", out / "project_report.pdf") + + +if __name__ == "__main__": + main() diff --git a/scripts/corpus_content.py b/scripts/corpus_content.py new file mode 100644 index 0000000000000000000000000000000000000000..387b3670f6399f79c7ed1a09983d36291a1deea8 --- /dev/null +++ b/scripts/corpus_content.py @@ -0,0 +1,618 @@ +""" +Content of the SYNTHETIC university document collection used by EvidenceGuard AI. + +Every document belongs to "Aranya Valley University (AVU)", a FICTIONAL institution. +Nothing here describes a real university or a real policy. The collection is built +deliberately to contain: + * consistent facts that can be answered from one passage, + * facts that need two passages / two documents, + * superseded or contradictory versions of the same rule (conflicts C1-C8), + * topics that are NOT covered anywhere (for abstention tests), + * a distractor document (hostel guidelines) full of look-alike numbers. + +Conflicts deliberately planted: + C1 minimum attendance 75% (Attendance Regs 2023, Exam Eligibility 2024) vs 80% (Circular 2025) + C2 condonation limit 10% / floor 65% (2023) vs 5% / floor 75% (Circular 2025) + C3 condonation fee INR 500 (2023) vs INR 1,000 (Circular 2025) + C4 scholarship deadline 31 Aug 2025 (Policy, Calendar) vs 15 Sep 2025 (Notice) + income ceiling INR 6,00,000 (Policy) vs INR 8,00,000 (Notice) + C5 late assignments: 10%/day for 3 days (Assignment Policy) vs not accepted (IA Guidelines) + C6 PG borrowing 5 books/14 days, fine INR 5 (Library 2023) vs 6 books/21 days, INR 10 (Notice 2025) + C7 add/drop 10 working days (Registration) vs 7 working days (Calendar) + C8 pass mark 40% (Grading Policy) vs 50% for PG (PG Handbook) + C9 exams start 1 Dec 2025 (Timetable) vs 3 Dec 2025 (Calendar) +""" + +UNIVERSITY = "Aranya Valley University (AVU)" + +# Each document: id, filename, title, doc_no, issued, effective, version, pages (list of +# list-of-sections). A section is (heading, [paragraph, ...]). Each inner list = one page. +DOCUMENTS = [ + # ------------------------------------------------------------------ D01 + { + "id": "D01", + "filename": "01_Attendance_Regulations_2023.pdf", + "title": "Attendance Regulations 2023", + "doc_no": "AVU/ACAD/ATT/2023", + "issued": "2023-06-15", + "effective": "2023-07-01", + "version": "1.0", + "topic": "Attendance regulations", + "pages": [ + [ + ("1. Purpose and Scope", [ + "These regulations set out the attendance requirements for all undergraduate and " + "postgraduate programmes offered by Aranya Valley University. They apply to every " + "theory, laboratory and tutorial course in which a student is registered.", + "The regulations are issued by the Office of the Dean of Academics and are binding " + "on students, course instructors and Heads of Department.", + ]), + ("2. Definitions", [ + "A contact hour is one scheduled hour of lecture, tutorial or laboratory work. " + "Attendance percentage is the number of contact hours attended divided by the number " + "of contact hours conducted in a course, multiplied by 100.", + ]), + ("3. Minimum Attendance Requirement", [ + "A student must secure a minimum of 75% attendance in each course to be eligible to " + "appear for the end-semester examination of that course.", + "Attendance is calculated separately for every course and is not averaged across courses.", + ]), + ("4. Condonation of Shortage", [ + "The Dean of Academics may condone a shortage of attendance of up to 10% (that is, " + "attendance between 65% and 75%) on documented medical grounds.", + "A condonation fee of INR 500 per course is payable before the condonation order is issued.", + ]), + ], + [ + ("5. Recording and Publication of Attendance", [ + "Faculty must upload attendance to the AVU-Learn portal within 48 hours of each class.", + "The list of students with attendance shortage is published 7 days before the " + "commencement of end-semester examinations.", + ]), + ("6. Consequences of Shortage", [ + "A student who fails to meet the requirement after condonation will be marked NE " + "(Not Eligible) and must re-register for the course in a subsequent semester.", + ]), + ("7. Approved Absences", [ + "Participation in university-approved events such as sports, cultural festivals and NCC " + "camps is counted as present for up to 10 contact hours per semester, with prior approval " + "of the Head of Department.", + ]), + ("8. Review", [ + "These regulations will be reviewed by the Academic Council every two years.", + "Issued by: Office of the Dean of Academics, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D02 + { + "id": "D02", + "filename": "02_Circular_Attendance_Amendment_2025.pdf", + "title": "Circular: Amendment to Attendance Regulations", + "doc_no": "AVU/CIRC/2025/014", + "issued": "2025-06-02", + "effective": "2025-07-01", + "version": "2.0 (amendment)", + "topic": "Attendance regulations", + "pages": [ + [ + ("Subject", [ + "Amendment to clauses 3 and 4 of the Attendance Regulations 2023 (AVU/ACAD/ATT/2023).", + ]), + ("Revised Provisions", [ + "With effect from the academic year 2025-26, the minimum attendance requirement for each " + "course is revised to 80%.", + "Condonation on medical grounds is limited to 5% (that is, attendance between 75% and 80%).", + "The condonation fee is revised to INR 1,000 per course.", + ]), + ("Applicability", [ + "This circular supersedes clauses 3 and 4 of the Attendance Regulations 2023. All other " + "provisions of the Attendance Regulations 2023 remain unchanged.", + "Heads of Department are requested to bring this circular to the notice of all students " + "at the start of the academic year.", + "Issued by: Registrar, Aranya Valley University (fictional), 2 June 2025.", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D03 + { + "id": "D03", + "filename": "03_Examination_Eligibility_Rules_2024.pdf", + "title": "Examination Eligibility Rules 2024", + "doc_no": "AVU/EXAM/ELG/2024", + "issued": "2024-01-02", + "effective": "2024-01-15", + "version": "1.0", + "topic": "Examination eligibility", + "pages": [ + [ + ("1. Scope", [ + "These rules determine whether a student may appear for the end-semester examination " + "of a course. They are administered by the Controller of Examinations.", + ]), + ("2. Conditions of Eligibility", [ + "To be eligible for the end-semester examination, a student must satisfy all of the following conditions.", + "(a) The student must satisfy the attendance requirement of 75% in the course as per the Attendance Regulations.", + "(b) The student must secure at least 40% of the internal assessment marks in the course, " + "that is, at least 16 out of 40.", + "(c) The student must have no outstanding tuition fee dues.", + "(d) The student must have registered for the course in the current semester.", + ]), + ("3. Hall Tickets", [ + "Hall tickets are issued through the AVU-Learn portal 5 days before the first examination.", + "A student who is not eligible will not be issued a hall ticket for that course.", + ]), + ], + [ + ("4. Appeals", [ + "A student may appeal against an eligibility decision to the Controller of Examinations " + "within 3 working days of the publication of the eligibility list.", + ]), + ("5. Library and Other Dues", [ + "Library dues do not affect examination eligibility but must be cleared before results are released.", + ]), + ("6. Students Not Eligible", [ + "Students declared not eligible must re-register for the course when it is next offered " + "and satisfy all eligibility conditions afresh.", + "Issued by: Controller of Examinations, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D04 + { + "id": "D04", + "filename": "04_Internal_Assessment_Guidelines_2024.pdf", + "title": "Internal Assessment Guidelines 2024", + "doc_no": "AVU/ACAD/IA/2024", + "issued": "2024-05-20", + "effective": "2024-07-01", + "version": "1.0", + "topic": "Internal assessment", + "pages": [ + [ + ("1. Mark Distribution", [ + "Each theory course carries 100 marks: 40 marks for internal assessment (IA) and 60 marks " + "for the end-semester examination.", + ]), + ("2. Components of Internal Assessment", [ + "Internal assessment consists of Internal Test 1 (15 marks), Internal Test 2 (15 marks), " + "Assignment (5 marks), and Class participation and quizzes (5 marks).", + "Internal tests are of 60 minutes duration and are conducted in the 7th and 13th weeks of the semester.", + ]), + ("3. Make-up Tests", [ + "A student who misses an internal test on medical grounds may take one make-up test per " + "semester, provided a medical certificate is submitted within 3 working days of the missed test.", + ]), + ], + [ + ("4. Assignments", [ + "Assignments submitted after the deadline will not be accepted for internal assessment.", + "Instructors must announce assignment topics at least two weeks before the due date.", + ]), + ("5. Publication and Review of Marks", [ + "IA marks are published on AVU-Learn within 10 working days of each test.", + "Students may request a review of IA marks within 5 working days of publication.", + ]), + ("6. Records", [ + "Answer scripts of internal tests are retained by the department for one year.", + "Issued by: Office of the Dean of Academics, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D05 + { + "id": "D05", + "filename": "05_Assignment_Submission_Policy_2024.pdf", + "title": "Assignment Submission Policy 2024", + "doc_no": "AVU/ACAD/ASN/2024", + "issued": "2024-06-10", + "effective": "2024-07-01", + "version": "1.0", + "topic": "Assignment submission", + "pages": [ + [ + ("1. Mode of Submission", [ + "All assignments must be submitted through the AVU-Learn portal by 11:59 PM on the due date.", + "Email submissions are not accepted unless the portal is down, as confirmed by the IT Helpdesk.", + "Assignments must be submitted as a single PDF file of no more than 10 MB.", + ]), + ("2. Late Submission", [ + "Late submissions are accepted for up to 3 calendar days after the deadline with a penalty " + "of 10% of the maximum marks per day.", + "Submissions received more than 3 days late receive zero marks.", + ]), + ("3. Extensions", [ + "Extensions of up to 5 days may be granted by the course instructor on medical or " + "compassionate grounds if requested before the deadline.", + ]), + ], + [ + ("4. Academic Integrity", [ + "Every submission is checked with the university similarity checker.", + "A similarity index above 20% requires resubmission within 3 days.", + "A similarity index above 40% results in zero marks and referral to the Academic Integrity Committee.", + ]), + ("5. Group Assignments", [ + "Group assignments may have at most 4 members, and each member must state their individual contribution.", + "Issued by: Office of the Dean of Academics, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D06 + { + "id": "D06", + "filename": "06_Examination_Timetable_Odd_Semester_2025.pdf", + "title": "End-Semester Examination Timetable - Odd Semester 2025-26", + "doc_no": "AVU/EXAM/TT/2025/ODD", + "issued": "2025-10-20", + "effective": "2025-10-20", + "version": "1.0", + "topic": "Examination timetable", + "pages": [ + [ + ("1. Examination Period", [ + "The odd semester end-semester examinations commence on 1 December 2025 and conclude on 12 December 2025.", + "Morning session: 10:00 AM to 1:00 PM. Afternoon session: 2:00 PM to 5:00 PM.", + "Students must report 30 minutes before the start of the session. No student is admitted " + "more than 30 minutes after the start of the session.", + ]), + ("2. MSc Data Science - Semester 3", [ + "01 December 2025 (Monday): MDS301 Deep Learning - Morning session.", + "03 December 2025 (Wednesday): MDS302 Generative AI and LLMs - Morning session.", + "05 December 2025 (Friday): MDS303 Advanced Algorithms and Optimisation - Morning session.", + "08 December 2025 (Monday): MDS304 Information Systems Engineering - Morning session.", + "10 December 2025 (Wednesday): MDS305 Security for Data Science - Afternoon session.", + ]), + ], + [ + ("3. MBA - Semester 3", [ + "02 December 2025 (Tuesday): MBA301 Financial Management - Morning session.", + "04 December 2025 (Thursday): MBA302 Marketing Analytics - Afternoon session.", + "09 December 2025 (Tuesday): MBA303 Strategic Management - Morning session.", + ]), + ("4. BSc Computer Science - Semester 5", [ + "01 December 2025 (Monday): BCS501 Operating Systems - Afternoon session.", + "04 December 2025 (Thursday): BCS502 Computer Networks - Morning session.", + "11 December 2025 (Thursday): BCS503 Software Engineering - Morning session.", + ]), + ("5. General Instructions", [ + "Only non-programmable scientific calculators are permitted in the examination hall.", + "Results of the odd semester examinations will be announced by 15 January 2026.", + "Issued by: Controller of Examinations, Aranya Valley University (fictional), 20 October 2025.", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D07 + { + "id": "D07", + "filename": "07_Scholarship_Policy_2025-26.pdf", + "title": "Scholarship Policy 2025-26", + "doc_no": "AVU/SCH/2025", + "issued": "2025-05-01", + "effective": "2025-05-01", + "version": "1.0", + "topic": "Scholarship eligibility", + "pages": [ + [ + ("1. Merit Scholarship", [ + "Students with a CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver.", + "Students with a CGPA between 8.5 and 8.99 receive a 25% tuition fee waiver.", + ]), + ("2. Need-based Scholarship", [ + "A need-based scholarship of INR 30,000 per year is available to students whose annual " + "family income does not exceed INR 6,00,000.", + "Applicants must submit an income certificate issued by a competent authority within the " + "last 6 months and the marks card of the previous year.", + ]), + ("3. Application", [ + "Applications must be submitted on AVU-Learn by 31 August 2025.", + ]), + ], + [ + ("4. Conditions", [ + "A student may hold only one university scholarship at a time; if eligible for more than one, " + "the higher-value scholarship is awarded.", + "Students may simultaneously hold one external (government or private) scholarship.", + "Scholarship holders must maintain a minimum of 75% attendance in every course.", + ]), + ("5. Renewal", [ + "Scholarships are renewed annually subject to a CGPA of at least 8.0 and no disciplinary action.", + "Issued by: Scholarship Cell, Aranya Valley University (fictional), 1 May 2025.", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D08 + { + "id": "D08", + "filename": "08_Scholarship_Revised_Notice_2025.pdf", + "title": "Notice: Revision of Scholarship Deadline and Income Ceiling", + "doc_no": "AVU/SCH/NOT/2025/07", + "issued": "2025-08-25", + "effective": "2025-08-25", + "version": "1.1 (notice)", + "topic": "Scholarship eligibility", + "pages": [ + [ + ("Notice", [ + "The last date for scholarship applications for 2025-26 is extended to 15 September 2025.", + "The family income ceiling for the need-based scholarship is revised to INR 8,00,000.", + "All other conditions of the Scholarship Policy 2025-26 remain unchanged.", + "Issued by: Scholarship Cell, Aranya Valley University (fictional), 25 August 2025.", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D09 + { + "id": "D09", + "filename": "09_Course_Registration_Guidelines_2025.pdf", + "title": "Course Registration Guidelines 2025", + "doc_no": "AVU/ACAD/REG/2025", + "issued": "2025-06-05", + "effective": "2025-07-01", + "version": "1.0", + "topic": "Course registration", + "pages": [ + [ + ("1. Registration Window", [ + "Course registration for the odd semester opens on 1 July 2025 and closes on 15 July 2025.", + "Late registration is permitted until 22 July 2025 with a late fee of INR 2,000.", + "Registration requires clearance of previous semester fees and approval of the faculty advisor.", + ]), + ("2. Credit Limits", [ + "PG students must register for a minimum of 18 and a maximum of 26 credits per semester.", + "Audit courses do not count toward credit limits.", + "A student may register for a maximum of 2 open electives per semester.", + ]), + ], + [ + ("3. Add and Drop", [ + "Students may add or drop elective courses within 10 working days from the start of classes.", + "Core courses cannot be dropped.", + ]), + ("4. Prerequisites", [ + "A student may register for a course only after passing its prerequisite courses, as listed in the programme structure.", + "Issued by: Office of the Dean of Academics, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D10 + { + "id": "D10", + "filename": "10_Academic_Leave_Policy_2024.pdf", + "title": "Academic Leave Policy 2024", + "doc_no": "AVU/ACAD/LV/2024", + "issued": "2024-03-11", + "effective": "2024-07-01", + "version": "1.0", + "topic": "Academic leave", + "pages": [ + [ + ("1. Leave of Absence", [ + "A student may apply for academic leave (leave of absence) for a maximum of two semesters " + "during the entire programme.", + "Applications must be submitted to the Dean of Academics at least 30 days before the start of " + "the semester, except in medical emergencies.", + "Students may avail maternity leave of up to 6 months, which is counted within the academic leave limit.", + ]), + ("2. Medical Leave", [ + "Medical leave of up to 15 days within a semester may be approved by the Head of Department on " + "submission of a medical certificate from a registered medical practitioner.", + "Approved medical leave does not count as attendance; it is considered only for condonation.", + ]), + ], + [ + ("3. Fees During Leave", [ + "Students on academic leave are not charged tuition fees for the leave semester but must pay a " + "registration retention fee of INR 5,000 per semester.", + ]), + ("4. Duration and Return", [ + "The maximum duration to complete a programme is the normal duration plus two years, including any academic leave.", + "Students returning from leave must re-register within the regular registration window.", + "Issued by: Office of the Dean of Academics, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D11 + { + "id": "D11", + "filename": "11_Library_Regulations_2023.pdf", + "title": "Central Library Regulations 2023", + "doc_no": "AVU/LIB/2023", + "issued": "2023-07-01", + "effective": "2023-07-01", + "version": "1.0", + "topic": "Library regulations", + "pages": [ + [ + ("1. Library Hours", [ + "The Central Library is open from 8:00 AM to 10:00 PM on working days and from 9:00 AM to " + "5:00 PM on Saturdays. It remains closed on Sundays and university holidays.", + "A valid university ID card is mandatory for entry.", + ]), + ("2. Borrowing Limits", [ + "Undergraduate students may borrow up to 3 books for 14 days.", + "Postgraduate students may borrow up to 5 books for 14 days.", + "Research scholars may borrow up to 8 books for 30 days.", + ]), + ], + [ + ("3. Renewal and Reference Books", [ + "A borrowed book may be renewed once if it has not been reserved by another member.", + "Reference books cannot be borrowed and must be used within the library.", + ]), + ("4. Fines and Losses", [ + "An overdue fine of INR 5 per book per day is charged.", + "Lost books must be replaced or paid for at twice the current price.", + ]), + ("5. Electronic Resources", [ + "Subscribed e-journals can be accessed off campus through the library remote access service using university credentials.", + "Issued by: University Librarian, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D12 + { + "id": "D12", + "filename": "12_Library_Notice_2025.pdf", + "title": "Library Notice: Revised Borrowing Rules", + "doc_no": "AVU/LIB/NOT/2025/03", + "issued": "2025-07-10", + "effective": "2025-08-01", + "version": "2.0 (notice)", + "topic": "Library regulations", + "pages": [ + [ + ("Notice", [ + "With effect from 1 August 2025, postgraduate students may borrow up to 6 books for a period of 21 days.", + "The overdue fine is revised to INR 10 per book per day.", + "Library hours during examination periods are extended until 12:00 midnight on working days.", + "Issued by: University Librarian, Aranya Valley University (fictional), 10 July 2025.", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D13 + { + "id": "D13", + "filename": "13_Grading_and_Academic_Progression_Policy_2024.pdf", + "title": "Grading and Academic Progression Policy 2024", + "doc_no": "AVU/ACAD/GRD/2024", + "issued": "2024-04-02", + "effective": "2024-07-01", + "version": "1.0", + "topic": "Grading and academic progression", + "pages": [ + [ + ("1. Grading Scale", [ + "Grades are awarded on a 10-point scale as follows.", + "Grade O (grade point 10): 90 to 100 marks. Grade A+ (grade point 9): 80 to 89 marks. " + "Grade A (grade point 8): 70 to 79 marks. Grade B+ (grade point 7): 60 to 69 marks. " + "Grade B (grade point 6): 50 to 59 marks. Grade C (grade point 5): 40 to 49 marks. " + "Grade F (grade point 0): below 40 marks.", + ]), + ("2. Passing a Course", [ + "To pass a course, a student must secure at least 40% marks in aggregate (internal assessment " + "plus end-semester examination) and at least 35% in the end-semester examination (21 out of 60).", + ]), + ("3. SGPA and CGPA", [ + "SGPA is the credit-weighted average of grade points in a semester; CGPA is the credit-weighted " + "average of grade points over all completed semesters.", + ]), + ], + [ + ("4. Progression", [ + "A student with more than 4 backlog courses at the end of an academic year will not be promoted to the next year.", + "Supplementary examinations are held in June and July; the maximum grade awarded in a supplementary examination is grade A.", + ]), + ("5. Classification", [ + "First Class with Distinction is awarded for a CGPA of 8.0 or above. First Class is awarded for a " + "CGPA from 6.5 to 7.99. Second Class is awarded for a CGPA from 5.5 to 6.49.", + "Issued by: Controller of Examinations, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D14 + { + "id": "D14", + "filename": "14_Academic_Calendar_2025-26.pdf", + "title": "Academic Calendar 2025-26 (Odd Semester)", + "doc_no": "AVU/CAL/2025-26", + "issued": "2025-06-15", + "effective": "2025-07-01", + "version": "1.0", + "topic": "Academic calendar", + "pages": [ + [ + ("1. Key Dates - Odd Semester 2025-26", [ + "Odd semester classes begin on 21 July 2025.", + "Add/drop period for electives: 7 working days from the start of classes.", + "Last date for scholarship applications: 31 August 2025.", + "Internal Test 1: 1 September 2025 to 5 September 2025.", + "Internal Test 2: 13 October 2025 to 17 October 2025.", + "Last working day of the odd semester: 21 November 2025.", + "End-semester examinations: from 3 December 2025.", + ]), + ], + [ + ("2. Holidays", [ + "Ganesh Chaturthi: 27 August 2025. Gandhi Jayanti: 2 October 2025. Deepavali: 20 and 21 October 2025.", + ]), + ("3. Even Semester", [ + "Even semester classes begin on 5 January 2026.", + "Issued by: Office of the Dean of Academics, Aranya Valley University (fictional), 15 June 2025.", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D15 + { + "id": "D15", + "filename": "15_PG_Programme_Handbook_Extract_2025.pdf", + "title": "Postgraduate Programme Handbook 2025-26 (Extract)", + "doc_no": "AVU/PG/HB/2025", + "issued": "2025-07-05", + "effective": "2025-07-21", + "version": "1.0", + "topic": "Grading and academic progression", + "pages": [ + [ + ("1. About this Handbook", [ + "This handbook summarises key academic rules for postgraduate (PG) students. Where it differs " + "from a university regulation, students should seek clarification from the Dean of Academics.", + ]), + ("2. Passing Standard for PG Courses", [ + "PG students must obtain at least 50% marks in aggregate to pass a course.", + ]), + ("3. Dissertation", [ + "The PG dissertation carries 12 credits and is evaluated by an internal guide and an external examiner.", + "Issued by: Office of Postgraduate Studies, Aranya Valley University (fictional).", + ]), + ], + ], + }, + # ------------------------------------------------------------------ D16 (distractor) + { + "id": "D16", + "filename": "16_Hostel_and_Campus_Facilities_Guidelines_2025.pdf", + "title": "Hostel and Campus Facilities Guidelines 2025", + "doc_no": "AVU/HOSTEL/2025", + "issued": "2025-06-20", + "effective": "2025-07-01", + "version": "1.0", + "topic": "Hostel and facilities (distractor)", + "pages": [ + [ + ("1. Hostel Timings", [ + "Hostel residents must be inside the hostel premises by 9:30 PM on all days.", + "Guests may stay in the hostel guest room for a maximum of 2 days with prior permission of the warden.", + ]), + ("2. Fees", [ + "The mess fee is INR 4,500 per month, payable by the 10th of each month.", + "Late payment of hostel dues attracts a fine of INR 500.", + ]), + ("3. Allotment", [ + "75% of hostel rooms are reserved for first-year students. Room allotment is valid for one academic year.", + ]), + ], + [ + ("4. Campus Facilities", [ + "The gymnasium is open from 6:00 AM to 9:00 AM and from 5:00 PM to 8:00 PM.", + "Campus Wi-Fi is available to residents with a daily limit of 5 GB.", + "Issued by: Chief Warden, Aranya Valley University (fictional).", + ]), + ], + ], + }, +] diff --git a/scripts/generate_dataset.py b/scripts/generate_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..13cdc2fa1d5794df5748a4b6554c44107c1bca09 --- /dev/null +++ b/scripts/generate_dataset.py @@ -0,0 +1,156 @@ +""" +Regenerates the complete SYNTHETIC dataset for EvidenceGuard AI: + + 1. sample_data/*.pdf - 16 fictional university documents (real PDFs) + 2. sample_data/corpus_manifest.json - metadata for every document + 3. evaluation_data/questions.json - 100 evaluation questions with evidence pages + 4. evaluation_data/questions.csv - same, flattened + +Every evidence phrase is located in the extracted PDF text; the script fails loudly if +any phrase cannot be found, so the questions are guaranteed to be derived from the PDFs. + +Usage: python scripts/generate_dataset.py +""" +from __future__ import annotations + +import csv +import json +import sys +from collections import Counter +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT)) +sys.path.insert(0, str(ROOT / "scripts")) + +from reportlab.lib import colors # noqa: E402 +from reportlab.lib.enums import TA_CENTER # noqa: E402 +from reportlab.lib.pagesizes import A4 # noqa: E402 +from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet # noqa: E402 +from reportlab.lib.units import cm # noqa: E402 +from reportlab.platypus import (PageBreak, Paragraph, SimpleDocTemplate, # noqa: E402 + Spacer, Table, TableStyle) + +from corpus_content import DOCUMENTS, UNIVERSITY # noqa: E402 +from questions_spec import Q # noqa: E402 +from src.text_utils import normalize # noqa: E402 + +SAMPLE = ROOT / "sample_data" +EVAL = ROOT / "evaluation_data" +BANNER = "SYNTHETIC DEMONSTRATION DATA - fictional university, not a real policy" + + +def _styles(): + ss = getSampleStyleSheet() + return { + "title": ParagraphStyle("t", parent=ss["Title"], fontSize=16, leading=20, spaceAfter=6), + "sub": ParagraphStyle("s", parent=ss["Normal"], fontSize=9.5, alignment=TA_CENTER, + textColor=colors.HexColor("#444444")), + "h": ParagraphStyle("h", parent=ss["Heading2"], fontSize=12, spaceBefore=10, spaceAfter=4), + "p": ParagraphStyle("p", parent=ss["Normal"], fontSize=10.5, leading=14.5, spaceAfter=6), + } + + +def render_pdf(doc: dict, path: Path) -> None: + st = _styles() + total_pages = len(doc["pages"]) + + def on_page(canvas, d): + canvas.saveState() + canvas.setFillColor(colors.HexColor("#B00020")) + canvas.setFont("Helvetica-Bold", 8.5) + canvas.drawCentredString(A4[0] / 2, A4[1] - 1.1 * cm, BANNER) + canvas.setFillColor(colors.HexColor("#555555")) + canvas.setFont("Helvetica", 8.5) + canvas.drawString(2 * cm, 1.2 * cm, f"{doc['doc_no']} | {doc['title']}") + canvas.drawRightString(A4[0] - 2 * cm, 1.2 * cm, f"Page {d.page} of {total_pages}") + canvas.restoreState() + + flow = [ + Paragraph(UNIVERSITY + " (fictional)", st["sub"]), + Paragraph(doc["title"], st["title"]), + ] + meta = Table( + [["Document No.", doc["doc_no"], "Version", doc["version"]], + ["Issued", doc["issued"], "Effective from", doc["effective"]]], + colWidths=[3.0 * cm, 5.2 * cm, 3.0 * cm, 5.0 * cm], + ) + meta.setStyle(TableStyle([ + ("FONT", (0, 0), (-1, -1), "Helvetica", 9), + ("FONT", (0, 0), (0, -1), "Helvetica-Bold", 9), + ("FONT", (2, 0), (2, -1), "Helvetica-Bold", 9), + ("GRID", (0, 0), (-1, -1), 0.4, colors.grey), + ("BACKGROUND", (0, 0), (-1, -1), colors.HexColor("#F4F6F8")), + ])) + flow += [meta, Spacer(1, 8)] + for pi, page in enumerate(doc["pages"]): + if pi > 0: + flow.append(PageBreak()) + for heading, paras in page: + flow.append(Paragraph(heading, st["h"])) + for para in paras: + flow.append(Paragraph(para, st["p"])) + SimpleDocTemplate(str(path), pagesize=A4, topMargin=2 * cm, bottomMargin=2 * cm, + leftMargin=2 * cm, rightMargin=2 * cm, title=doc["title"], + author="EvidenceGuard AI synthetic data generator", + subject=BANNER).build(flow, onFirstPage=on_page, onLaterPages=on_page) + + +def extract_pages(path: Path) -> list[str]: + import pymupdf + with pymupdf.open(str(path)) as pdf: + return [p.get_text() for p in pdf] + + +def main() -> None: + SAMPLE.mkdir(exist_ok=True) + EVAL.mkdir(exist_ok=True) + manifest, page_text = [], {} + for doc in DOCUMENTS: + path = SAMPLE / doc["filename"] + render_pdf(doc, path) + pages = extract_pages(path) + assert len(pages) == len(doc["pages"]), f"{doc['id']}: expected {len(doc['pages'])} pages, got {len(pages)}" + page_text[doc["id"]] = [normalize(p) for p in pages] + manifest.append({k: doc[k] for k in ("id", "filename", "title", "doc_no", "issued", + "effective", "version", "topic")} | {"pages": len(pages)}) + (SAMPLE / "corpus_manifest.json").write_text(json.dumps(manifest, indent=2)) + by_id = {d["id"]: d for d in DOCUMENTS} + + rows = [] + for q in Q: + ev = [] + for doc_id, phrase in q["evidence"]: + pages = [i + 1 for i, t in enumerate(page_text[doc_id]) if normalize(phrase) in t] + if not pages: + raise SystemExit(f"[{q['id']}] evidence phrase not found in {doc_id}: {phrase!r}") + ev.append({"doc_id": doc_id, "document": by_id[doc_id]["filename"], + "title": by_id[doc_id]["title"], "page": pages[0], "phrase": phrase}) + for kw in q["keywords"]: # every key fact must exist in its evidence + alts = [normalize(a).strip() for a in kw.split("|")] + if ev and not any(any(a in page_text[e["doc_id"]][e["page"] - 1] for a in alts) for e in ev): + raise SystemExit(f"[{q['id']}] keyword {kw!r} not present in its evidence pages") + rows.append({ + "id": q["id"], "category": q["category"], "question": q["question"], + "expected_answer": q["expected_answer"], "answer_keywords": q["keywords"], + "evidence": ev, + "supporting_document": "; ".join(sorted({e["document"] for e in ev})) or "NONE", + "supporting_page": "; ".join(f"{e['doc_id']} p.{e['page']}" for e in ev) or "NONE", + "expected_evidence_status": q["status"], "expected_behaviour": q["behaviour"], + }) + + (EVAL / "questions.json").write_text(json.dumps(rows, indent=2)) + with open(EVAL / "questions.csv", "w", newline="") as f: + w = csv.DictWriter(f, fieldnames=["id", "category", "question", "expected_answer", "answer_keywords", + "supporting_document", "supporting_page", + "expected_evidence_status", "expected_behaviour"]) + w.writeheader() + for r in rows: + w.writerow({k: ("; ".join(r[k]) if k == "answer_keywords" else r[k]) for k in w.fieldnames}) + + print(f"Generated {len(manifest)} PDFs ({sum(m['pages'] for m in manifest)} pages) in {SAMPLE}") + print(f"Generated {len(rows)} questions:", dict(Counter(r["category"] for r in rows))) + + +if __name__ == "__main__": + main() diff --git a/scripts/make_diagrams.py b/scripts/make_diagrams.py new file mode 100644 index 0000000000000000000000000000000000000000..e73fa2604c28f8bb1ed2f8dc1c80f016435906ea --- /dev/null +++ b/scripts/make_diagrams.py @@ -0,0 +1,130 @@ +"""Draws assets/architecture.png and assets/workflow.png with matplotlib (no external tools).""" +from pathlib import Path + +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt # noqa: E402 +from matplotlib.patches import FancyArrowPatch, FancyBboxPatch # noqa: E402 + +ASSETS = Path(__file__).resolve().parents[1] / "assets" +ASSETS.mkdir(exist_ok=True) +INK, MUTED, SURF = "#0b0b0b", "#52514e", "#fcfcfb" +BLUE, ORANGE, AQUA, YELLOW = "#cde2fb", "#fbdccd", "#c9eedf", "#fbe7b5" +EDGE = {BLUE: "#2a78d6", ORANGE: "#eb6834", AQUA: "#1baf7a", YELLOW: "#c98500", "#eeeeea": "#8a8986"} + + +def box(ax, x, y, w, h, text, fill, size=9, bold=False): + ax.add_patch(FancyBboxPatch((x, y), w, h, boxstyle="round,pad=0.02,rounding_size=0.08", + fc=fill, ec=EDGE.get(fill, "#8a8986"), lw=1.3)) + ax.text(x + w / 2, y + h / 2, text, ha="center", va="center", fontsize=size, color=INK, + fontweight="bold" if bold else "normal", wrap=True) + + +def arrow(ax, x1, y1, x2, y2, color=MUTED, style="-|>", ls="-"): + ax.add_patch(FancyArrowPatch((x1, y1), (x2, y2), arrowstyle=style, mutation_scale=12, color=color, + lw=1.3, linestyle=ls, shrinkA=2, shrinkB=2)) + + +def architecture(): + fig, ax = plt.subplots(figsize=(13, 7.4)) + ax.set_xlim(0, 13) + ax.set_ylim(0, 7.4) + ax.axis("off") + fig.patch.set_facecolor(SURF) + ax.text(0.2, 7.05, "EvidenceGuard AI - system architecture", fontsize=14, fontweight="bold", color=INK) + + # ingestion layer + ax.text(0.2, 6.45, "Ingestion layer", fontsize=10, color=MUTED, fontweight="bold") + box(ax, 0.2, 5.4, 1.9, 0.85, "PDF upload /\nsample_data", "#eeeeea") + box(ax, 2.5, 5.4, 2.1, 0.85, "Text extraction\n(PyMuPDF / pypdf)", BLUE) + box(ax, 5.0, 5.4, 2.1, 0.85, "Cleaning +\nmetadata (title, date)", BLUE) + box(ax, 7.5, 5.4, 2.1, 0.85, "Sentence-aware\nchunking (70 words)", BLUE) + box(ax, 10.0, 5.95, 2.8, 0.6, "Embeddings -> FAISS index", BLUE, 8.5) + box(ax, 10.0, 5.2, 2.8, 0.6, "BM25 keyword index", BLUE, 8.5) + for x in (2.1, 4.6, 7.1): + arrow(ax, x, 5.82, x + 0.4, 5.82) + arrow(ax, 9.6, 5.9, 10.0, 6.2) + arrow(ax, 9.6, 5.75, 10.0, 5.5) + + # system A + ax.text(0.2, 4.65, "System A - Baseline RAG", fontsize=10, color=MUTED, fontweight="bold") + box(ax, 0.2, 3.75, 2.2, 0.7, "Question", "#eeeeea") + box(ax, 2.8, 3.75, 2.4, 0.7, "Dense retrieval\n(top-5, FAISS)", BLUE) + box(ax, 5.6, 3.75, 2.4, 0.7, "LLM answer\n+ citations", ORANGE) + box(ax, 8.4, 3.75, 2.0, 0.7, "Answer\n(always)", "#eeeeea") + arrow(ax, 2.4, 4.1, 2.8, 4.1) + arrow(ax, 5.2, 4.1, 5.6, 4.1) + arrow(ax, 8.0, 4.1, 8.4, 4.1) + + # system B + ax.text(0.2, 3.15, "System B - EvidenceGuard RAG", fontsize=10, color=MUTED, fontweight="bold") + y = 2.05 + steps = [("Hybrid retrieval\nFAISS + BM25 (RRF)", BLUE), ("Cross-encoder\nreranking", BLUE), + ("Evidence\nsufficiency", AQUA), ("Conflict search +\ncontradiction (NLI\n+ numeric rules)", AQUA), + ("Grounded LLM\ngeneration", ORANGE), ("Citation\nvalidation", AQUA), ("Confidence +\nabstention", YELLOW)] + x = 0.2 + w = 1.68 + for i, (t, c) in enumerate(steps): + box(ax, x, y, w, 0.95, t, c, 8.2) + if i: + arrow(ax, x - 0.14, y + 0.47, x, y + 0.47) + x += w + 0.14 + box(ax, 0.2, 0.5, 3.6, 0.95, "ANSWERED / PARTIAL /\nCONFLICT WARNING / ABSTAINED", YELLOW, 8.5, True) + box(ax, 4.2, 0.5, 4.2, 0.95, "Explanation: why it answered, partially answered\nor refused (scores, thresholds, missing terms)", "#eeeeea", 8.3) + box(ax, 8.8, 0.5, 4.0, 0.95, "Gradio UI: chat, evidence panel,\nside-by-side comparison, evaluation dashboard", "#eeeeea", 8.3) + arrow(ax, x - 0.14 - w / 2, y, 2.0, 1.45) + arrow(ax, 3.8, 0.97, 4.2, 0.97) + arrow(ax, 8.4, 0.97, 8.8, 0.97) + arrow(ax, 11.4, 5.2, 11.4, 4.45, ls="--") + ax.text(11.5, 4.75, "shared indexes", fontsize=8, color=MUTED) + ax.text(0.2, 0.12, "Blue = retrieval ยท Green = verification (EvidenceGuard contribution) ยท Orange = LLM ยท " + "Yellow = decision. Every model has an offline fallback (LSA embeddings, lexical reranker, rule verifier, " + "extractive composer).", fontsize=8, color=MUTED) + fig.savefig(ASSETS / "architecture.png", dpi=160, bbox_inches="tight", facecolor=SURF) + plt.close(fig) + + +def workflow(): + fig, ax = plt.subplots(figsize=(8.6, 10.5)) + ax.set_xlim(0, 8.6) + ax.set_ylim(0, 10.5) + ax.axis("off") + fig.patch.set_facecolor(SURF) + ax.text(0.2, 10.15, "EvidenceGuard AI - decision workflow", fontsize=14, fontweight="bold", color=INK) + cx, w, h = 1.0, 4.0, 0.62 + ys = [9.2, 8.25, 7.3, 6.35, 5.4, 4.45, 3.5, 2.55] + labels = [("User question (+ follow-up context)", "#eeeeea"), + ("Hybrid retrieval: FAISS + BM25, fused by RRF", BLUE), + ("Cross-encoder reranking -> top-5 passages", BLUE), + ("Evidence sufficiency: relevance & coverage", AQUA), + ("Conflict-search retrieval + contradiction check", AQUA), + ("Context-grounded generation (conflict-aware)", ORANGE), + ("Citation validation of every sentence", AQUA), + ("Confidence = 0.4 rel + 0.4 cov + 0.2 support", YELLOW)] + for (t, c), y in zip(labels, ys): + box(ax, cx, y, w, h, t, c, 8.8) + for a, b in zip(ys, ys[1:]): + arrow(ax, cx + w / 2, a, cx + w / 2, b + h) + # side exits + box(ax, 5.6, 6.35, 2.8, h, "ABSTAIN: insufficient\nevidence (+ missing terms)", YELLOW, 8) + arrow(ax, cx + w, 6.35 + h / 2, 5.6, 6.35 + h / 2) + ax.text(5.08, 6.88, "insufficient", fontsize=7.5, color=MUTED) + box(ax, 5.6, 4.45, 2.8, h, "Conflict note: both versions,\ndates, newer document", "#eeeeea", 8) + arrow(ax, 5.6, 4.45 + h / 2, cx + w, 4.45 + h / 2, ls="--") + box(ax, 5.6, 3.5, 2.8, h, "Drop unsupported sentences;\nnone left -> ABSTAIN", YELLOW, 8) + arrow(ax, cx + w, 3.5 + h / 2, 5.6, 3.5 + h / 2) + outs = [("ANSWERED", 0.2), ("PARTIAL", 2.2), ("CONFLICT\nWARNING", 4.2), ("ABSTAINED", 6.2)] + for t, x in outs: + box(ax, x, 1.1, 1.8, 0.75, t, YELLOW, 8.5, True) + arrow(ax, cx + w / 2, 2.55, x + 0.9, 1.85) + box(ax, 0.2, 0.15, 7.8, 0.6, "Explanation + evidence panel (passages, scores, conflicts, citation checks) shown to the user", + "#eeeeea", 8.5) + fig.savefig(ASSETS / "workflow.png", dpi=160, bbox_inches="tight", facecolor=SURF) + plt.close(fig) + + +if __name__ == "__main__": + architecture() + workflow() + print("diagrams written to", ASSETS) diff --git a/scripts/questions_spec.py b/scripts/questions_spec.py new file mode 100644 index 0000000000000000000000000000000000000000..3c1d4c16b9bafe85f31fb026cd576d86144dcbb7 --- /dev/null +++ b/scripts/questions_spec.py @@ -0,0 +1,334 @@ +""" +Evaluation question specification (100 questions) for the SYNTHETIC AVU corpus. + +Fields + id, category, question, expected_answer, + keywords : list of key facts that a correct answer must contain (normalised match; + an item "a|b" means either a or b is acceptable), + evidence : list of (doc_id, exact phrase) - the page is located automatically, + status : expected evidence status -> sufficient | insufficient | conflicting + behaviour : expected system behaviour -> answer | abstain | flag_conflict | correct_premise + +Categories: answerable (30), multi_passage (20), missing (15), misleading (15), conflicting (20) +""" + +Q = [] + + +def add(qid, cat, question, answer, keywords, evidence, status, behaviour): + Q.append(dict(id=qid, category=cat, question=question, expected_answer=answer, + keywords=keywords, evidence=evidence, status=status, behaviour=behaviour)) + + +# ----------------------------------------------------------------- answerable (30) +A = "answerable" +add("A01", A, "How many marks are allotted to internal assessment in a theory course?", + "40 marks are allotted to internal assessment (the end-semester exam carries 60).", + ["40 marks"], [("D04", "40 marks for internal assessment")], "sufficient", "answer") +add("A02", A, "How many marks does the end-semester examination of a theory course carry?", + "60 marks.", ["60 marks"], [("D04", "60 marks for the end-semester examination")], "sufficient", "answer") +add("A03", A, "What is the duration of an internal test?", + "Internal tests are 60 minutes long.", ["60 minutes"], + [("D04", "Internal tests are of 60 minutes duration")], "sufficient", "answer") +add("A04", A, "Within how many working days must a medical certificate be submitted to take a make-up test?", + "Within 3 working days of the missed test.", ["3 working days"], + [("D04", "medical certificate is submitted within 3 working days of the missed test")], "sufficient", "answer") +add("A05", A, "By what time on the due date must assignments be submitted on AVU-Learn?", + "By 11:59 PM on the due date.", ["11:59"], + [("D05", "by 11:59 PM on the due date")], "sufficient", "answer") +add("A06", A, "What is the maximum file size allowed for an assignment submission?", + "A single PDF of no more than 10 MB.", ["10 mb"], + [("D05", "single PDF file of no more than 10 MB")], "sufficient", "answer") +add("A07", A, "What is the maximum number of members allowed in a group assignment?", + "At most 4 members.", ["4 members"], [("D05", "at most 4 members")], "sufficient", "answer") +add("A08", A, "What happens if an assignment has a similarity index above 40%?", + "It receives zero marks and is referred to the Academic Integrity Committee.", + ["zero marks", "academic integrity committee"], + [("D05", "A similarity index above 40% results in zero marks")], "sufficient", "answer") +add("A09", A, "On what date do the odd semester end-semester examinations conclude?", + "12 December 2025.", ["12 december 2025"], + [("D06", "conclude on 12 December 2025")], "sufficient", "answer") +add("A10", A, "What are the timings of the afternoon examination session?", + "2:00 PM to 5:00 PM.", ["2:00 pm", "5:00 pm"], + [("D06", "Afternoon session: 2:00 PM to 5:00 PM")], "sufficient", "answer") +add("A11", A, "How early must students report before an examination session starts?", + "30 minutes before the start of the session.", ["30 minutes"], + [("D06", "Students must report 30 minutes before the start of the session")], "sufficient", "answer") +add("A12", A, "On which date is the MDS302 Generative AI and LLMs examination?", + "03 December 2025, morning session.", ["03 december 2025|3 december 2025"], + [("D06", "MDS302 Generative AI and LLMs")], "sufficient", "answer") +add("A13", A, "What type of calculator is permitted in the examination hall?", + "Only non-programmable scientific calculators.", ["non-programmable"], + [("D06", "Only non-programmable scientific calculators are permitted")], "sufficient", "answer") +add("A14", A, "By when will the odd semester examination results be announced?", + "By 15 January 2026.", ["15 january 2026"], + [("D06", "will be announced by 15 January 2026")], "sufficient", "answer") +add("A15", A, "What tuition fee waiver does a student with a CGPA of 9.0 or above receive?", + "A 50% tuition fee waiver.", ["50%"], + [("D07", "CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver")], "sufficient", "answer") +add("A16", A, "What tuition fee waiver is given to students with a CGPA between 8.5 and 8.99?", + "A 25% tuition fee waiver.", ["25%"], + [("D07", "between 8.5 and 8.99 receive a 25% tuition fee waiver")], "sufficient", "answer") +add("A17", A, "What is the amount of the need-based scholarship?", + "INR 30,000 per year.", ["30000"], + [("D07", "need-based scholarship of INR 30,000 per year")], "sufficient", "answer") +add("A18", A, "What CGPA is required for a scholarship to be renewed?", + "A CGPA of at least 8.0 (and no disciplinary action).", ["8.0"], + [("D07", "renewed annually subject to a CGPA of at least 8.0")], "sufficient", "answer") +add("A19", A, "Can a student hold an external scholarship together with a university scholarship?", + "Yes, a student may simultaneously hold one external (government or private) scholarship.", + ["one external"], [("D07", "simultaneously hold one external")], "sufficient", "answer") +add("A20", A, "How many credits must a PG student register for in a semester?", + "A minimum of 18 and a maximum of 26 credits.", ["18", "26"], + [("D09", "minimum of 18 and a maximum of 26 credits per semester")], "sufficient", "answer") +add("A21", A, "What is the fee for late course registration?", + "INR 2,000 (late registration allowed until 22 July 2025).", ["2000"], + [("D09", "with a late fee of INR 2,000")], "sufficient", "answer") +add("A22", A, "How many open electives can a student register for per semester?", + "A maximum of 2 open electives per semester.", ["2 open electives"], + [("D09", "maximum of 2 open electives per semester")], "sufficient", "answer") +add("A23", A, "For how many semesters can a student take academic leave during the programme?", + "A maximum of two semesters.", ["two semesters"], + [("D10", "maximum of two semesters")], "sufficient", "answer") +add("A24", A, "How far in advance must an application for academic leave be submitted?", + "At least 30 days before the start of the semester (except medical emergencies).", ["30 days"], + [("D10", "at least 30 days before the start of the semester")], "sufficient", "answer") +add("A25", A, "What fee must a student pay per semester while on academic leave?", + "A registration retention fee of INR 5,000 per semester (no tuition fee).", ["5000"], + [("D10", "registration retention fee of INR 5,000 per semester")], "sufficient", "answer") +add("A26", A, "What is the maximum duration allowed to complete a programme?", + "The normal duration plus two years, including any academic leave.", ["two years"], + [("D10", "normal duration plus two years")], "sufficient", "answer") +add("A27", A, "What are the Central Library's opening hours on Saturdays?", + "9:00 AM to 5:00 PM.", ["9:00 am", "5:00 pm"], + [("D11", "from 9:00 AM to 5:00 PM on Saturdays")], "sufficient", "answer") +add("A28", A, "How many books can research scholars borrow and for how long?", + "Up to 8 books for 30 days.", ["8 books", "30 days"], + [("D11", "Research scholars may borrow up to 8 books for 30 days")], "sufficient", "answer") +add("A29", A, "Which grade is awarded for marks between 80 and 89?", + "Grade A+ (grade point 9).", ["a+"], + [("D13", "Grade A+ (grade point 9): 80 to 89 marks")], "sufficient", "answer") +add("A30", A, "What minimum mark is needed in the end-semester examination to pass a course?", + "At least 35% in the end-semester examination (21 out of 60).", ["35%|21 out of 60"], + [("D13", "at least 35% in the end-semester examination (21 out of 60)")], "sufficient", "answer") + +# ----------------------------------------------------------------- multi-passage (20) +M = "multi_passage" +add("M01", M, "What minimum internal assessment marks are needed for exam eligibility, and how many marks is each internal test worth?", + "At least 16 out of 40 IA marks (40%); each internal test is worth 15 marks.", ["16", "15 marks"], + [("D03", "that is, at least 16 out of 40"), ("D04", "Internal Test 1 (15 marks)")], "sufficient", "answer") +add("M02", M, "When is Internal Test 1 held this semester, and what must a student do to take a make-up test if they miss it through illness?", + "1-5 September 2025; submit a medical certificate within 3 working days to take one make-up test.", + ["1 september 2025", "3 working days"], + [("D14", "Internal Test 1: 1 September 2025 to 5 September 2025"), + ("D04", "medical certificate is submitted within 3 working days of the missed test")], "sufficient", "answer") +add("M03", M, "What happens to a student whose attendance is still short after condonation, and to whom can an eligibility decision be appealed?", + "They are marked NE (Not Eligible) and must re-register; appeals go to the Controller of Examinations within 3 working days.", + ["not eligible", "controller of examinations"], + [("D01", "will be marked NE"), ("D03", "may appeal against an eligibility decision")], "sufficient", "answer") +add("M04", M, "Does approved medical leave count as attendance, and for how many days can a Head of Department approve medical leave?", + "No, it does not count as attendance (only for condonation); up to 15 days per semester.", + ["15 days", "condonation"], + [("D10", "Medical leave of up to 15 days"), ("D10", "Approved medical leave does not count as attendance")], "sufficient", "answer") +add("M05", M, "Do library dues affect examination eligibility, and what is charged for a lost library book?", + "No, but they must be cleared before results are released; lost books cost twice the current price.", + ["results", "twice"], + [("D03", "Library dues do not affect examination eligibility"), ("D11", "paid for at twice the current price")], "sufficient", "answer") +add("M06", M, "What CGPA is needed for First Class with Distinction, and what CGPA earns a 50% merit tuition waiver?", + "8.0 or above for First Class with Distinction; 9.0 or above for a 50% waiver.", ["8.0", "9.0"], + [("D13", "First Class with Distinction is awarded for a CGPA of 8.0 or above"), + ("D07", "CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver")], "sufficient", "answer") +add("M07", M, "Can reference books be borrowed, and how many times can a borrowed book be renewed?", + "Reference books cannot be borrowed; a borrowed book can be renewed once if not reserved.", ["cannot", "once"], + [("D11", "Reference books cannot be borrowed"), ("D11", "may be renewed once")], "sufficient", "answer") +add("M08", M, "How many internal assessment marks are given for assignments, and in what file format must assignments be submitted?", + "5 marks; as a single PDF file (max 10 MB).", ["5 marks", "pdf"], + [("D04", "Assignment (5 marks)"), ("D05", "single PDF file of no more than 10 MB")], "sufficient", "answer") +add("M09", M, "When does odd semester course registration close, and what is the last date for late registration?", + "Closes 15 July 2025; late registration until 22 July 2025.", ["15 july 2025", "22 july 2025"], + [("D09", "closes on 15 July 2025"), ("D09", "permitted until 22 July 2025")], "sufficient", "answer") +add("M10", M, "When do odd semester classes begin and what is the last working day of the odd semester?", + "Classes begin 21 July 2025; last working day 21 November 2025.", ["21 july 2025", "21 november 2025"], + [("D14", "classes begin on 21 July 2025"), ("D14", "Last working day of the odd semester: 21 November 2025")], "sufficient", "answer") +add("M11", M, "What documents must be submitted for the need-based scholarship, and how recent must the income certificate be?", + "An income certificate from a competent authority issued within the last 6 months, and the previous year's marks card.", + ["6 months", "marks card"], + [("D07", "within the last 6 months and the marks card of the previous year")], "sufficient", "answer") +add("M12", M, "If a student qualifies for both the merit and need-based scholarships, what do they receive, and what is needed to renew it?", + "Only the higher-value scholarship; renewal needs a CGPA of at least 8.0 and no disciplinary action.", + ["higher-value", "8.0"], + [("D07", "the higher-value scholarship is awarded"), ("D07", "renewed annually subject to a CGPA of at least 8.0")], "sufficient", "answer") +add("M13", M, "How long is each internal test and in which weeks of the semester are they conducted?", + "60 minutes; in the 7th and 13th weeks.", ["60 minutes", "7th", "13th"], + [("D04", "conducted in the 7th and 13th weeks of the semester")], "sufficient", "answer") +add("M14", M, "Within how many days are internal assessment marks published after a test, and how long do students have to request a review?", + "Within 10 working days; review requests within 5 working days of publication.", + ["10 working days", "5 working days"], + [("D04", "within 10 working days of each test"), ("D04", "within 5 working days of publication")], "sufficient", "answer") +add("M15", M, "How long an extension can an instructor grant for an assignment, and what happens if the similarity index is above 20%?", + "Up to 5 days if requested before the deadline; similarity above 20% requires resubmission within 3 days.", + ["5 days", "resubmission"], + [("D05", "Extensions of up to 5 days"), ("D05", "A similarity index above 20% requires resubmission within 3 days")], "sufficient", "answer") +add("M16", M, "Which MSc Data Science Semester 3 examination is held in the afternoon session, and what are the afternoon session timings?", + "MDS305 Security for Data Science on 10 December 2025; 2:00 PM to 5:00 PM.", + ["security for data science|mds305", "2:00 pm"], + [("D06", "MDS305 Security for Data Science - Afternoon session"), ("D06", "Afternoon session: 2:00 PM to 5:00 PM")], "sufficient", "answer") +add("M17", M, "When are supplementary examinations held, and what is the maximum grade that can be awarded in them?", + "In June and July; the maximum grade is A.", ["june", "grade a"], + [("D13", "Supplementary examinations are held in June and July")], "sufficient", "answer") +add("M18", M, "How many backlog courses prevent promotion to the next year, and when can backlogs be cleared through supplementary examinations?", + "More than 4 backlog courses; supplementary exams are held in June and July.", ["4 backlog", "june"], + [("D13", "more than 4 backlog courses"), ("D13", "Supplementary examinations are held in June and July")], "sufficient", "answer") +add("M19", M, "How is participation in university-approved events treated for attendance, and who must approve it?", + "Counted as present for up to 10 contact hours per semester with prior approval of the Head of Department.", + ["10 contact hours", "head of department"], + [("D01", "counted as present for up to 10 contact hours")], "sufficient", "answer") +add("M20", M, "A student returning from academic leave must re-register within which window, and what are the regular odd semester registration dates?", + "Within the regular registration window: 1 July 2025 to 15 July 2025.", ["1 july 2025", "15 july 2025"], + [("D10", "must re-register within the regular registration window"), + ("D09", "opens on 1 July 2025 and closes on 15 July 2025")], "sufficient", "answer") + +# ----------------------------------------------------------------- missing (15) +N = "missing" +missing = [ + "What is the fee for revaluation of answer scripts?", + "Who is the current Vice-Chancellor of Aranya Valley University?", + "What is the annual hostel fee for PhD students?", + "Does the university offer a sports quota scholarship?", + "What is the dress code during end-semester examinations?", + "Can students take the end-semester examinations online from home?", + "What minimum CGPA is required to sit for campus placements?", + "How many total credits are required to graduate from the MSc Data Science programme?", + "What is the fee for a duplicate hall ticket?", + "On what date will the 2026 convocation ceremony be held?", + "What is the university policy on using generative AI tools such as ChatGPT in assignments?", + "What is the parking fee for students' two-wheelers on campus?", + "What is the late fine for paying tuition fees after the due date?", + "Does the university offer a tuition fee concession for siblings?", + "What is the timetable for the even semester examinations in May 2026?", +] +for i, q in enumerate(missing, 1): + add(f"N{i:02d}", N, q, "The documents do not contain this information; the system should abstain.", + [], [], "insufficient", "abstain") + +# ----------------------------------------------------------------- misleading / irrelevant context (15) +I = "misleading" +add("I01", I, "Given that internal assessment carries 50 marks, how many marks does the end-semester examination carry?", + "The premise is wrong: IA carries 40 marks and the end-semester examination carries 60 marks.", + ["40 marks", "60 marks"], [("D04", "40 marks for internal assessment")], "sufficient", "correct_premise") +add("I02", I, "Since PG students can register for up to 30 credits, what is the minimum number of credits?", + "The maximum is 26, not 30; the minimum is 18.", ["18", "26"], + [("D09", "minimum of 18 and a maximum of 26 credits per semester")], "sufficient", "correct_premise") +add("I03", I, "As research scholars can borrow 10 books, what is their loan period?", + "Research scholars may borrow up to 8 books (not 10) for 30 days.", ["8 books", "30 days"], + [("D11", "Research scholars may borrow up to 8 books for 30 days")], "sufficient", "correct_premise") +add("I04", I, "Since a CGPA of 8.0 earns a 50% merit tuition waiver, what does a CGPA of 9.0 earn?", + "The 50% waiver requires a CGPA of 9.0 or above; 8.5-8.99 earns 25%.", ["9.0", "50%"], + [("D07", "CGPA of 9.0 or above in the previous academic year receive a 50% tuition fee waiver")], "sufficient", "correct_premise") +add("I05", I, "Given that academic leave can be taken for up to four semesters, how early must a student apply?", + "Academic leave is limited to two semesters; apply at least 30 days before the semester.", + ["two semesters", "30 days"], + [("D10", "maximum of two semesters"), ("D10", "at least 30 days before the start of the semester")], "sufficient", "correct_premise") +add("I06", I, "As the MDS301 Deep Learning exam is in the afternoon session, what time does it start?", + "It is in the morning session (01 December 2025), which starts at 10:00 AM.", ["10:00 am"], + [("D06", "MDS301 Deep Learning - Morning session"), ("D06", "Morning session: 10:00 AM to 1:00 PM")], "sufficient", "correct_premise") +add("I07", I, "Since make-up internal tests are allowed for any reason, how many can a student take per semester?", + "Make-up tests are only for medical grounds; one make-up test per semester.", ["one make-up test", "medical"], + [("D04", "may take one make-up test per semester")], "sufficient", "correct_premise") +add("I08", I, "What is the late fee for course registration?", + "INR 2,000 (not the INR 500 hostel fine).", ["2000"], + [("D09", "with a late fee of INR 2,000")], "sufficient", "answer") +add("I09", I, "Above what similarity percentage must an assignment be resubmitted?", + "Above 20%.", ["20%"], + [("D05", "A similarity index above 20% requires resubmission within 3 days")], "sufficient", "answer") +add("I10", I, "At what time does the Central Library close on working days?", + "10:00 PM.", ["10:00 pm"], + [("D11", "from 8:00 AM to 10:00 PM on working days")], "sufficient", "answer") +add("I11", I, "How many days before the examinations is the attendance shortage list published?", + "7 days before the commencement of end-semester examinations.", ["7 days"], + [("D01", "published 7 days before the commencement of end-semester examinations")], "sufficient", "answer") +add("I12", I, "How many contact hours of approved event participation can be counted as present?", + "Up to 10 contact hours per semester.", ["10 contact hours"], + [("D01", "counted as present for up to 10 contact hours")], "sufficient", "answer") +add("I13", I, "What is the minimum CGPA for First Class (without distinction)?", + "6.5 (First Class is CGPA 6.5 to 7.99).", ["6.5"], + [("D13", "First Class is awarded for a CGPA from 6.5 to 7.99")], "sufficient", "answer") +add("I14", I, "For how many days can a course instructor extend an assignment deadline?", + "Up to 5 days.", ["5 days"], [("D05", "Extensions of up to 5 days")], "sufficient", "answer") +add("I15", I, "Is a calculator with programmable memory allowed in the examination hall?", + "No - only non-programmable scientific calculators are permitted.", ["non-programmable"], + [("D06", "Only non-programmable scientific calculators are permitted")], "sufficient", "answer") + +# ----------------------------------------------------------------- conflicting (20) +C = "conflicting" +add("C01", C, "What is the minimum attendance required to appear for end-semester examinations?", + "Conflict: Attendance Regulations 2023 say 75%; Circular 2025/014 revises it to 80% from 2025-26 (supersedes).", + ["75%", "80%"], [("D01", "minimum of 75% attendance"), ("D02", "revised to 80%")], "conflicting", "flag_conflict") +add("C02", C, "Up to what percentage can an attendance shortage be condoned on medical grounds?", + "Conflict: 10% under the 2023 regulations; limited to 5% by the 2025 circular.", + ["10%", "5%"], [("D01", "shortage of attendance of up to 10%"), ("D02", "limited to 5%")], "conflicting", "flag_conflict") +add("C03", C, "What is the condonation fee per course for attendance shortage?", + "Conflict: INR 500 (2023 regulations) vs INR 1,000 (2025 circular).", + ["500", "1000"], [("D01", "condonation fee of INR 500 per course"), ("D02", "revised to INR 1,000 per course")], "conflicting", "flag_conflict") +add("C04", C, "According to the examination eligibility rules, what attendance is needed in a course to sit its end-semester exam?", + "Conflict: the eligibility rules (2024) state 75%, but the 2025 circular raises the requirement to 80%.", + ["75%", "80%"], [("D03", "attendance requirement of 75%"), ("D02", "revised to 80%")], "conflicting", "flag_conflict") +add("C05", C, "What is the last date to apply for a scholarship for 2025-26?", + "Conflict: 31 August 2025 (policy) vs extended to 15 September 2025 (notice).", + ["31 august 2025", "15 september 2025"], + [("D07", "by 31 August 2025"), ("D08", "extended to 15 September 2025")], "conflicting", "flag_conflict") +add("C06", C, "What is the family income limit for the need-based scholarship?", + "Conflict: INR 6,00,000 (policy) vs INR 8,00,000 (revised notice).", + ["600000", "800000"], + [("D07", "does not exceed INR 6,00,000"), ("D08", "revised to INR 8,00,000")], "conflicting", "flag_conflict") +add("C07", C, "Are late assignment submissions accepted?", + "Conflict: the Assignment Policy accepts up to 3 days late with 10%/day penalty; the IA Guidelines say late assignments will not be accepted for IA.", + ["10%", "not be accepted"], + [("D05", "Late submissions are accepted for up to 3 calendar days"), ("D04", "will not be accepted for internal assessment")], "conflicting", "flag_conflict") +add("C08", C, "What is the penalty for submitting an assignment one day late?", + "Conflict: 10% of maximum marks per day (Assignment Policy) vs not accepted at all (IA Guidelines).", + ["10%", "not be accepted"], + [("D05", "penalty of 10% of the maximum marks per day"), ("D04", "will not be accepted for internal assessment")], "conflicting", "flag_conflict") +add("C09", C, "How many books can a postgraduate student borrow from the library?", + "Conflict: 5 books (2023 regulations) vs 6 books from 1 August 2025 (notice).", + ["5 books", "6 books"], + [("D11", "Postgraduate students may borrow up to 5 books"), ("D12", "may borrow up to 6 books")], "conflicting", "flag_conflict") +add("C10", C, "For how many days can a postgraduate student keep a borrowed library book?", + "Conflict: 14 days (2023) vs 21 days (2025 notice).", ["14 days", "21 days"], + [("D11", "Postgraduate students may borrow up to 5 books for 14 days"), ("D12", "for a period of 21 days")], "conflicting", "flag_conflict") +add("C11", C, "What is the library overdue fine per book per day?", + "Conflict: INR 5 (2023) vs INR 10 (2025 notice).", ["inr 5 ", "inr 10 "], + [("D11", "overdue fine of INR 5 per book per day"), ("D12", "revised to INR 10 per book per day")], "conflicting", "flag_conflict") +add("C12", C, "How long is the add/drop period for elective courses?", + "Conflict: 10 working days (Registration Guidelines) vs 7 working days (Academic Calendar).", + ["10 working days", "7 working days"], + [("D09", "within 10 working days from the start of classes"), ("D14", "7 working days from the start of classes")], "conflicting", "flag_conflict") +add("C13", C, "What minimum aggregate percentage is needed to pass a postgraduate course?", + "Conflict: 40% (Grading Policy) vs 50% for PG courses (PG Handbook).", ["40%", "50%"], + [("D13", "at least 40% marks in aggregate"), ("D15", "at least 50% marks in aggregate")], "conflicting", "flag_conflict") +add("C14", C, "On what date do the odd semester end-semester examinations begin?", + "Conflict: 1 December 2025 (Timetable, Oct 2025) vs 3 December 2025 (Academic Calendar, June 2025).", + ["1 december 2025", "3 december 2025"], + [("D06", "commence on 1 December 2025"), ("D14", "End-semester examinations: from 3 December 2025")], "conflicting", "flag_conflict") +add("C15", C, "Can I drop an elective course 9 working days after classes start?", + "Conflict: allowed under the Registration Guidelines (10 working days) but not under the Academic Calendar (7 working days).", + ["10 working days", "7 working days"], + [("D09", "within 10 working days from the start of classes"), ("D14", "7 working days from the start of classes")], "conflicting", "flag_conflict") +add("C16", C, "If my attendance in a course is 78%, am I eligible for the end-semester examination?", + "Conflict: eligible under the 2023 rule (75%), but below the 80% minimum under the 2025 circular (condonable between 75% and 80%).", + ["75%", "80%"], [("D01", "minimum of 75% attendance"), ("D02", "revised to 80%")], "conflicting", "flag_conflict") +add("C17", C, "If a PG student scores 45% in aggregate in a course, do they pass?", + "Conflict: pass under the Grading Policy (40%), fail under the PG Handbook (50%).", ["40%", "50%"], + [("D13", "at least 40% marks in aggregate"), ("D15", "at least 50% marks in aggregate")], "conflicting", "flag_conflict") +add("C18", C, "What is the lowest attendance percentage that can be condoned on medical grounds?", + "Conflict: 65% under the 2023 regulations vs 75% under the 2025 circular.", ["65%", "75%"], + [("D01", "attendance between 65% and 75%"), ("D02", "attendance between 75% and 80%")], "conflicting", "flag_conflict") +add("C19", C, "Which attendance rule is the latest, and what minimum attendance does it require?", + "Conflict: the 2025 circular (latest) requires 80%, superseding the 75% of the 2023 regulations.", + ["80%", "75%"], [("D02", "revised to 80%"), ("D01", "minimum of 75% attendance")], "conflicting", "flag_conflict") +add("C20", C, "According to the academic calendar, what is the scholarship application deadline, and has it changed?", + "Conflict: the calendar says 31 August 2025, but the notice extends it to 15 September 2025.", + ["31 august 2025", "15 september 2025"], + [("D14", "Last date for scholarship applications: 31 August 2025"), ("D08", "extended to 15 September 2025")], "conflicting", "flag_conflict") + +assert len(Q) == 100, len(Q) diff --git a/scripts/render_report_docx.js b/scripts/render_report_docx.js new file mode 100644 index 0000000000000000000000000000000000000000..73b9ab0d7c3f9bb049fde5ed15db2c77a907883a --- /dev/null +++ b/scripts/render_report_docx.js @@ -0,0 +1,139 @@ +// Renders reports/report_model.json (built by build_report.py) into a Word document with docx-js. +// Usage: node scripts/render_report_docx.js reports/report_model.json reports/project_report.docx +const fs = require("fs"); +const path = require("path"); +const { + Document, Packer, Paragraph, TextRun, HeadingLevel, AlignmentType, Table, TableRow, TableCell, + WidthType, ShadingType, ImageRun, PageBreak, LevelFormat, Footer, Header, PageNumber, + TableOfContents, BorderStyle, +} = require("docx"); + +const [, , inPath, outPath] = process.argv; +const blocks = JSON.parse(fs.readFileSync(inPath, "utf8")); +const FONT = "Calibri"; +const CM = 567; // DXA per cm +const CONTENT_W = 16 * CM; // A4 21 cm - 2 x 2.5 cm margins + +function pngSize(file) { + const b = fs.readFileSync(file); + return { w: b.readUInt32BE(16), h: b.readUInt32BE(20), data: b }; +} + +const children = []; +const numberRefs = []; +const h1Titles = blocks.filter(x => x.t === "h1").map(x => x.text); +for (const b of blocks) { + switch (b.t) { + case "title": + children.push(new Paragraph({ spacing: { before: 2400, after: 240 }, alignment: AlignmentType.CENTER, + children: [new TextRun({ text: b.title, font: FONT, size: 56, bold: true, color: "1C5CAB" })] })); + children.push(new Paragraph({ spacing: { after: 960 }, alignment: AlignmentType.CENTER, + children: [new TextRun({ text: b.subtitle, font: FONT, size: 30 })] })); + for (const l of b.lines) children.push(new Paragraph({ alignment: AlignmentType.CENTER, spacing: { after: 160 }, + children: [new TextRun({ text: l, font: FONT, size: 24 })] })); + children.push(new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 1200 }, + children: [new TextRun({ text: "All documents and data in this project are SYNTHETIC DEMONSTRATION DATA describing a fictional university.", + font: FONT, size: 20, italics: true, color: "B00020" })] })); + children.push(new Paragraph({ children: [new PageBreak()] })); + children.push(new Paragraph({ spacing: { after: 240 }, children: [new TextRun({ text: "Contents", font: FONT, size: 32, bold: true, color: "1C5CAB" })] })); + for (const t of h1Titles) children.push(new Paragraph({ spacing: { after: 90 }, indent: { left: t.match(/^\d/) ? 0 : 0 }, + children: [new TextRun({ text: t, font: FONT, size: 23 })] })); + break; + case "h1": + children.push(new Paragraph({ heading: HeadingLevel.HEADING_1, children: [new TextRun(b.text)] })); break; + case "h2": + children.push(new Paragraph({ heading: HeadingLevel.HEADING_2, children: [new TextRun(b.text)] })); break; + case "p": + children.push(new Paragraph({ alignment: AlignmentType.JUSTIFIED, spacing: { after: 140, line: 300 }, + children: [new TextRun({ text: b.text, font: FONT, size: 22 })] })); break; + case "caption": + children.push(new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 60, after: 220 }, + children: [new TextRun({ text: b.text, font: FONT, size: 18, italics: true, color: "52514E" })] })); break; + case "bullets": + case "numbers": { + const ref = b.t === "bullets" ? "bul" : `num${numberRefs.length}`; + if (b.t === "numbers") numberRefs.push(ref); + for (const it of b.items) children.push(new Paragraph({ numbering: { reference: ref, level: 0 }, + spacing: { after: 80, line: 290 }, children: [new TextRun({ text: it, font: FONT, size: 22 })] })); + break; + } + case "refs": + b.items.forEach((r, i) => children.push(new Paragraph({ spacing: { after: 100 }, indent: { left: 567, hanging: 567 }, + children: [new TextRun({ text: `[${i + 1}]\t${r}`, font: FONT, size: 20 })] }))); + break; + case "code": + for (const line of b.text.split("\n")) children.push(new Paragraph({ spacing: { after: 0 }, + shading: { fill: "F4F6F8", type: ShadingType.CLEAR, color: "auto" }, + children: [new TextRun({ text: line, font: "Consolas", size: 18 })] })); + break; + case "pagebreak": + children.push(new Paragraph({ children: [new PageBreak()] })); break; + case "img": { + if (!fs.existsSync(b.path)) break; + const s = pngSize(b.path); + const wPx = Math.round(b.width_cm * 37.8); + let hPx = Math.round(wPx * s.h / s.w); + const maxH = 22 * 37.8; + let w = wPx; + if (hPx > maxH) { w = Math.round(wPx * maxH / hPx); hPx = Math.round(maxH); } + children.push(new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 120 }, + children: [new ImageRun({ type: "png", data: s.data, transformation: { width: w, height: hPx }, + altText: { title: path.basename(b.path), description: b.caption || path.basename(b.path), name: path.basename(b.path) } })] })); + break; + } + case "table": { + const n = b.header.length; + let widths = b.widths || Array(n).fill(16 / n); + const tot = widths.reduce((a, c) => a + c, 0); + const dx = widths.map(x => Math.floor(x / tot * CONTENT_W)); + dx[dx.length - 1] += CONTENT_W - dx.reduce((a, c) => a + c, 0); + const sz = Math.round((b.size || 8) * 2); + const border = { style: BorderStyle.SINGLE, size: 4, color: "BFBFBF" }; + const borders = { top: border, bottom: border, left: border, right: border }; + const mkCell = (text, i, head) => new TableCell({ + width: { size: dx[i], type: WidthType.DXA }, borders, + shading: head ? { fill: "DCE8F7", type: ShadingType.CLEAR, color: "auto" } : undefined, + margins: { top: 40, bottom: 40, left: 70, right: 70 }, + children: [new Paragraph({ children: [new TextRun({ text: String(text), font: FONT, size: sz, bold: head })] })], + }); + const rows = [new TableRow({ tableHeader: true, children: b.header.map((h, i) => mkCell(h, i, true)) })]; + for (const r of b.rows) rows.push(new TableRow({ cantSplit: true, children: r.map((c, i) => mkCell(c, i, false)) })); + children.push(new Table({ width: { size: CONTENT_W, type: WidthType.DXA }, columnWidths: dx, rows })); + break; + } + } +} + +const numberingConfig = [{ reference: "bul", levels: [{ level: 0, format: LevelFormat.BULLET, text: "โ€ข", + alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 567, hanging: 283 } } } }] }]; +for (const ref of numberRefs) numberingConfig.push({ reference: ref, levels: [{ level: 0, format: LevelFormat.DECIMAL, + text: "%1.", alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 567, hanging: 340 } } } }] }); + +const doc = new Document({ + creator: "EvidenceGuard AI report builder", + title: "EvidenceGuard AI - MSc Project Report", + features: { updateFields: true }, + styles: { + default: { document: { run: { font: FONT, size: 22 } } }, + paragraphStyles: [ + { id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true, + run: { font: FONT, size: 32, bold: true, color: "1C5CAB" }, + paragraph: { spacing: { before: 360, after: 160 }, keepNext: true, outlineLevel: 0 } }, + { id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true, + run: { font: FONT, size: 26, bold: true, color: "0B0B0B" }, + paragraph: { spacing: { before: 240, after: 120 }, keepNext: true, outlineLevel: 1 } }, + ], + }, + numbering: { config: numberingConfig }, + sections: [{ + properties: { page: { size: { width: 11906, height: 16838 }, + margin: { top: 1418, bottom: 1418, left: 1418, right: 1418 } } }, + headers: { default: new Header({ children: [new Paragraph({ alignment: AlignmentType.RIGHT, + children: [new TextRun({ text: "EvidenceGuard AI - MSc Project Report (synthetic data)", font: FONT, size: 16, color: "8A8986" })] })] }) }, + footers: { default: new Footer({ children: [new Paragraph({ alignment: AlignmentType.CENTER, + children: [new TextRun({ children: ["Page ", PageNumber.CURRENT, " of ", PageNumber.TOTAL_PAGES], font: FONT, size: 18 })] })] }) }, + children, + }], +}); + +Packer.toBuffer(doc).then(buf => { fs.writeFileSync(outPath, buf); console.log("docx written", outPath); }); diff --git a/scripts/run_evaluation.py b/scripts/run_evaluation.py new file mode 100644 index 0000000000000000000000000000000000000000..784b66a43b748b60028be94332e87923a9964706 --- /dev/null +++ b/scripts/run_evaluation.py @@ -0,0 +1,316 @@ +""" +Runs the complete experimental evaluation of EvidenceGuard AI. + +Steps + 1. Stratified DEV/TEST split of the 100 questions (30% per category, rounded: 29 dev / 71 test, seed 42). + 2. Threshold calibration of the verifier on the DEV split only (grid search, objective = + behaviour accuracy of the complete system). Saved to results/calibrated_thresholds.json. + 3. Runs the 4 configurations on all 100 questions: + 1. Baseline RAG 2. RAG + hybrid retrieval & reranking + 3. RAG + evidence verification 4. EvidenceGuard (complete) + 4. Writes metrics (all / test / dev), per-question results, category breakdown, + error analysis and failure cases to results/, and charts to results/charts/. + +Usage: + python scripts/run_evaluation.py # auto backend + python scripts/run_evaluation.py --backend lite # fully offline components + python scripts/run_evaluation.py --backend full --llm hf_api # HF models + HF Inference API +""" +from __future__ import annotations + +import argparse +import csv +import itertools +import json +import platform +import random +import sys +import time +from collections import Counter, defaultdict +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT)) + +import config # noqa: E402 +from src.evaluation import aggregate, by_category, classify_error, score_question # noqa: E402 +from src.text_utils import normalize # noqa: E402 + +RES = config.RESULTS_DIR +CH = config.CHARTS_DIR +ORDER = ["baseline", "rerank", "verify", "full"] +SHORT = {"baseline": "Baseline RAG", "rerank": "+ Reranking", "verify": "+ Verification", "full": "EvidenceGuard"} +COLORS = {"baseline": "#2a78d6", "rerank": "#eb6834", "verify": "#1baf7a", "full": "#eda100"} # validated palette + + +def split(questions, dev_frac=0.3, seed=42): + rng = random.Random(seed) + by = defaultdict(list) + for q in questions: + by[q["category"]].append(q["id"]) + dev = set() + for cat, ids in sorted(by.items()): + ids = sorted(ids) + rng.shuffle(ids) + dev |= set(ids[: round(len(ids) * dev_frac)]) + return dev + + +def relevance_fn_factory(kb, questions): + from sklearn.feature_extraction.text import TfidfVectorizer + from sklearn.metrics.pairwise import cosine_similarity + vec = TfidfVectorizer(stop_words="english", sublinear_tf=True).fit( + [c.text for c in kb.chunks] + [q["question"] for q in questions]) + + def f(q, a): + return float(cosine_similarity(vec.transform([q]), vec.transform([a]))[0, 0]) + return f + + +def calibrate(system, dev_qs, page_text): + """Grid search on DEV only. Two stages: sufficiency/abstention, then conflict sensitivity.""" + base = dict(system.verifier.th) + pipe = system.pipelines["full"] + + def score(th): + system.set_thresholds(th) + rows = [score_question(q, pipe.answer(q["question"]), page_text) for q in dev_qs] + a = aggregate(rows) + return a["behaviour_accuracy"], a["abstention_accuracy"], a["unsupported_answer_rate"] + + best, best_s = dict(base), (-1, -1, 9) + grid1 = itertools.product([0.15, 0.2, 0.25, 0.3, 0.35], [0.4, 0.45, 0.5, 0.55, 0.6, 0.65], [0.3, 0.35, 0.4]) + for rel, cov, conf in grid1: + th = dict(base, min_relevance=rel, min_coverage=cov, partial_coverage=max(0.0, cov - 0.1), + min_confidence=conf) + s = score(th) + if (s[0], s[1], -s[2]) > (best_s[0], best_s[1], -best_s[2]): + best, best_s = th, s + for sc, sim in itertools.product([0.25, 0.3, 0.35, 0.45], [0.25, 0.3, 0.4]): + th = dict(best, conflict_sentence_coverage=sc, conflict_topic_sim=sim) + s = score(th) + if (s[0], s[1], -s[2]) > (best_s[0], best_s[1], -best_s[2]): + best, best_s = th, s + system.set_thresholds(best) + return best, {"dev_behaviour_accuracy": best_s[0], "dev_abstention_accuracy": best_s[1], + "dev_unsupported_rate": best_s[2]} + + +# ------------------------------------------------------------------------------------ charts +def charts(metrics_all, cat_tables, rows_by_cfg): + import matplotlib + matplotlib.use("Agg") + import matplotlib.pyplot as plt + + plt.rcParams.update({"font.size": 10, "axes.spines.top": False, "axes.spines.right": False, + "axes.edgecolor": "#8a8986", "axes.labelcolor": "#0b0b0b", "xtick.color": "#52514e", + "ytick.color": "#52514e", "figure.facecolor": "#fcfcfb", "axes.facecolor": "#fcfcfb", + "grid.color": "#e6e5e1"}) + + def grouped(metric_keys, labels, title, fname, ylim=1.0, pct=True): + fig, ax = plt.subplots(figsize=(9, 4.2)) + n = len(ORDER) + width = 0.8 / n + for i, cfg in enumerate(ORDER): + vals = [metrics_all[cfg][k] if metrics_all[cfg][k] is not None else 0 for k in metric_keys] + xs = [j + (i - (n - 1) / 2) * width for j in range(len(metric_keys))] + bars = ax.bar(xs, vals, width * 0.92, color=COLORS[cfg], label=SHORT[cfg], zorder=3) + for b, v in zip(bars, vals): + ax.text(b.get_x() + b.get_width() / 2, b.get_height() + ylim * 0.012, + f"{v:.2f}" if pct else f"{v:.3f}", ha="center", va="bottom", fontsize=7.5, color="#52514e") + ax.set_xticks(range(len(metric_keys)), labels) + ax.set_ylim(0, ylim * 1.12) + ax.grid(axis="y", zorder=0) + ax.set_title(title, loc="left", fontsize=12, color="#0b0b0b") + ax.legend(frameon=False, ncol=4, loc="upper left", bbox_to_anchor=(0, -0.12)) + fig.tight_layout() + fig.savefig(CH / fname, dpi=150) + plt.close(fig) + + grouped(["precision_at_k", "recall_at_k", "mrr", "context_precision", "context_recall"], + ["Precision@5", "Recall@5", "MRR", "Context precision", "Context recall"], + "Retrieval quality (all 100 questions)", "retrieval_comparison.png") + grouped(["answer_correctness", "behaviour_accuracy", "faithfulness", "grounded_faithfulness", "answer_relevance"], + ["Answer correctness", "Behaviour accuracy", "Faithfulness\n(to context)", + "Evidence-grounded\nfaithfulness", "Answer relevance\n(lexical proxy)"], + "Answer quality (all 100 questions)", "answer_quality_comparison.png") + grouped(["unsupported_answer_rate", "abstention_accuracy", "abstention_f1", "contradiction_f1", + "citation_support_accuracy"], + ["Unsupported answer\nrate (lower = better)", "Abstention\naccuracy", "Abstention F1", + "Contradiction\ndetection F1", "Citation support\naccuracy"], + "Reliability (all 100 questions)", "reliability_comparison.png") + tmax = max(metrics_all[c]["avg_response_time_s"] for c in ORDER) + grouped(["avg_response_time_s", "avg_retrieval_time_s", "avg_verification_time_s", "avg_generation_time_s"], + ["Total", "Retrieval + rerank", "Verification", "Generation"], + "Average time per question (seconds)", "response_time.png", ylim=tmax, pct=False) + + # behaviour accuracy by category + cats = ["answerable", "multi_passage", "misleading", "conflicting", "missing"] + fig, ax = plt.subplots(figsize=(9, 4.2)) + width = 0.2 + for i, cfg in enumerate(ORDER): + vals = [cat_tables[cfg][c]["behaviour_accuracy"] for c in cats] + xs = [j + (i - 1.5) * width for j in range(len(cats))] + bars = ax.bar(xs, vals, width * 0.92, color=COLORS[cfg], label=SHORT[cfg], zorder=3) + for b, v in zip(bars, vals): + ax.text(b.get_x() + b.get_width() / 2, b.get_height() + 0.012, f"{v:.2f}", ha="center", + va="bottom", fontsize=7.5, color="#52514e") + ax.set_xticks(range(len(cats)), ["Answerable\n(30)", "Multi-passage\n(20)", "Misleading\n(15)", + "Conflicting\n(20)", "Missing info\n(15)"]) + ax.set_ylim(0, 1.12) + ax.grid(axis="y", zorder=0) + ax.set_title("Expected-behaviour accuracy by question category", loc="left", fontsize=12) + ax.legend(frameon=False, ncol=4, loc="upper left", bbox_to_anchor=(0, -0.14)) + fig.tight_layout() + fig.savefig(CH / "category_breakdown.png", dpi=150) + plt.close(fig) + + # error taxonomy for baseline vs full + fig, axes = plt.subplots(1, 2, figsize=(10, 3.8), sharex=True) + kinds = ["answered unanswerable question (hallucination risk)", "missed conflict", "over-abstention (answer was available)", + "incomplete answer (some key facts missing)", "wrong/irrelevant answer content", + "retrieval failure (no gold page retrieved)"] + short = ["Answered unanswerable", "Missed conflict", "Over-abstention", "Incomplete answer", + "Wrong content", "Retrieval failure"] + mx = 0 + counts = {} + for cfg in ("baseline", "full"): + c = Counter(classify_error(r) for r in rows_by_cfg[cfg]) + counts[cfg] = [c.get(k, 0) for k in kinds] + mx = max(mx, max(counts[cfg])) + for ax, cfg in zip(axes, ("baseline", "full")): + bars = ax.barh(short[::-1], counts[cfg][::-1], color=COLORS[cfg], zorder=3, height=0.6) + for b, v in zip(bars, counts[cfg][::-1]): + ax.text(v + mx * 0.02, b.get_y() + b.get_height() / 2, str(v), va="center", fontsize=8, color="#52514e") + ax.set_title(f"{SHORT[cfg]} - errors ({sum(counts[cfg])})", loc="left", fontsize=11) + ax.grid(axis="x", zorder=0) + ax.set_xlim(0, mx * 1.2 + 1) + fig.tight_layout() + fig.savefig(CH / "error_analysis.png", dpi=150) + plt.close(fig) + + +# ------------------------------------------------------------------------------------ main +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--backend", default=config.EG_BACKEND, choices=["auto", "full", "lite"]) + ap.add_argument("--llm", default=config.LLM_BACKEND, choices=["auto", "hf_api", "local", "extractive"]) + ap.add_argument("--no-calibrate", action="store_true") + args = ap.parse_args() + + from src.system import EvidenceGuardSystem + questions = json.loads(config.EVAL_DATA_PATH.read_text()) + import os + os.environ["EG_IGNORE_CALIBRATION"] = "1" # start from defaults; calibrate fresh + t0 = time.time() + system = EvidenceGuardSystem(args.backend, args.llm, thresholds=dict(config.THRESHOLDS)) + print("Components:", json.dumps(system.component_names(), indent=1)) + page_text = {(d, i + 1): normalize(t) for d, info in system.kb.docs.items() for i, t in enumerate(info.page_texts)} + rel_fn = relevance_fn_factory(system.kb, questions) + + dev_ids = split(questions) + dev_qs = [q for q in questions if q["id"] in dev_ids] + if not args.no_calibrate: + th, dev_scores = calibrate(system, dev_qs, page_text) + (RES / "calibrated_thresholds.json").write_text(json.dumps( + {"backend": system.effective_backend, "thresholds": th, "dev_ids": sorted(dev_ids), **dev_scores}, indent=2)) + print("Calibrated on DEV:", dev_scores) + + rows_by_cfg, per_q = {}, [] + for cfg in ORDER: + rows = [] + for q in questions: + r = system.pipelines[cfg].answer(q["question"]) + row = score_question(q, r, page_text, rel_fn) + row["config"] = cfg + row["split"] = "dev" if q["id"] in dev_ids else "test" + row["error_type"] = classify_error(row) + rows.append(row) + rows_by_cfg[cfg] = rows + per_q += rows + print(f"{cfg:9s} done") + + metrics = {"all": {}, "test": {}, "dev": {}} + cats = {} + for cfg in ORDER: + rows = rows_by_cfg[cfg] + metrics["all"][cfg] = aggregate(rows) + metrics["test"][cfg] = aggregate([r for r in rows if r["split"] == "test"]) + metrics["dev"][cfg] = aggregate([r for r in rows if r["split"] == "dev"]) + cats[cfg] = by_category(rows) + + meta = { + "note": "Experiments use SYNTHETIC documents of a fictional university. Results do not establish " + "real-world university policy accuracy.", + "components": system.component_names(), + "backend": args.backend, "llm_backend": args.llm, + "thresholds": system.verifier.th, "n_questions": len(questions), + "dev_questions": len(dev_ids), "test_questions": len(questions) - len(dev_ids), + "python": platform.python_version(), "machine": platform.machine(), + "cpu_count": os.cpu_count(), "runtime_s": round(time.time() - t0, 1), + "date": time.strftime("%Y-%m-%d %H:%M"), + } + (RES / "metrics.json").write_text(json.dumps( + {"meta": meta, "metrics": metrics, "by_category": cats, "config_names": SHORT}, indent=2)) + + keys = list(metrics["all"]["full"].keys()) + with open(RES / "metrics.csv", "w", newline="") as f: + w = csv.writer(f) + w.writerow(["split", "configuration"] + keys) + for sp in ("all", "test", "dev"): + for cfg in ORDER: + w.writerow([sp, SHORT[cfg]] + [metrics[sp][cfg][k] for k in keys]) + with open(RES / "category_breakdown.csv", "w", newline="") as f: + w = csv.writer(f) + w.writerow(["configuration", "category", "n", "answer_correctness", "behaviour_accuracy", + "unsupported_rate", "abstention_rate"]) + for cfg in ORDER: + for c, v in cats[cfg].items(): + w.writerow([SHORT[cfg], c, v["n"], v["answer_correctness"], v["behaviour_accuracy"], + v["unsupported_rate"], v["abstention_rate"]]) + fields = ["config", "split", "id", "category", "question", "expected_behaviour", "decision", "abstained", + "conflict_flagged", "correct", "behaviour_ok", "unsupported", "error_type", "keywords_hit", + "keywords_total", "precision_at_k", "recall_at_k", "mrr", "faithfulness", "grounded_faithfulness", + "citation_support", "confidence", "t_total", "answer", "expected_answer", "explanation", "retrieved"] + with open(RES / "per_question_results.csv", "w", newline="") as f: + w = csv.DictWriter(f, fieldnames=fields, extrasaction="ignore") + w.writeheader() + w.writerows(per_q) + + # error analysis + failure cases + err = {cfg: Counter(r["error_type"] for r in rows_by_cfg[cfg]) for cfg in ORDER} + with open(RES / "error_analysis.csv", "w", newline="") as f: + w = csv.writer(f) + types = sorted({t for c in err.values() for t in c}) + w.writerow(["error_type"] + [SHORT[c] for c in ORDER]) + for t in types: + w.writerow([t] + [err[c].get(t, 0) for c in ORDER]) + fails = [] + for r in rows_by_cfg["full"]: + if not r["behaviour_ok"]: + b = next(x for x in rows_by_cfg["baseline"] if x["id"] == r["id"]) + fails.append({k: r[k] for k in ("id", "category", "question", "expected_behaviour", "error_type", + "decision", "answer", "expected_answer", "explanation", "retrieved")} + | {"baseline_answer": b["answer"], "baseline_ok": b["behaviour_ok"]}) + wins = [{"id": r["id"], "category": r["category"], "question": r["question"], + "baseline_answer": b["answer"], "evidenceguard_answer": r["answer"], "explanation": r["explanation"]} + for r, b in zip(rows_by_cfg["full"], rows_by_cfg["baseline"]) if r["behaviour_ok"] and not b["behaviour_ok"]] + (RES / "failure_cases.json").write_text(json.dumps({"evidenceguard_failures": fails, + "evidenceguard_fixes_over_baseline": wins}, indent=2)) + charts(metrics["all"], cats, rows_by_cfg) + + print("\n=== ALL 100 questions ===") + show = ["recall_at_k", "mrr", "answer_correctness", "behaviour_accuracy", "grounded_faithfulness", + "unsupported_answer_rate", "abstention_accuracy", "contradiction_f1", "citation_support_accuracy", + "avg_response_time_s"] + print(f"{'config':16s}" + "".join(f"{k[:14]:>15s}" for k in show)) + for sp in ("all", "test"): + print(f"--- {sp}") + for cfg in ORDER: + print(f"{SHORT[cfg]:16s}" + "".join(f"{(metrics[sp][cfg][k] if metrics[sp][cfg][k] is not None else float('nan')):15.3f}" for k in show)) + print("\nErrors:", {SHORT[c]: dict(err[c]) for c in ("baseline", "full")}) + print(f"Runtime {meta['runtime_s']} s") + + +if __name__ == "__main__": + main() diff --git a/scripts/significance.py b/scripts/significance.py new file mode 100644 index 0000000000000000000000000000000000000000..e6519c8ba81b201220304300218084588a899af7 --- /dev/null +++ b/scripts/significance.py @@ -0,0 +1,57 @@ +"""Paired significance tests between configurations (exact McNemar + bootstrap 95% CI). + +Reads results/per_question_results.csv and writes results/significance.json. +""" +import csv +import json +import random +from math import comb +from pathlib import Path + +RES = Path(__file__).resolve().parents[1] / "results" + + +def mcnemar_exact(b, c): + n = b + c + if n == 0: + return 1.0 + k = min(b, c) + p = sum(comb(n, i) for i in range(k + 1)) / 2 ** n * 2 + return min(1.0, p) + + +def main(): + rows = list(csv.DictReader(open(RES / "per_question_results.csv"))) + by = {} + for r in rows: + by.setdefault(r["config"], {})[r["id"]] = r + out = {} + for metric, field, better_low in (("behaviour_accuracy", "behaviour_ok", False), + ("unsupported_answer", "unsupported", True)): + for split in ("all", "test"): + for other in ("rerank", "verify", "full"): + ids = [i for i in by["baseline"] if split == "all" or by["baseline"][i]["split"] == "test"] + a = [by["baseline"][i][field] == "True" for i in ids] + b = [by[other][i][field] == "True" for i in ids] + n01 = sum((not x) and y for x, y in zip(a, b)) # baseline 0, other 1 + n10 = sum(x and (not y) for x, y in zip(a, b)) + rng = random.Random(0) + diffs = [] + for _ in range(5000): + s = [rng.randrange(len(ids)) for _ in ids] + diffs.append(sum(b[j] for j in s) / len(s) - sum(a[j] for j in s) / len(s)) + diffs.sort() + out[f"{metric}|{split}|baseline_vs_{other}"] = { + "n": len(ids), "baseline": round(sum(a) / len(a), 4), other: round(sum(b) / len(b), 4), + "difference": round(sum(b) / len(b) - sum(a) / len(a), 4), + "ci95": [round(diffs[125], 4), round(diffs[4874], 4)], + "only_other_true": n01, "only_baseline_true": n10, + "mcnemar_exact_p": round(mcnemar_exact(n01, n10), 6), + } + (RES / "significance.json").write_text(json.dumps(out, indent=2)) + for k, v in out.items(): + print(k, v) + + +if __name__ == "__main__": + main() diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/__pycache__/__init__.cpython-312.pyc b/src/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e0d001b2d13d5eac33e3de5e5796f02a55173a64 Binary files /dev/null and b/src/__pycache__/__init__.cpython-312.pyc differ diff --git a/src/__pycache__/baseline_rag.cpython-312.pyc b/src/__pycache__/baseline_rag.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d08c5ad8babdcf56d5cde649b91cd70154b76b3c Binary files /dev/null and b/src/__pycache__/baseline_rag.cpython-312.pyc differ diff --git a/src/__pycache__/document_processor.cpython-312.pyc b/src/__pycache__/document_processor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96ce9026324213e7ecff51a7e52bbdc088e34179 Binary files /dev/null and b/src/__pycache__/document_processor.cpython-312.pyc differ diff --git a/src/__pycache__/embeddings.cpython-312.pyc b/src/__pycache__/embeddings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbae157780c16156a793775b3c94b8e4a91eccd8 Binary files /dev/null and b/src/__pycache__/embeddings.cpython-312.pyc differ diff --git a/src/__pycache__/enhanced_rag.cpython-312.pyc b/src/__pycache__/enhanced_rag.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f896b6e29a6a33ccaee4280c63bed1ba2df6abc Binary files /dev/null and b/src/__pycache__/enhanced_rag.cpython-312.pyc differ diff --git a/src/__pycache__/evidence_verifier.cpython-312.pyc b/src/__pycache__/evidence_verifier.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b95611f91ac332dc07224d9d00ca40d7db952f9 Binary files /dev/null and b/src/__pycache__/evidence_verifier.cpython-312.pyc differ diff --git a/src/__pycache__/llm_generator.cpython-312.pyc b/src/__pycache__/llm_generator.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d71f3913f4fbb8e471f3e1984d95d051b815078d Binary files /dev/null and b/src/__pycache__/llm_generator.cpython-312.pyc differ diff --git a/src/__pycache__/reranker.cpython-312.pyc b/src/__pycache__/reranker.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..358980082312ca068cf75163e5cf8db42d1a7245 Binary files /dev/null and b/src/__pycache__/reranker.cpython-312.pyc differ diff --git a/src/__pycache__/research.cpython-312.pyc b/src/__pycache__/research.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6657e3cb722109d3bb5e03e3bdaddd6c834599de Binary files /dev/null and b/src/__pycache__/research.cpython-312.pyc differ diff --git a/src/__pycache__/retrieval.cpython-312.pyc b/src/__pycache__/retrieval.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7dc474fd86bd0f71362732c57ed56aa0f94a013 Binary files /dev/null and b/src/__pycache__/retrieval.cpython-312.pyc differ diff --git a/src/__pycache__/system.cpython-312.pyc b/src/__pycache__/system.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a17d0c3db4e1e5aa8e1d5b1f4db3a97beca7728 Binary files /dev/null and b/src/__pycache__/system.cpython-312.pyc differ diff --git a/src/__pycache__/text_utils.cpython-312.pyc b/src/__pycache__/text_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fd0e6091773928f03f76117fb8a2f1ce69e71a7 Binary files /dev/null and b/src/__pycache__/text_utils.cpython-312.pyc differ diff --git a/src/__pycache__/vector_store.cpython-312.pyc b/src/__pycache__/vector_store.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50408504c8ae2b625c5b6b84b9e13f66384438e4 Binary files /dev/null and b/src/__pycache__/vector_store.cpython-312.pyc differ diff --git a/src/baseline_rag.py b/src/baseline_rag.py new file mode 100644 index 0000000000000000000000000000000000000000..dcccf299e2b08ab371903fb53436bd4be0eb4888 --- /dev/null +++ b/src/baseline_rag.py @@ -0,0 +1,60 @@ +"""SYSTEM A - Baseline RAG: dense retrieval (FAISS) -> LLM answer with source citations. No checks.""" +from __future__ import annotations + +import time + +import config +from src.retrieval import DenseRetriever, HybridRetriever +from src.reranker import rerank + + +def passage_dicts(items): + out = [] + for i, r in enumerate(items, 1): + c = r.chunk + out.append({"n": i, "doc_id": c.doc_id, "doc_name": c.doc_name, "title": c.title, "page": c.page, + "issued": c.issued, "text": c.text, "dense": round(r.dense, 4), "sparse": round(r.sparse, 4), + "rerank": None if r.rerank is None else round(r.rerank, 4), "source": r.source, + "relevance": round(r.relevance, 4)}) + return out + + +def render_claims(claims) -> str: + return " ".join(f"{s} [{', '.join(map(str, c))}]" if c else s for s, c in claims) + + +class BaselineRAG: + """Standard RAG. Optionally with hybrid retrieval + reranking (ablation 'RAG + reranking').""" + + def __init__(self, kb, generator, reranker=None, use_hybrid=False, use_rerank=False, + top_k: int = config.TOP_K, name: str = "Baseline RAG"): + self.kb, self.gen, self.reranker = kb, generator, reranker + self.use_rerank = use_rerank and reranker is not None + self.retriever = HybridRetriever(kb) if use_hybrid else DenseRetriever(kb) + self.top_k, self.name = top_k, name + + def answer(self, question: str) -> dict: + t0 = time.perf_counter() + n = config.CANDIDATES if self.use_rerank else self.top_k + items = self.retriever.retrieve(question, n) + t_ret = time.perf_counter() - t0 + t1 = time.perf_counter() + if self.use_rerank: + items = rerank(self.reranker, question, items, self.top_k) + t_rr = time.perf_counter() - t1 + gen = self.gen.generate(question, items, mode="baseline") + text = render_claims(gen.claims) if gen.claims else (gen.text or "No answer generated.") + cited = sorted({c for _, cs in gen.claims for c in cs if 1 <= c <= len(items)}) + return { + "system": self.name, "question": question, "answer": text, + "decision": "answered", "claims": gen.claims, + "citations": [{"n": c, "doc_name": items[c - 1].chunk.doc_name, "title": items[c - 1].chunk.title, + "page": items[c - 1].chunk.page} for c in cited], + "passages": passage_dicts(items), "sufficiency": None, "conflicts": [], "citation_checks": [], + "confidence": None, + "explanation": "Baseline RAG always answers from the top retrieved passages; it performs no " + "sufficiency, contradiction or citation checks.", + "timings": {"retrieval": t_ret, "rerank": t_rr, "verification": 0.0, "generation": gen.seconds, + "total": time.perf_counter() - t0}, + "generator": gen.backend, + } diff --git a/src/document_processor.py b/src/document_processor.py new file mode 100644 index 0000000000000000000000000000000000000000..aadf95cf117eafde2871b0ec9dcf3ebaddb84378 --- /dev/null +++ b/src/document_processor.py @@ -0,0 +1,154 @@ +"""PDF ingestion: text extraction, cleaning, metadata detection and sentence-aware chunking.""" +from __future__ import annotations + +import json +import re +from dataclasses import asdict, dataclass, field +from pathlib import Path + +import config +from src.text_utils import split_sentences + +_BANNER = re.compile(r"SYNTHETIC DEMONSTRATION DATA.*?policy", re.I) +_FOOTER = re.compile(r"^[A-Z]{2,}/[A-Z0-9/.-]+\s*\|.*$|^Page \d+ of \d+$", re.I) +_DATE_ISO = re.compile(r"\b(20\d{2})-(\d{2})-(\d{2})\b") +_DATE_LONG = re.compile(r"\b(\d{1,2})\s+(January|February|March|April|May|June|July|August|September|" + r"October|November|December)\s+(20\d{2})\b", re.I) +_MONTHS = {m: i for i, m in enumerate(["january", "february", "march", "april", "may", "june", "july", + "august", "september", "october", "november", "december"], 1)} + + +@dataclass +class Chunk: + chunk_id: str + doc_id: str + doc_name: str + title: str + page: int + text: str + issued: str = "" # ISO date if known; used to decide which version is newer + + def to_dict(self): + return asdict(self) + + +@dataclass +class DocumentInfo: + doc_id: str + doc_name: str + title: str + pages: int + chunks: int + issued: str = "" + status: str = "ok" + message: str = "" + page_texts: list = field(default_factory=list, repr=False) + + +def extract_pages(path: str | Path) -> list[str]: + """Return raw text of every page. PyMuPDF first, pypdf as a fallback.""" + return extract_pdf(path)[0] + + +def extract_pdf(path: str | Path) -> tuple[list[str], str]: + """(page texts, metadata title).""" + try: + import pymupdf + with pymupdf.open(str(path)) as pdf: + return [p.get_text() for p in pdf], (pdf.metadata or {}).get("title", "") or "" + except Exception: + from pypdf import PdfReader + r = PdfReader(str(path)) + title = (r.metadata.title if r.metadata and r.metadata.title else "") or "" + return [(p.extract_text() or "") for p in r.pages], title + + +def clean_page(text: str) -> str: + text = _BANNER.sub(" ", text or "") + lines = [] + for ln in text.splitlines(): + s = ln.strip() + if not s or _FOOTER.match(s): + continue + words = re.sub(r"^\d+\.\s*", "", s).split() + # Short Title-Case lines without punctuation are headings ("2. Late Submission"): + # terminate them so they become their own sentence instead of gluing onto the next one. + if (words and len(words) <= 7 and s[-1] not in ".:;,)" and words[0][0].isupper() + and all(w[0].isupper() or not w[0].isalpha() for w in words if w.lower() not in + {"and", "of", "the", "for", "to", "in", "on", "a", "-"})): + s += "." + lines.append(s) + text = "\n".join(lines) + text = re.sub(r"(\w)-\n(\w)", r"\1\2", text) # de-hyphenate line breaks + text = re.sub(r"\s*\n\s*", " ", text) + return re.sub(r"\s{2,}", " ", text).strip() + + +def _to_iso(text: str) -> str: + m = re.search(r"Issued\s+(20\d{2}-\d{2}-\d{2})", text) + if m: + return m.group(1) + m = _DATE_ISO.search(text) + if m: + return m.group(0) + m = _DATE_LONG.search(text) + if m: + d, mon, y = m.groups() + return f"{y}-{_MONTHS[mon.lower()]:02d}-{int(d):02d}" + return "" + + +def _manifest() -> dict: + p = config.SAMPLE_DATA_DIR / "corpus_manifest.json" + if p.exists(): + return {m["filename"]: m for m in json.loads(p.read_text())} + return {} + + +def chunk_page(sentences: list[str], target_words: int, overlap: int) -> list[str]: + chunks, cur, words = [], [], 0 + for s in sentences: + n = len(s.split()) + if cur and words + n > target_words: + chunks.append(" ".join(cur)) + cur = cur[-overlap:] if overlap else [] + words = sum(len(x.split()) for x in cur) + cur.append(s) + words += n + if cur: + tail = " ".join(cur) + if not chunks or tail not in chunks[-1]: + chunks.append(tail) + return chunks + + +def process_pdf(path: str | Path, doc_id: str | None = None, + target_words: int | None = None, overlap: int | None = None) -> tuple[DocumentInfo, list[Chunk]]: + path = Path(path) + target_words = target_words or config.CHUNK_TARGET_WORDS + overlap = config.CHUNK_OVERLAP_SENTENCES if overlap is None else overlap + doc_id = doc_id or re.sub(r"[^A-Za-z0-9]+", "_", path.stem)[:40] + try: + raw, meta_title = extract_pdf(path) + except Exception as e: # corrupt / encrypted PDF + return DocumentInfo(doc_id, path.name, path.stem, 0, 0, status="error", message=str(e)), [] + + pages = [clean_page(p) for p in raw] + meta = _manifest().get(path.name, {}) + first_line = next((ln.strip() for ln in (raw[0] if raw else "").splitlines() + if ln.strip() and not _BANNER.search(ln)), "") + title = meta.get("title") or (meta_title.strip() if meta_title.strip().strip("()").lower() not in ("", "untitled", "anonymous") else "") \ + or first_line[:90] or path.stem + title = re.sub(r"^Aranya Valley University \(AVU\) \(fictional\)\s*", "", title).strip() or path.stem + issued = meta.get("issued") or _to_iso(" ".join(raw[:1])) + + chunks: list[Chunk] = [] + for pno, text in enumerate(pages, 1): + sents = split_sentences(text) + for ci, ctext in enumerate(chunk_page(sents, target_words, overlap)): + chunks.append(Chunk(f"{doc_id}-p{pno}-c{ci}", doc_id, path.name, title, pno, ctext, issued)) + + status, msg = "ok", "extracted" + if not any(p.strip() for p in pages): + status, msg = "warning", "no extractable text (scanned PDF? OCR is not supported)" + return DocumentInfo(doc_id, path.name, title, len(pages), len(chunks), issued, status, msg, pages), chunks diff --git a/src/embeddings.py b/src/embeddings.py new file mode 100644 index 0000000000000000000000000000000000000000..621779c16a4a131a225ae58daf3ab4c8efdc8c11 --- /dev/null +++ b/src/embeddings.py @@ -0,0 +1,71 @@ +"""Dense text embeddings. + +* SentenceTransformerEmbedder - sentence-transformers/all-MiniLM-L6-v2 (384-d, Apache-2.0). +* LSAEmbedder - offline fallback: TF-IDF (word 1-2 grams) + TruncatedSVD, + L2-normalised. Must be fitted on the corpus; refitted when + documents are added. +""" +from __future__ import annotations + +import logging + +import numpy as np + +import config + +log = logging.getLogger(__name__) + + +class SentenceTransformerEmbedder: + needs_fit = False + + def __init__(self, model_name: str = config.EMBEDDING_MODEL): + from sentence_transformers import SentenceTransformer + self.model = SentenceTransformer(model_name, device="cpu") + self.name = f"SentenceTransformer ({model_name})" + + def fit(self, texts): # no-op, kept for a uniform interface + return self + + def encode(self, texts: list[str]) -> np.ndarray: + v = self.model.encode(list(texts), batch_size=32, normalize_embeddings=True, + show_progress_bar=False, convert_to_numpy=True) + return v.astype("float32") + + +class LSAEmbedder: + needs_fit = True + + def __init__(self, dim: int = config.LSA_DIM): + self.dim = dim + self.name = "LSA (TF-IDF + TruncatedSVD) - offline fallback" + self.vec = None + self.svd = None + + def fit(self, texts: list[str]): + from sklearn.decomposition import TruncatedSVD + from sklearn.feature_extraction.text import TfidfVectorizer + self.vec = TfidfVectorizer(ngram_range=(1, 2), sublinear_tf=True, min_df=1, + token_pattern=r"(?u)\b[\w.%+:-]+\b", stop_words="english") + X = self.vec.fit_transform(texts) + k = max(2, min(self.dim, X.shape[0] - 1, X.shape[1] - 1)) + self.svd = TruncatedSVD(n_components=k, random_state=42).fit(X) + return self + + def encode(self, texts: list[str]) -> np.ndarray: + if self.vec is None: + raise RuntimeError("LSAEmbedder must be fitted before encoding") + v = self.svd.transform(self.vec.transform(texts)) + v /= np.linalg.norm(v, axis=1, keepdims=True) + 1e-12 + return v.astype("float32") + + +def load_embedder(backend: str = config.EG_BACKEND): + if backend in ("full", "auto"): + try: + return SentenceTransformerEmbedder() + except Exception as e: + if backend == "full": + raise + log.warning("Sentence Transformer unavailable (%s); using LSA fallback", e) + return LSAEmbedder() diff --git a/src/enhanced_rag.py b/src/enhanced_rag.py new file mode 100644 index 0000000000000000000000000000000000000000..c107d6edf9ca5465e5de1721109a6282cd04da98 --- /dev/null +++ b/src/enhanced_rag.py @@ -0,0 +1,174 @@ +"""SYSTEM B - EvidenceGuard RAG. + +hybrid retrieval -> cross-encoder reranking -> evidence sufficiency -> contradiction detection +-> context-grounded generation -> citation validation -> confidence-based abstention -> explanation +Each stage can be switched off for the ablation study. +""" +from __future__ import annotations + +import re +import time +from dataclasses import asdict + +import config +from src.baseline_rag import passage_dicts +from src.retrieval import DenseRetriever, HybridRetriever +from src.reranker import rerank +from src.text_utils import split_sentences + +ABSTAIN_TEXT = ("I could not find sufficient evidence in the uploaded documents to answer this question. " + "Please check with the relevant university office.") +_PRESUPPOSITION = re.compile(r"^\s*(since|given that|as|because|assuming)\b", re.I) + + +class EvidenceGuardRAG: + def __init__(self, kb, generator, reranker, verifier, use_hybrid=True, use_rerank=True, + use_verification=True, top_k: int = config.TOP_K, name: str = "EvidenceGuard RAG"): + self.kb, self.gen, self.reranker, self.verifier = kb, generator, reranker, verifier + self.retriever = HybridRetriever(kb) if use_hybrid else DenseRetriever(kb) + self.use_rerank, self.use_verification = use_rerank, use_verification + self.top_k, self.name = top_k, name + + # ------------------------------------------------------------------ + def answer(self, question: str) -> dict: + T = {} + t0 = time.perf_counter() + n = config.CANDIDATES if self.use_rerank else self.top_k + items = self.retriever.retrieve(question, n) + T["retrieval"] = time.perf_counter() - t0 + + t = time.perf_counter() + if self.use_rerank: + items = rerank(self.reranker, question, items, self.top_k) + elif self.use_verification and items: + # Verification needs calibrated relevance scores. Score passages for gating only; + # retrieval order and the passage set stay exactly as the dense retriever returned them. + for r, s in zip(items, self.reranker.score(question, [f"{r.chunk.title}. {r.chunk.text}" for r in items])): + r.rerank = float(s) + T["rerank"] = time.perf_counter() - t + + if not self.use_verification: + gen = self.gen.generate(question, items, mode="grounded") + T["verification"], T["generation"] = 0.0, gen.seconds + T["total"] = time.perf_counter() - t0 + return self._package(question, items, gen.claims, "answered", None, [], [], None, + "Verification disabled for this configuration.", T, gen.backend, []) + + # ---------------- 1. sufficiency + t = time.perf_counter() + ordered = sorted(items, key=lambda r: -r.relevance) + suff = self.verifier.sufficiency(question, ordered) + if suff.status == "insufficient": + T["verification"] = time.perf_counter() - t + T["generation"] = 0.0 + T["total"] = time.perf_counter() - t0 + why = (f"Abstained: evidence is insufficient (best passage relevance {suff.max_relevance:.2f}, " + f"query coverage {suff.coverage:.2f}; thresholds {self.verifier.th['min_relevance']:.2f} / " + f"{self.verifier.th['min_coverage']:.2f}).") + if suff.missing_terms: + why += f" Question terms not found in the retrieved passages: {', '.join(suff.missing_terms[:8])}." + return self._package(question, items, [], "abstained", suff, [], [], 0.0, why, T, "", []) + + # ---------------- 2. conflict-search retrieval + contradiction detection + premise check + items = items + self.verifier.expand_for_conflicts(question, items, self.retriever) + conflicts = self.verifier.detect_conflicts(question, items) + premise = [] + if _PRESUPPOSITION.search(question): + ev = [s for r in ordered[:3] for s in split_sentences(r.chunk.text)] + premise = self.verifier.premise_issues(question, ev) + T["verification"] = time.perf_counter() - t + + # ---------------- 3. grounded generation + gen = self.gen.generate(question, items, mode="grounded", conflicts=conflicts, premise_notes=premise) + T["generation"] = gen.seconds + if gen.declined: + T["total"] = time.perf_counter() - t0 + return self._package(question, items, [], "abstained", suff, conflicts, [], 0.0, + "Abstained: the language model reported that the passages do not contain the answer.", + T, gen.backend, premise) + + # ---------------- 4. citation validation + t = time.perf_counter() + checks = self.verifier.validate_citations(gen.claims, items) + T["verification"] += time.perf_counter() - t + supported = [(c.sentence, c.cited or [self._best_cite(c)]) for c in checks if c.supported] + ratio = len(supported) / max(1, len(checks)) + + # ---------------- 5. confidence & decision + conf = 0.4 * min(1.0, suff.max_relevance) + 0.4 * min(1.0, suff.coverage) + 0.2 * ratio + if not supported: + decision, why = "abstained", "Abstained: none of the generated sentences could be verified against the cited passages." + elif conf < self.verifier.th["min_confidence"]: + decision, why = "abstained", f"Abstained: confidence {conf:.2f} is below the threshold {self.verifier.th['min_confidence']:.2f}." + elif conflicts: + decision = "conflict" + why = ("Answered with a conflict warning: " + "; ".join( + f"'{c.title_a}' and '{c.title_b}' disagree ({c.detail})" for c in conflicts) + ".") + elif suff.status == "partial" or ratio < 1: + decision = "partial" + why = f"Partially answered: query coverage {suff.coverage:.2f}" + if suff.missing_terms: + why += f"; not covered: {', '.join(suff.missing_terms[:6])}" + if ratio < 1: + why += f"; {len(checks) - len(supported)} unsupported sentence(s) removed" + why += "." + else: + decision = "answered" + why = (f"Answered: relevance {suff.max_relevance:.2f}, coverage {suff.coverage:.2f}, " + f"{len(supported)}/{len(checks)} sentences verified against their citations.") + T["total"] = time.perf_counter() - t0 + return self._package(question, items, supported if decision != "abstained" else [], decision, suff, + conflicts, checks, conf, why, T, gen.backend, premise) + + @staticmethod + def _best_cite(check): + m = re.search(r"\[(\d+)\]", check.sentence) + return int(m.group(1)) if m else 1 + + # ------------------------------------------------------------------ + def _render(self, claims, decision, conflicts, items, premise): + if decision == "abstained": + return ABSTAIN_TEXT + parts = [] + if conflicts: + parts.append("โš ๏ธ **Conflicting evidence found.** The documents disagree:") + shown = set() + for c in conflicts[:2]: + for title, issued, sent, n in ((c.title_a, c.issued_a, c.sentence_a, c.passage_a), + (c.title_b, c.issued_b, c.sentence_b, c.passage_b)): + if sent in shown: + continue + shown.add(sent) + parts.append(f"- *{title}* (issued {issued or 'unknown'}): {sent} [{n}]") + newest = conflicts[0].newer + if newest: + parts.append(f"The more recent document is *{newest}*" + + (", which explicitly revises the earlier rule." if conflicts[0].explicit_update else ".") + + " Please confirm with the issuing office before relying on either version.") + extra = [(s, c) for s, c in claims if s not in shown] + if extra: + parts.append("**Most relevant evidence:** " + " ".join(f"{s} [{', '.join(map(str, c))}]" for s, c in extra)) + return "\n".join(parts) + for p in premise: + parts.append(f"**Note:** {p[0].upper() + p[1:]}.") + parts.append(" ".join(f"{s} [{', '.join(map(str, c))}]" for s, c in claims)) + return "\n\n".join(parts) + + def _package(self, question, items, claims, decision, suff, conflicts, checks, conf, why, T, backend, premise): + cited = sorted({c for _, cs in claims for c in cs if 1 <= c <= len(items)}) + if decision == "conflict": + cited = sorted(set(cited) | {n for cf in conflicts for n in (cf.passage_a, cf.passage_b)}) + return { + "system": self.name, "question": question, + "answer": self._render(claims, decision, conflicts, items, premise), + "decision": decision, "claims": claims, + "citations": [{"n": c, "doc_name": items[c - 1].chunk.doc_name, "title": items[c - 1].chunk.title, + "page": items[c - 1].chunk.page} for c in cited], + "passages": passage_dicts(items), + "sufficiency": asdict(suff) if suff else None, + "conflicts": [asdict(c) for c in conflicts], + "citation_checks": [asdict(c) for c in checks], + "premise_notes": premise, + "confidence": None if conf is None else round(conf, 3), + "explanation": why, "timings": T, "generator": backend, + } diff --git a/src/evaluation.py b/src/evaluation.py new file mode 100644 index 0000000000000000000000000000000000000000..c8637fab925f8c6f55ae81b99947ecabe7b3963a --- /dev/null +++ b/src/evaluation.py @@ -0,0 +1,203 @@ +"""Evaluation metrics for EvidenceGuard AI (all computed from the generated question set). + +Retrieval Precision@K, Recall@K, MRR (gold unit = document + page) +Answer quality Answer correctness (key-fact match / correct abstention), + Faithfulness (claims supported by the retrieved context), + Evidence-grounded faithfulness (claims that come from the gold evidence pages), + Answer relevance (TF-IDF cosine question vs answer - lexical proxy), + Context precision (rank-weighted AP@K), Context recall (key facts present in context) +Reliability Unsupported answer rate, Abstention accuracy/P/R/F1, + Contradiction detection P/R/F1, Citation support accuracy, Behaviour accuracy +Efficiency mean total / retrieval / generation / verification time (seconds) +""" +from __future__ import annotations + +import re +import statistics as st + +from src.text_utils import fact_values, keyword_present, normalize, split_sentences + +_ABSTAIN_PAT = re.compile(r"(could not find sufficient evidence|insufficient_evidence|do(es)? not (contain|mention|" + r"provide|specify)|not (mentioned|specified|available) in|no information)", re.I) + + +def is_abstention(result: dict) -> bool: + return result["decision"] == "abstained" or bool(_ABSTAIN_PAT.search(result["answer"] or "")) + + +def _gold_units(q): + return {(e["doc_id"], e["page"]) for e in q["evidence"]} + + +def _support(sentence: str, text: str) -> bool: + """Loose support check used only for evaluation: values present + >=70% token overlap.""" + s_vals, t_vals = fact_values(sentence), fact_values(text) + if s_vals - t_vals: + return False + st_ = set(re.findall(r"[a-z0-9]+", normalize(sentence))) + tt = set(re.findall(r"[a-z0-9]+", normalize(text))) + return len(st_ & tt) / max(1, len(st_)) >= 0.7 + + +def score_question(q: dict, r: dict, page_text: dict, relevance_fn=None) -> dict: + gold = _gold_units(q) + ctx = r["passages"] + units = [(p["doc_id"], p["page"]) for p in ctx] + k = max(1, len(units)) + rel_flags = [u in gold for u in units] + has_gold = bool(gold) + abst = is_abstention(r) + exp_abst = q["expected_behaviour"] == "abstain" + answer = r["answer"] or "" + kws = q["answer_keywords"] + kw_hits = [keyword_present(answer, kw) for kw in kws] + ctx_text = " ".join(p["text"] for p in ctx) + + # ---------------- correctness + if exp_abst: + correct = abst + else: + correct = (not abst) and all(kw_hits) + flagged = r["decision"] == "conflict" or bool(r.get("conflicts")) + if q["expected_behaviour"] == "flag_conflict": + behaviour_ok = (not abst) and flagged and all(kw_hits) + elif exp_abst: + behaviour_ok = abst + else: + behaviour_ok = (not abst) and all(kw_hits) + + # ---------------- faithfulness of answer claims + claims = [s for s, _ in r.get("claims", [])] if r.get("claims") else split_sentences(answer) + claims = [c for c in claims if len(c.split()) >= 3] + if not abst and claims: + faith = sum(_support(c, ctx_text) for c in claims) / len(claims) + gold_text = " ".join(page_text[u] for u in gold) + gfaith = (sum(_support(c, gold_text) for c in claims) / len(claims)) if gold else 0.0 + else: + faith = gfaith = None + + # ---------------- citations + cited = r.get("citations", []) + if not abst and cited: + cite_acc = sum((c_doc_id(c, ctx), c["page"]) in gold for c in cited) / len(cited) + else: + cite_acc = None + + # ---------------- context precision (AP@K) and recall (key facts in context) + if has_gold: + hits, ap = 0, 0.0 + for i, f in enumerate(rel_flags, 1): + if f: + hits += 1 + ap += hits / i + ctx_precision = ap / max(1, hits) if hits else 0.0 + ctx_recall = (sum(keyword_present(ctx_text, kw) for kw in kws) / len(kws)) if kws else None + p_at_k = sum(rel_flags) / k + r_at_k = len(gold & set(units)) / len(gold) + rr = next((1 / i for i, f in enumerate(rel_flags, 1) if f), 0.0) + else: + ctx_precision = ctx_recall = p_at_k = r_at_k = rr = None + + return { + "id": q["id"], "category": q["category"], "question": q["question"], + "expected_behaviour": q["expected_behaviour"], "expected_status": q["expected_evidence_status"], + "decision": r["decision"], "abstained": abst, "conflict_flagged": flagged, + "answer": answer, "expected_answer": q["expected_answer"], + "keywords_hit": sum(kw_hits), "keywords_total": len(kws), + "correct": correct, "behaviour_ok": behaviour_ok, + "unsupported": (not abst) and (exp_abst or (kws and not any(kw_hits))), + "faithfulness": faith, "grounded_faithfulness": gfaith, + "answer_relevance": (relevance_fn(q["question"], answer) if (relevance_fn and not abst) else None), + "citation_support": cite_acc, + "precision_at_k": p_at_k, "recall_at_k": r_at_k, "mrr": rr, + "context_precision": ctx_precision, "context_recall": ctx_recall, + "confidence": r.get("confidence"), + "t_total": r["timings"]["total"], "t_retrieval": r["timings"]["retrieval"] + r["timings"].get("rerank", 0), + "t_generation": r["timings"]["generation"], "t_verification": r["timings"].get("verification", 0.0), + "explanation": r.get("explanation", ""), + "retrieved": "; ".join(f"{d} p.{p}" for d, p in units), + } + + +def c_doc_id(c, ctx): + for p in ctx: + if p["n"] == c["n"]: + return p["doc_id"] + return "" + + +def _mean(xs): + xs = [x for x in xs if x is not None] + return round(st.mean(xs), 4) if xs else None + + +def _prf(pred, gold): + tp = sum(p and g for p, g in zip(pred, gold)) + fp = sum(p and not g for p, g in zip(pred, gold)) + fn = sum((not p) and g for p, g in zip(pred, gold)) + prec = tp / (tp + fp) if tp + fp else 0.0 + rec = tp / (tp + fn) if tp + fn else 0.0 + f1 = 2 * prec * rec / (prec + rec) if prec + rec else 0.0 + acc = sum(p == g for p, g in zip(pred, gold)) / max(1, len(gold)) + return round(prec, 4), round(rec, 4), round(f1, 4), round(acc, 4) + + +def aggregate(rows: list[dict]) -> dict: + ap, ar, af, aa = _prf([r["abstained"] for r in rows], [r["expected_behaviour"] == "abstain" for r in rows]) + cp, cr, cf, ca = _prf([r["conflict_flagged"] for r in rows], [r["expected_status"] == "conflicting" for r in rows]) + out = { + "n_questions": len(rows), + # retrieval + "precision_at_k": _mean(r["precision_at_k"] for r in rows), + "recall_at_k": _mean(r["recall_at_k"] for r in rows), + "mrr": _mean(r["mrr"] for r in rows), + # answer quality + "answer_correctness": _mean(float(r["correct"]) for r in rows), + "faithfulness": _mean(r["faithfulness"] for r in rows), + "grounded_faithfulness": _mean(r["grounded_faithfulness"] for r in rows), + "answer_relevance": _mean(r["answer_relevance"] for r in rows), + "context_precision": _mean(r["context_precision"] for r in rows), + "context_recall": _mean(r["context_recall"] for r in rows), + # reliability + "unsupported_answer_rate": _mean(float(r["unsupported"]) for r in rows), + "abstention_accuracy": aa, "abstention_precision": ap, "abstention_recall": ar, "abstention_f1": af, + "abstention_rate": _mean(float(r["abstained"]) for r in rows), + "contradiction_precision": cp, "contradiction_recall": cr, "contradiction_f1": cf, + "contradiction_accuracy": ca, + "citation_support_accuracy": _mean(r["citation_support"] for r in rows), + "behaviour_accuracy": _mean(float(r["behaviour_ok"]) for r in rows), + # efficiency + "avg_response_time_s": _mean(r["t_total"] for r in rows), + "avg_retrieval_time_s": _mean(r["t_retrieval"] for r in rows), + "avg_generation_time_s": _mean(r["t_generation"] for r in rows), + "avg_verification_time_s": _mean(r["t_verification"] for r in rows), + } + return out + + +def by_category(rows: list[dict]) -> dict: + cats = sorted({r["category"] for r in rows}) + return {c: {"n": sum(r["category"] == c for r in rows), + "answer_correctness": _mean(float(r["correct"]) for r in rows if r["category"] == c), + "behaviour_accuracy": _mean(float(r["behaviour_ok"]) for r in rows if r["category"] == c), + "unsupported_rate": _mean(float(r["unsupported"]) for r in rows if r["category"] == c), + "abstention_rate": _mean(float(r["abstained"]) for r in rows if r["category"] == c)} + for c in cats} + + +def classify_error(r: dict) -> str: + """Coarse error taxonomy used in the error analysis.""" + if r["behaviour_ok"]: + return "correct" + eb = r["expected_behaviour"] + if eb == "abstain": + return "answered unanswerable question (hallucination risk)" + if r["abstained"]: + return "over-abstention (answer was available)" + if eb == "flag_conflict" and not r["conflict_flagged"]: + return "missed conflict" + if r["recall_at_k"] is not None and r["recall_at_k"] == 0: + return "retrieval failure (no gold page retrieved)" + if r["keywords_hit"] == 0: + return "wrong/irrelevant answer content" + return "incomplete answer (some key facts missing)" diff --git a/src/evidence_verifier.py b/src/evidence_verifier.py new file mode 100644 index 0000000000000000000000000000000000000000..a433849dea485ced59dc18bb46ac93e566fb22fa --- /dev/null +++ b/src/evidence_verifier.py @@ -0,0 +1,410 @@ +"""Evidence verification layer of EvidenceGuard AI. + +1. Evidence sufficiency - is the question actually covered by the retrieved passages? +2. Contradiction detection - do relevant passages from different documents disagree? +3. Citation validation - is every answer sentence supported by the passage it cites? + +Two interchangeable judges are provided: + * NLIJudge : cross-encoder/nli-deberta-v3-xsmall (Apache-2.0), probabilities for + contradiction / entailment / neutral. + * no NLI : rule-based checks only (numeric value mismatch, polarity/negation flip, + lexical & numeric support). Always active - NLI models are known to be weak + at comparing numbers, which dominate policy documents, so the numeric rule + is kept even when NLI is available (union of both signals). +""" +from __future__ import annotations + +import logging +import re +from dataclasses import asdict, dataclass, field + +import numpy as np + +import config +from src.text_utils import (DOMAIN_STOPWORDS, content_tokens, extract_facts, fact_occurrences, + fact_values, split_sentences, tokenize) + +log = logging.getLogger(__name__) + +_NEG = re.compile(r"\b(not|cannot|no|never|without)\b") +_UPDATE_CUE = re.compile(r"\b(supersedes?|revised to|extended to|with effect from|amendment|is revised)\b", re.I) +_BOILERPLATE = re.compile(r"Document No\.|Issued by:|Effective from", re.I) + + +def stem(t: str) -> str: + """Tiny suffix stripper (plural / -ed / -ing); enough to match 'electives' with 'elective'.""" + if len(t) <= 3 or not t.isalpha() and "-" not in t: + return t + if t.endswith("ies") and len(t) > 4: + return t[:-3] + "y" + if t.endswith(("sses", "xes", "ches", "shes")): + return t[:-2] + if t.endswith("s") and not t.endswith(("ss", "us", "is")): + t = t[:-1] + for suf in ("ing", "ed"): + if len(t) > 5 and t.endswith(suf): + return t[: -len(suf)] + return t + + +def stems(text: str, drop_domain: bool = False) -> set[str]: + return {stem(t) for t in content_tokens(text, drop_domain=drop_domain)} + + +def topic_tokens(text: str) -> set[str]: + """Content stems without numbers - what a sentence is *about*.""" + return {stem(t) for t in content_tokens(text, drop_domain=True) + if not re.match(r"^\d", t) and t not in {"inr", "per", "up", "least"}} + + +def is_negated(text: str) -> bool: + return bool(_NEG.search(text.lower())) + + +def negated_predicates(text: str) -> set[str]: + """Stems of the words a negation applies to: 'will not be accepted' -> {'accept'}.""" + out = set() + for m in re.finditer(r"\b(?:not|cannot|never)\s+(?:be\s+|been\s+)?([a-z]+)", text.lower()): + w = stem(m.group(1)) + out.add(w[:-2] if w.endswith("ed") else w) + return out + + +# ====================================================================== NLI +class NLIJudge: + def __init__(self, model_name: str = config.NLI_MODEL): + from sentence_transformers import CrossEncoder + self.model = CrossEncoder(model_name, device="cpu") + cfg = getattr(self.model, "config", None) or self.model.model.config + self.labels = {int(k): v.lower() for k, v in cfg.id2label.items()} + self.name = f"NLI cross-encoder ({model_name})" + + def probs(self, pairs: list[tuple[str, str]]) -> list[dict]: + if not pairs: + return [] + logits = np.asarray(self.model.predict(pairs, show_progress_bar=False), dtype="float64") + if logits.ndim == 1: + logits = logits[None, :] + e = np.exp(logits - logits.max(axis=1, keepdims=True)) + p = e / e.sum(axis=1, keepdims=True) + return [{self.labels[j]: float(row[j]) for j in range(row.shape[0])} for row in p] + + +def load_nli(backend: str = config.EG_BACKEND): + if backend in ("full", "auto"): + try: + return NLIJudge() + except Exception as e: + if backend == "full": + raise + log.warning("NLI model unavailable (%s); using rule-based verification only", e) + return None + + +# ====================================================================== results +@dataclass +class Sufficiency: + status: str # sufficient | partial | insufficient + max_relevance: float + coverage: float # combined coverage score + coverage_single: float + coverage_union: float + missing_terms: list = field(default_factory=list) + + +@dataclass +class Conflict: + doc_a: str + title_a: str + page_a: int + issued_a: str + sentence_a: str + doc_b: str + title_b: str + page_b: int + issued_b: str + sentence_b: str + kind: str # numeric | polarity | nli + detail: str + newer: str # title of the more recent document ("" if unknown) + explicit_update: bool + passage_a: int = 0 # 1-based index in the context list + passage_b: int = 0 + + +@dataclass +class CitationCheck: + sentence: str + cited: list + supported: bool + score: float + reason: str + + +# ====================================================================== verifier +class EvidenceVerifier: + def __init__(self, kb, nli: NLIJudge | None = None, thresholds: dict | None = None): + self.kb = kb + self.nli = nli + self.th = thresholds or config.load_thresholds() + + @property + def name(self): + return (self.nli.name + " + numeric/polarity rules") if self.nli else \ + "Rule-based verifier (numeric mismatch, polarity flip, lexical support) - offline fallback" + + # ------------------------------------------------------------------ 1. sufficiency + def query_terms(self, question: str) -> list[str]: + q = list(dict.fromkeys(stem(t) for t in content_tokens(question, drop_domain=True))) + return q or list(dict.fromkeys(stem(t) for t in content_tokens(question))) + + def _weight(self, term: str) -> float: + # IDF is stored for raw tokens; try stem and common surface forms. + for cand in (term, term + "s", term + "es", term + "ed", term + "ing"): + if self.kb.in_vocab(cand): + return self.kb.term_idf(cand) + return self.kb.max_idf + 1.0 + + def sufficiency(self, question: str, items) -> Sufficiency: + terms = self.query_terms(question) + if not items or not terms: + return Sufficiency("insufficient", 0.0, 0.0, 0.0, 0.0, terms) + w = {t: self._weight(t) for t in terms} + total = sum(w.values()) + top = items[:3] + pst = [stems(f"{r.chunk.title}. {r.chunk.text}") for r in top] + single = max(sum(w[t] for t in terms if t in s) / total for s in pst) + union_set = set().union(*pst) + union = sum(w[t] for t in terms if t in union_set) / total + cov = 0.5 * single + 0.5 * union + surface = {stem(t): t for t in content_tokens(question)} # stem -> word as typed + missing = [t for t in terms if t not in union_set] + # Content words that never occur anywhere in the collection (e.g. "revaluation", + # "convocation") mean the topic itself is absent: never offer a partial answer then. + oov = [t for t in missing if not re.match(r"^\d", t) and not any( + self.kb.in_vocab(c) for c in (t, t + "s", t + "es", t + "ed", t + "ing"))] + rel = max(r.relevance for r in items) + if rel >= self.th["min_relevance"] and cov >= self.th["min_coverage"]: + status = "sufficient" + elif rel >= self.th["min_relevance"] * 0.8 and cov >= self.th["partial_coverage"] and not oov: + status = "partial" + else: + status = "insufficient" + return Sufficiency(status, float(rel), float(cov), float(single), float(union), + [surface.get(t, t) for t in missing]) + + def sentence_coverage(self, question: str, sentence: str) -> float: + terms = self.query_terms(question) + if not terms: + return 0.0 + w = {t: self._weight(t) for t in terms} + st = stems(sentence) + return sum(w[t] for t in terms if t in st) / sum(w.values()) + + # ------------------------------------------------------------------ 2. contradiction detection + def expand_for_conflicts(self, question: str, items, retriever, k: int = 4): + """Conflict-search retrieval. + + Competing versions of a rule are often *not* in the top-k for the question (an amendment + circular is short and phrased differently). Each of the best evidence sentences is used as + a new query; passages from OTHER documents that come back are added as conflict candidates. + """ + from src.retrieval import Retrieved + if retriever is None: + return [] + have = {r.chunk.chunk_id for r in items} + docs = {r.chunk.doc_id for r in items} + anchors = [a for a in sorted(self._relevant_sentences(question, items), key=lambda x: -x[3]) + if a[3] >= self.th["conflict_sentence_coverage"] and (extract_facts(a[2]) or is_negated(a[2]))][:3] + extra = [] + for _, r, s, _ in anchors: + for cand in retriever.retrieve(s, k): + c = cand.chunk + if c.chunk_id in have or c.doc_id == r.chunk.doc_id: + continue + sim = max((self._topic_sim(s, x) for x in split_sentences(c.text)), default=0.0) + if sim >= self.th["conflict_topic_sim"]: + have.add(c.chunk_id) + extra.append(Retrieved(c, cand.score, dense=cand.dense, sparse=cand.sparse, + rerank=r.relevance * 0.99, source="conflict-search")) + del docs + return extra + + def _relevant_sentences(self, question: str, items): + """Sentences that are themselves about the question (not merely in a relevant chunk).""" + out = [] + for idx, r in enumerate(items, 1): + expansion = getattr(r, "source", "") == "conflict-search" + if r.relevance < self.th["conflict_min_relevance"] and not expansion: + continue + for s in split_sentences(r.chunk.text): + if _BOILERPLATE.search(s) or len(s.split()) < 5: + continue + cov = self.sentence_coverage(question, s) + if cov >= self.th["conflict_sentence_coverage"] * 0.5: + out.append((idx, r, s, cov)) + return out + + @staticmethod + def _topic_sim(a: str, b: str) -> float: + """Overlap coefficient of the (number-free) content stems of two sentences.""" + ta, tb = topic_tokens(a), topic_tokens(b) + if not ta or not tb: + return 0.0 + return len(ta & tb) / min(len(ta), len(tb)) + + def _numeric_clash(self, question: str, a: str, b: str, min_shared: int = 2): + """Same kind of value, different number, described by overlapping words around it. + + Two extra guards against false alarms: + * the value must be of the type the question asks about ("how many marks" -> marks); + * the question words that sit next to the value must agree in both sentences + (8 books for *research scholars* is not a conflict with 6 books for *PG students*). + """ + from src.llm_generator import expected_answer_type + want = expected_answer_type(question) + qt = set(self.query_terms(question)) + best = None + sa_st, sb_st = stems(a), stems(b) + for ua, va, ca in fact_occurrences(a, before=75, after=40): + if want and ua not in want: + continue + wa = topic_tokens(ca) + for ub, vb, cb in fact_occurrences(b, before=75, after=40): + if ua != ub or va == vb: + continue + if ua not in ("date", "time"): + x, y = float(va), float(vb) + if min(x, y) > 0 and max(x, y) / min(x, y) > 5: # different quantities, not versions + continue + wb = topic_tokens(cb) + shared = wa & wb + # question words describing either value must also occur in the other sentence + near_q = (wa | wb) & qt + if near_q: + missing = {t for t in near_q if not (t in sa_st and t in sb_st)} + if sum(self._weight(t) for t in missing) / sum(self._weight(t) for t in near_q) > \ + self.th["conflict_subject_mismatch"]: + continue + if (len(shared) >= min_shared or shared & qt) and (best is None or len(shared) > best[0]): + best = (len(shared), f"{ua}: {va} vs {vb} (context: {', '.join(sorted(shared)[:4])})") + return best[1] if best else None + + def detect_conflicts(self, question: str, items) -> list[Conflict]: + sents = self._relevant_sentences(question, items) + best_cov = max((x[3] for x in sents), default=0.0) + pairs = [] + for i in range(len(sents)): + for j in range(i + 1, len(sents)): + (ia, ra, sa, ca_), (ib, rb, sb, cb_) = sents[i], sents[j] + if ra.chunk.doc_id == rb.chunk.doc_id: + continue + # one side must be (close to) the best-matching evidence sentence + if max(ca_, cb_) < max(self.th["conflict_sentence_coverage"], 0.8 * best_cov): + continue + pairs.append((self._topic_sim(sa, sb), ia, ra, sa, ib, rb, sb, sents[i][3] + sents[j][3])) + # Most query-relevant pairs first, so the reported conflict is the one the user asked about. + pairs.sort(key=lambda p: -p[7]) + pairs = [p[:7] for p in pairs] + nli_probs = [] + if self.nli and pairs: + nli_probs = self.nli.probs([(p[3], p[6]) for p in pairs]) + found, seen = [], set() + for k, (sim, ia, ra, sa, ib, rb, sb) in enumerate(pairs): + kind, detail = None, "" + clash = self._numeric_clash(question, sa, sb, int(self.th["conflict_min_shared"])) + if clash: + kind, detail = "numeric", clash + elif is_negated(sa) != is_negated(sb) and sim >= self.th["conflict_topic_sim"] and \ + any(p in {x[:len(p)] for x in stems(sb if is_negated(sa) else sa)} + for p in negated_predicates(sa if is_negated(sa) else sb)): + kind, detail = "polarity", "one passage permits what the other rules out" + elif nli_probs and nli_probs[k].get("contradiction", 0) >= self.th["nli_contradiction"] \ + and sim >= self.th["conflict_topic_sim"]: + kind, detail = "nli", f"NLI contradiction p={nli_probs[k]['contradiction']:.2f}" + if not kind: + continue + key = tuple(sorted([ra.chunk.doc_id, rb.chunk.doc_id])) + if key in seen: + continue + seen.add(key) + ca, cb = ra.chunk, rb.chunk + newer = "" + if ca.issued and cb.issued and ca.issued != cb.issued: + newer = ca.title if ca.issued > cb.issued else cb.title + explicit = bool(_UPDATE_CUE.search(sa) or _UPDATE_CUE.search(sb) or + _UPDATE_CUE.search(ca.text) and ca.issued >= cb.issued or + _UPDATE_CUE.search(cb.text) and cb.issued >= ca.issued) + found.append(Conflict(ca.doc_id, ca.title, ca.page, ca.issued, sa, + cb.doc_id, cb.title, cb.page, cb.issued, sb, + kind, detail, newer, explicit, ia, ib)) + return found[:3] + + # ------------------------------------------------------------------ 3. citation validation + def _lexical_support(self, sentence: str, passage: str) -> tuple[float, str]: + s_vals, p_vals = fact_values(sentence), fact_values(passage) + missing_vals = s_vals - p_vals + st = stems(re.sub(r"\[\d+\]", "", sentence)) + pt = stems(passage) + overlap = len(st & pt) / max(1, len(st)) + if missing_vals: + return min(overlap, 0.2), f"values {sorted(missing_vals)} not found in cited passage" + return overlap, f"token overlap {overlap:.2f}" + + def validate_citations(self, claims, items) -> list[CitationCheck]: + checks = [] + texts = [f"{r.chunk.title}. {r.chunk.text}" for r in items] + nli_inputs = [] + for sent, cited in claims: + cited_ok = [c for c in cited if 1 <= c <= len(items)] + pool = cited_ok or list(range(1, len(items) + 1)) + best, reason, best_c = -1.0, "no passage", [] + for c in pool: + sc, why = self._lexical_support(sent, texts[c - 1]) + if sc > best: + best, reason, best_c = sc, why, [c] + checks.append(CitationCheck(sent, cited_ok, best >= self.th["citation_overlap"], float(best), + reason if cited_ok else "uncited sentence; " + reason)) + nli_inputs.append((texts[best_c[0] - 1] if best_c else "", sent)) + if self.nli and checks: + probs = self.nli.probs([(p, re.sub(r"\[\d+\]", "", h)) for p, h in nli_inputs]) + for chk, pr in zip(checks, probs): + ent = pr.get("entailment", 0.0) + if not chk.supported and ent >= self.th["nli_entailment"] and "not found" not in chk.reason: + chk.supported, chk.reason = True, chk.reason + f"; NLI entailment {ent:.2f}" + else: + chk.reason += f"; NLI entailment {ent:.2f}" + return checks + + # ------------------------------------------------------------------ premise check + @staticmethod + def premise_issues(question: str, evidence_sentences: list[str]) -> list[str]: + """Values asserted in the question that the evidence states differently. + + For every value in the question (e.g. "50 marks" in "Given that internal assessment + carries 50 marks ...") find the evidence value of the same unit whose surrounding words + best match the question's words around it; report it if the numbers differ. + """ + issues = [] + for uq, vq, cq in fact_occurrences(question, before=45, after=30): + wq = topic_tokens(cq) + best = None + for s in evidence_sentences: + for ue, ve, ce in fact_occurrences(s, before=45, after=30): + if ue != uq: + continue + shared = len(wq & topic_tokens(ce)) + if shared >= 1 and (best is None or shared > best[0]): + best = (shared, ve) + if best and best[1] != vq: + unit = "" if uq == "%" else f" {uq}" + issues.append(f"the question assumes {vq}{unit}, but the documents state {best[1]}{unit}") + return issues + + +def to_dict(obj): + return asdict(obj) if hasattr(obj, "__dataclass_fields__") else obj + + +__all__ = ["EvidenceVerifier", "load_nli", "Sufficiency", "Conflict", "CitationCheck", "to_dict", + "DOMAIN_STOPWORDS", "tokenize"] diff --git a/src/llm_generator.py b/src/llm_generator.py new file mode 100644 index 0000000000000000000000000000000000000000..ce5a153bff1e776ece8dd373bc9b8986f39f97b4 --- /dev/null +++ b/src/llm_generator.py @@ -0,0 +1,244 @@ +"""Answer generation. + +Backends + HFInferenceGenerator - Hugging Face Inference Providers (huggingface_hub.InferenceClient), + token read from the HF_TOKEN environment variable / Space secret. + LocalLLMGenerator - small instruction-tuned model (default Qwen/Qwen2.5-0.5B-Instruct, + Apache-2.0) run on CPU with transformers, greedy decoding. + ExtractiveGenerator - no LLM: composes the answer from the retrieved sentences that best + cover the question (offline fallback; cannot hallucinate new text, + but can still pick an irrelevant sentence - which is exactly the + failure EvidenceGuard's verification layer is designed to catch). + +Every backend returns GenOutput with a list of (sentence, [cited passage numbers]) claims, +so citation validation works the same way for all of them. +""" +from __future__ import annotations + +import logging +import re +import time +from dataclasses import dataclass, field + +import config +from src.text_utils import content_tokens, extract_facts, split_sentences + +log = logging.getLogger(__name__) + + +def expected_answer_type(question: str) -> set[str]: + """Light answer-type detection (classic QA technique): which kind of value is asked for.""" + q = question.lower() + m = re.search(r"\bhow many (working days|contact hours|days|books|marks|credits|minutes|semesters|years|" + r"members|weeks|months|hours)\b", q) + if m: + unit = m.group(1) + return {"days", "working days"} if unit in ("days", "working days") else {unit} + if re.search(r"\bhow many [a-z-]+", q) and not re.search(r"\bhow many (times|of)\b", q): + return {"count"} # e.g. "how many open electives": a count, not a unit value + if re.search(r"\b(timings?|what time|at what time)\b", q): + return {"time"} + if re.search(r"\b(when|what date|which date|on what date|last date|deadline|by when)\b", q): + return {"date"} + if re.search(r"\b(fee|fine|cost|amount|charged)\b", q): + return {"inr"} + if re.search(r"\b(percentage|percent)\b", q): + return {"%"} + if re.search(r"\bhow long\b", q): + return {"days", "working days", "minutes", "semesters", "years", "weeks", "months"} + if re.search(r"\bhow (many|much)\b", q): + return {"days", "working days", "books", "marks", "credits", "minutes", "semesters", "years", + "members", "%", "inr", "mb", "contact hours", "weeks", "months"} + return set() + +INSUFFICIENT = "INSUFFICIENT_EVIDENCE" + +BASELINE_SYSTEM = ("You are a helpful university assistant. Answer the user's question using the " + "context passages. Cite the passages you use like [1].") + +GROUNDED_SYSTEM = ( + "You are EvidenceGuard, a careful university policy assistant.\n" + "Rules:\n" + "1. Use ONLY the numbered context passages. Never use outside knowledge.\n" + "2. End every sentence with the passage number(s) that support it, e.g. [2].\n" + f"3. If the passages do not contain the answer, reply with exactly: {INSUFFICIENT}\n" + "4. If the passages disagree, state each version with its citation and say which document is more recent.\n" + "5. If the question contains a false assumption, correct it.\n" + "6. Answer in at most 4 short sentences." +) + + +@dataclass +class GenOutput: + text: str + claims: list = field(default_factory=list) # [(sentence, [passage numbers])] + backend: str = "" + seconds: float = 0.0 + declined: bool = False # model itself said evidence is insufficient + + +def format_context(items) -> str: + lines = [] + for i, r in enumerate(items, 1): + c = r.chunk + lines.append(f"[{i}] ({c.title}, page {c.page}, issued {c.issued or 'unknown'}) {c.text}") + return "\n".join(lines) + + +def build_messages(question: str, items, mode: str, conflicts=None, premise_notes=None): + system = GROUNDED_SYSTEM if mode == "grounded" else BASELINE_SYSTEM + user = f"Context passages:\n{format_context(items)}\n\nQuestion: {question}" + if mode == "grounded" and conflicts: + user += "\n\nVerifier note: these passages conflict: " + "; ".join( + f"[{c.passage_a}] vs [{c.passage_b}] ({c.detail}); newer document: {c.newer or 'unknown'}" + for c in conflicts) + if mode == "grounded" and premise_notes: + user += "\n\nVerifier note: " + "; ".join(premise_notes) + return [{"role": "system", "content": system}, {"role": "user", "content": user}] + + +def parse_claims(text: str) -> list[tuple[str, list[int]]]: + claims = [] + for s in split_sentences(text.replace("\n", " ")): + cites = [int(x) for x in re.findall(r"\[(\d+)\]", s)] + clean = re.sub(r"\s*\[\d+\](?:\s*\[\d+\])*", "", s).strip() + if clean: + claims.append((clean, cites)) + return claims + + +# ====================================================================== LLM backends +class HFInferenceGenerator: + def __init__(self, model: str = config.HF_API_MODEL, token: str | None = config.HF_TOKEN): + if not token: + raise RuntimeError("HF_TOKEN is not set") + from huggingface_hub import InferenceClient + self.client = InferenceClient(model=model, token=token, timeout=60) + self.name = f"HF Inference API ({model})" + + def complete(self, messages) -> str: + r = self.client.chat_completion(messages=messages, max_tokens=config.MAX_NEW_TOKENS, + temperature=max(0.01, config.TEMPERATURE)) + return r.choices[0].message.content or "" + + +class LocalLLMGenerator: + def __init__(self, model: str = config.LOCAL_LLM_MODEL): + import torch + from transformers import AutoModelForCausalLM, AutoTokenizer + self.torch = torch + self.tok = AutoTokenizer.from_pretrained(model) + self.model = AutoModelForCausalLM.from_pretrained(model, dtype=torch.float32) + self.model.eval() + self.name = f"Local transformers ({model}, CPU)" + + def complete(self, messages) -> str: + prompt = self.tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) + ids = self.tok(prompt, return_tensors="pt") + with self.torch.no_grad(): + out = self.model.generate(**ids, max_new_tokens=config.MAX_NEW_TOKENS, do_sample=False, + pad_token_id=self.tok.eos_token_id) + return self.tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True).strip() + + +# ====================================================================== extractive backend +class ExtractiveGenerator: + name = "Extractive composer (no LLM) - offline fallback" + + def __init__(self, kb): + self.kb = kb + + def select(self, question: str, items, max_sents: int = 3): + from src.evidence_verifier import stem, stems + q = list(dict.fromkeys(stem(t) for t in content_tokens(question, drop_domain=True))) + q = q or list(dict.fromkeys(stem(t) for t in content_tokens(question))) + if not items: + return [] + w = {t: (self.kb.term_idf(t) if self.kb.in_vocab(t) else self.kb.max_idf) * (0.4 if t[:1].isdigit() else 1.0) + for t in q} + total = sum(w.values()) or 1.0 + want = expected_answer_type(question) + cands = [] + for i, r in enumerate(items, 1): + for s in split_sentences(r.chunk.text): + if re.search(r"Document No\.|Issued by:|^Aranya Valley University", s) or len(s.split()) < 6: + continue + units = {f.split(":", 1)[0] for f in extract_facts(s)} + bonus = 0.15 if want and (want & units) else 0.0 + cands.append((i, r, s, stems(s), bonus)) + if not cands: + return [] + chosen, covered = [], set() + for _ in range(max_sents): + best, best_gain = None, 0.0 + for i, r, s, st, bonus in cands: + if any(s == c[0] for c in chosen): + continue + gain = sum(w[t] for t in q if t in st and t not in covered) / total + score = gain + 0.15 * r.relevance - 0.02 * (i - 1) + (bonus if not chosen else 0.0) + if best is None or score > best[0]: + best, best_gain = (score, i, s, st), gain + if best is None or (chosen and best_gain < 0.12): + break + chosen.append((best[2], [best[1]])) + covered |= {t for t in q if t in best[3]} + return chosen + + +# ====================================================================== facade +class AnswerGenerator: + """Chooses an LLM backend once and exposes generate(question, items, mode, ...).""" + + def __init__(self, kb, backend: str = config.LLM_BACKEND): + self.extractive = ExtractiveGenerator(kb) + self.llm = None + self.requested = backend + self.error = "" + if backend in ("auto", "hf_api") and config.HF_TOKEN: + try: + self.llm = HFInferenceGenerator() + except Exception as e: + self.error = f"HF API unavailable: {e}" + if self.llm is None and backend in ("auto", "local"): + try: + self.llm = LocalLLMGenerator() + except Exception as e: + self.error = (self.error + "; " if self.error else "") + f"local LLM unavailable: {e}" + if self.llm is None and backend not in ("extractive", "auto"): + log.warning("Requested LLM backend %s unavailable (%s); using extractive", backend, self.error) + + @property + def name(self): + return self.llm.name if self.llm else self.extractive.name + + def generate(self, question: str, items, mode: str = "baseline", conflicts=None, + premise_notes=None) -> GenOutput: + t0 = time.perf_counter() + if self.llm is not None: + try: + text = self.llm.complete(build_messages(question, items, mode, conflicts, premise_notes)) + declined = INSUFFICIENT in text + claims = [] if declined else parse_claims(text) + return GenOutput(text, claims, self.llm.name, time.perf_counter() - t0, declined) + except Exception as e: # network / quota errors -> graceful fallback + log.warning("LLM call failed (%s); falling back to extractive", e) + return self._extractive(question, items, mode, conflicts, premise_notes, t0) + + def _extractive(self, question, items, mode, conflicts, premise_notes, t0) -> GenOutput: + if mode == "grounded" and conflicts: + claims = [] + for c in conflicts[:2]: + claims.append((c.sentence_a, [c.passage_a])) + claims.append((c.sentence_b, [c.passage_b])) + # add the best directly relevant sentence(s) too, so the answer stays on the question + claims += self.extractive.select(question, items, max_sents=2) + seen, uniq = set(), [] + for s, ci in claims: + if s not in seen: + uniq.append((s, ci)) + seen.add(s) + claims = uniq + else: + claims = self.extractive.select(question, items) + text = " ".join(f"{s} [{','.join(map(str, c))}]" for s, c in claims) + return GenOutput(text, claims, self.extractive.name, time.perf_counter() - t0) diff --git a/src/reranker.py b/src/reranker.py new file mode 100644 index 0000000000000000000000000000000000000000..6d19380f02d89ce3e4742644854ab4c05c54ea5a --- /dev/null +++ b/src/reranker.py @@ -0,0 +1,78 @@ +"""Second-stage reranking. + +* CrossEncoderReranker - cross-encoder/ms-marco-MiniLM-L-6-v2 (Apache-2.0); logits -> sigmoid in [0,1]. +* LexicalReranker - offline fallback that scores each (query, passage) pair jointly using + IDF-weighted query-term coverage, phrase (bigram) matches and BM25. +""" +from __future__ import annotations + +import logging +import math + +import numpy as np + +import config +from src.text_utils import content_tokens + +log = logging.getLogger(__name__) + + +def _sigmoid(x): + return 1 / (1 + np.exp(-np.asarray(x, dtype="float64"))) + + +class CrossEncoderReranker: + def __init__(self, model_name: str = config.RERANKER_MODEL): + from sentence_transformers import CrossEncoder + self.model = CrossEncoder(model_name, device="cpu") + self.name = f"Cross-encoder ({model_name})" + + def score(self, query: str, passages: list[str]) -> list[float]: + if not passages: + return [] + logits = self.model.predict([(query, p) for p in passages], show_progress_bar=False) + logits = np.asarray(logits, dtype="float64") + if logits.ndim > 1: # some cross-encoders output 2 logits + logits = logits[:, -1] + return _sigmoid(logits).tolist() + + +class LexicalReranker: + def __init__(self, kb): + self.kb = kb + self.name = "Lexical cross-scorer (IDF coverage + bigrams + BM25) - offline fallback" + + def score(self, query: str, passages: list[str]) -> list[float]: + q = list(dict.fromkeys(content_tokens(query, drop_domain=True))) or content_tokens(query) + if not q or not passages: + return [0.0] * len(passages) + w = {t: self.kb.term_idf(t) for t in q} + total = sum(w.values()) + qbig = set(zip(q, q[1:])) + out = [] + for p in passages: + pt = content_tokens(p) + ps = set(pt) + cov = sum(w[t] for t in q if t in ps) / total + big = len(qbig & set(zip(pt, pt[1:]))) / max(1, len(qbig)) if qbig else 0.0 + tf = sum(math.log1p(pt.count(t)) * w[t] for t in q) / (total * 1.5) + out.append(float(min(1.0, 0.70 * cov + 0.15 * big + 0.15 * min(1.0, tf)))) + return out + + +def load_reranker(kb, backend: str = config.EG_BACKEND): + if backend in ("full", "auto"): + try: + return CrossEncoderReranker() + except Exception as e: + if backend == "full": + raise + log.warning("Cross-encoder unavailable (%s); using lexical reranker", e) + return LexicalReranker(kb) + + +def rerank(reranker, query: str, items, top_k: int): + scores = reranker.score(query, [f"{r.chunk.title}. {r.chunk.text}" for r in items]) + for r, s in zip(items, scores): + r.rerank = float(s) + return sorted(items, key=lambda r: -r.rerank)[:top_k] diff --git a/src/research.py b/src/research.py new file mode 100644 index 0000000000000000000000000000000000000000..17e8f78b48882eba1e58631b1ae2eabc453a460a --- /dev/null +++ b/src/research.py @@ -0,0 +1,211 @@ +"""Verified literature used to motivate EvidenceGuard AI (shared by the app and the report). + +All bibliographic details were checked against the publisher / proceedings pages listed in `link`. +Summaries are paraphrased; no result figures are claimed beyond what the papers' abstracts state. +""" + +PAPERS = [ + { + "key": "Chen2024RGB", + "title": "Benchmarking Large Language Models in Retrieval-Augmented Generation", + "authors": "J. Chen, H. Lin, X. Han, L. Sun", + "venue": "AAAI Conference on Artificial Intelligence (AAAI-24), vol. 38, no. 16", + "year": 2024, + "link": "https://doi.org/10.1609/aaai.v38i16.29728", + "problem": "No systematic evaluation of how retrieved context helps or hurts different LLMs.", + "method": "RGB benchmark (English + Chinese) testing four RAG abilities: noise robustness, negative " + "rejection, information integration and counterfactual robustness; six LLMs evaluated.", + "technologies": "Benchmark construction from news; prompting of 6 LLMs.", + "results": "LLMs show some noise robustness but struggle with negative rejection (refusing when evidence " + "is missing), integrating several documents, and handling false information.", + "limitations": "Diagnoses failures but does not propose a remedy; general news domain.", + "gap": "Need for mechanisms that refuse when evidence is missing and handle conflicting context.", + "ours": "Our 5 question categories mirror RGB's abilities; EvidenceGuard adds explicit sufficiency-based " + "abstention (negative rejection) and conflict detection (counterfactual / conflicting context).", + }, + { + "key": "Asai2024SelfRAG", + "title": "Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection", + "authors": "A. Asai, Z. Wu, Y. Wang, A. Sil, H. Hajishirzi", + "venue": "International Conference on Learning Representations (ICLR 2024), oral", + "year": 2024, + "link": "https://proceedings.iclr.cc/paper_files/paper/2024/hash/25f7be9694d7b32d5cc670927b8091e1-Abstract-Conference.html", + "problem": "Indiscriminate retrieval of a fixed number of passages can produce unhelpful or unsupported output.", + "method": "Trains an LM to emit reflection tokens that decide when to retrieve and critique relevance, " + "support and usefulness of its own generations.", + "technologies": "Fine-tuned Llama-2 7B/13B, critic model, reflection tokens.", + "results": "Reported gains over ChatGPT and retrieval-augmented Llama2-chat on open-domain QA, reasoning, " + "fact verification, and better factuality / citation accuracy in long-form generation.", + "limitations": "Requires training a 7B+ model with special tokens; not usable on free CPU hardware.", + "gap": "Training-free, CPU-friendly support critique for small institutions.", + "ours": "We implement the 'is it supported?' critique as a training-free post-hoc citation validator " + "(NLI + lexical/numeric support) that works with any small LLM.", + }, + { + "key": "Yan2024CRAG", + "title": "Corrective Retrieval Augmented Generation", + "authors": "S.-Q. Yan, J.-C. Gu, Y. Zhu, Z.-H. Ling", + "venue": "arXiv preprint arXiv:2401.15884 (2024)", + "year": 2024, + "link": "https://arxiv.org/abs/2401.15884", + "problem": "RAG behaves poorly when retrieval returns irrelevant or wrong documents.", + "method": "A lightweight retrieval evaluator scores retrieved documents; a confidence level triggers " + "Correct / Incorrect / Ambiguous actions (refine, web search, or both).", + "technologies": "T5-based retrieval evaluator, knowledge refinement, web search.", + "results": "Improves standard RAG and Self-RAG on four short- and long-form generation datasets.", + "limitations": "Falls back to open web search, which is inappropriate for closed institutional policy; " + "does not detect conflicts between retrieved documents. Preprint (not peer reviewed).", + "gap": "Confidence-gated behaviour without web fallback, i.e. abstain instead of searching the web.", + "ours": "Our sufficiency check is a confidence gate in the spirit of CRAG, but the low-confidence action " + "is a transparent abstention with an explanation, which suits closed policy corpora.", + }, + { + "key": "Gao2023ALCE", + "title": "Enabling Large Language Models to Generate Text with Citations", + "authors": "T. Gao, H. Yen, J. Yu, D. Chen", + "venue": "Proc. EMNLP 2023, pp. 6465-6488", + "year": 2023, + "link": "https://doi.org/10.18653/v1/2023.emnlp-main.398", + "problem": "LLM answers are hard to verify; citation quality is rarely measured automatically.", + "method": "ALCE benchmark with automatic metrics for fluency, correctness and citation quality " + "(citation recall / precision judged with an NLI model).", + "technologies": "ASQA, QAMPARI, ELI5; NLI-based citation evaluation; prompting strategies.", + "results": "Even the best models lack complete citation support about half the time on ELI5.", + "limitations": "Evaluates citations after the fact; does not change system behaviour.", + "gap": "Use citation checking inside the pipeline to filter unsupported sentences before the user sees them.", + "ours": "EvidenceGuard runs citation validation at inference time and removes unsupported sentences, " + "abstaining if none remain.", + }, + { + "key": "Yoran2024Robust", + "title": "Making Retrieval-Augmented Language Models Robust to Irrelevant Context", + "authors": "O. Yoran, T. Wolfson, O. Ram, J. Berant", + "venue": "International Conference on Learning Representations (ICLR 2024)", + "year": 2024, + "link": "https://doi.org/10.48550/arXiv.2310.01558", + "problem": "Irrelevant retrieved passages can reduce accuracy, especially in multi-hop questions.", + "method": "(1) NLI-based filtering of passages that do not entail the question-answer pair; " + "(2) fine-tuning with a mix of relevant and irrelevant contexts.", + "technologies": "NLI filter, Llama-2 fine-tuning, five open-domain QA benchmarks.", + "results": "NLI filtering prevents performance drops but also discards relevant passages; ~1,000 " + "fine-tuning examples suffice for robustness.", + "limitations": "NLI filtering is too aggressive; fine-tuning needs GPUs.", + "gap": "Combine NLI with cheaper lexical/numeric signals rather than relying on NLI alone.", + "ours": "We use NLI only as one vote, combined with numeric-value and polarity rules (NLI models are weak " + "at numbers, which dominate policy text), and test 'misleading context' questions explicitly.", + }, + { + "key": "Hou2024WikiContradict", + "title": "WikiContradict: A Benchmark for Evaluating LLMs on Real-World Knowledge Conflicts from Wikipedia", + "authors": "Y. Hou, A. Pascale, J. Carnerero-Cano, T. Tchrakian, R. Marinescu, E. Daly, I. Padhi, P. Sattigeri", + "venue": "NeurIPS 2024 Datasets and Benchmarks Track", + "year": 2024, + "link": "https://doi.org/10.52202/079017-3481", + "problem": "How LLMs handle contradictory retrieved passages of equal trustworthiness is unclear.", + "method": "253 human-annotated instances of real inter-context conflicts; evaluates whether answers present " + "a complete view of the conflict rather than picking one side; automated judge metric.", + "technologies": "Human annotation, 7 LLMs, LLM-based evaluator.", + "results": "LLMs frequently fail to surface both sides of a conflict, choosing one answer instead.", + "limitations": "Benchmark only; no conflict-detection component; Wikipedia domain.", + "gap": "A detector that surfaces both versions, plus which one is newer, for versioned institutional rules.", + "ours": "EvidenceGuard detects inter-document conflicts, shows both versions with issue dates and names the " + "newer document, matching WikiContradict's 'complete perspective' recommendation.", + }, + { + "key": "Es2024RAGAS", + "title": "RAGAs: Automated Evaluation of Retrieval Augmented Generation", + "authors": "S. Es, J. James, L. Espinosa-Anke, S. Schockaert", + "venue": "Proc. EACL 2024: System Demonstrations, pp. 150-158", + "year": 2024, + "link": "https://aclanthology.org/2024.eacl-demo.16", + "problem": "RAG pipelines are hard to evaluate without human annotations.", + "method": "Reference-free metrics for faithfulness, answer relevance and context relevance using LLM judges.", + "technologies": "LLM-as-judge prompting, embeddings.", + "results": "Metrics align reasonably with human judgements on the WikiEval dataset.", + "limitations": "Needs a strong LLM judge (often paid APIs); judge errors propagate.", + "gap": "Cheap, reproducible metrics for student projects with no paid API.", + "ours": "We adopt RAGAS metric definitions (faithfulness, answer relevance, context precision/recall) but " + "compute them deterministically against our gold evidence, so they are reproducible at zero cost.", + }, + { + "key": "Niu2024RAGTruth", + "title": "RAGTruth: A Hallucination Corpus for Developing Trustworthy Retrieval-Augmented Language Models", + "authors": "C. Niu, Y. Wu, J. Zhu, S. Xu, K. Shum, R. Zhong, J. Song, T. Zhang", + "venue": "Proc. ACL 2024 (Long Papers), pp. 10862-10878", + "year": 2024, + "link": "https://aclanthology.org/2024.acl-long.585", + "problem": "Even with RAG, LLMs produce claims unsupported by or contradicting the retrieved content.", + "method": "~18,000 RAG responses from several LLMs annotated at word level for hallucination; " + "benchmarks detection methods and fine-tunes a small detector.", + "technologies": "Manual annotation, fine-tuned Llama-2 detector, prompt-based GPT-4 baselines.", + "results": "A fine-tuned relatively small LLM achieves hallucination detection competitive with GPT-4 prompting.", + "limitations": "Detection only; English general-domain tasks (QA, data-to-text, summarisation).", + "gap": "Prevent hallucinations reaching users in a specific, high-stakes domain (university rules).", + "ours": "We measure the 'unsupported answer rate' (RAGTruth's core concern) and reduce it with gating " + "before and after generation.", + }, +] + +FOUNDATION = [ + "P. Lewis et al., \"Retrieval-augmented generation for knowledge-intensive NLP tasks,\" in Proc. NeurIPS, 2020.", + "N. Reimers and I. Gurevych, \"Sentence-BERT: Sentence embeddings using Siamese BERT-networks,\" in Proc. " + "EMNLP-IJCNLP, 2019, pp. 3982-3992.", + "J. Johnson, M. Douze and H. Jegou, \"Billion-scale similarity search with GPUs,\" IEEE Trans. Big Data, " + "vol. 7, no. 3, pp. 535-547, 2021.", + "S. Robertson and H. Zaragoza, \"The probabilistic relevance framework: BM25 and beyond,\" Foundations and " + "Trends in Information Retrieval, vol. 3, no. 4, pp. 333-389, 2009.", + "G. V. Cormack, C. L. A. Clarke and S. Buettcher, \"Reciprocal rank fusion outperforms Condorcet and " + "individual rank learning methods,\" in Proc. ACM SIGIR, 2009, pp. 758-759.", + "R. Nogueira and K. Cho, \"Passage re-ranking with BERT,\" arXiv:1901.04085, 2019.", +] + +RESEARCH_GAP = ( + "Existing work either (a) diagnoses RAG failures on general-domain benchmarks (RGB, WikiContradict, RAGTruth), " + "or (b) fixes them with trained models of 7B+ parameters or open-web fallback (Self-RAG, CRAG, Yoran et al.). " + "We found no student-scale, training-free, CPU-only pipeline that combines evidence-sufficiency abstention, " + "inter-document contradiction detection for *versioned* rules (amendment circulars superseding older " + "regulations) and inference-time citation validation, evaluated on a controlled benchmark with labelled " + "missing-information, misleading and conflicting questions. EvidenceGuard targets this integration gap. " + "Counter-argument we acknowledge: each component exists in the literature; our contribution is the " + "combination, the conflict-search retrieval step, the numeric-aware contradiction rules and the controlled " + "evaluation - not a new learning algorithm." +) + +OBJECTIVES = [ + "Build a modular baseline RAG system (PDF ingestion, Sentence-Transformer embeddings, FAISS, LLM generation, citations).", + "Build EvidenceGuard RAG with hybrid retrieval, cross-encoder reranking, evidence sufficiency checking, " + "contradiction detection, citation validation and confidence-based abstention with explanations.", + "Create a synthetic, explicitly fictional university document collection and a 100-question benchmark " + "covering answerable, multi-passage, missing, misleading and conflicting questions.", + "Quantify retrieval, answer-quality, reliability and efficiency differences in a 4-configuration ablation.", + "Deliver a demonstrable Gradio application deployable on free Hugging Face Spaces hardware.", +] + +LIMITATIONS = [ + "All documents are synthetic and the questions were written by the system's authors: results do not " + "establish real-world accuracy on genuine university policies.", + "The rule components (numeric-conflict and polarity rules) were developed while inspecting the same question " + "set; only the numeric thresholds were calibrated on a held-out DEV split. Test-split results are therefore " + "optimistic and should be confirmed on new, independently written questions.", + "The reported experiment in this repository was run with the OFFLINE fallback components (LSA embeddings, " + "lexical reranker, rule-based verifier, extractive composer) because Hugging Face model downloads were " + "blocked in the build environment. The Hugging Face model path is implemented and smoke-tested but its " + "metrics must be produced by re-running scripts/run_evaluation.py --backend full.", + "Answer correctness is keyword-based (all key facts must appear); it can reward verbose answers and " + "penalise correct paraphrases (e.g. 'three' vs '3').", + "The extractive composer cannot hallucinate new text, so 'faithfulness to context' is near-ceiling by design; " + "evidence-grounded faithfulness and unsupported-answer rate are the more informative measures.", + "EvidenceGuard over-abstains on some answerable multi-part and paraphrased questions (the main cost of the " + "safety gain).", + "No OCR: scanned PDFs without a text layer cannot be processed. Uploaded documents are shared by all users " + "of a public Space session.", +] + +FUTURE = [ + "Run the evaluation with the full Hugging Face model stack and a 1-3B instruction-tuned LLM; compare backends.", + "Collect real (anonymised, permission-granted) university circulars and a blind, independently written question set.", + "Learn the abstention threshold with conformal prediction to give a guaranteed error rate.", + "Use document metadata (version, effective date, 'supersedes' links) as a knowledge graph to resolve conflicts automatically.", + "Add OCR (e.g. Tesseract) for scanned notices and multilingual support (Kannada/Hindi circulars).", + "Per-user document sessions and an admin interface for keeping the policy corpus current.", +] diff --git a/src/retrieval.py b/src/retrieval.py new file mode 100644 index 0000000000000000000000000000000000000000..6c86d953651846d59d8dfdcfe59196c4b8c0db58 --- /dev/null +++ b/src/retrieval.py @@ -0,0 +1,73 @@ +"""Retrievers: dense (FAISS), sparse (BM25) and hybrid (Reciprocal Rank Fusion).""" +from __future__ import annotations + +from dataclasses import dataclass + +import numpy as np + +import config +from src.document_processor import Chunk +from src.text_utils import content_tokens + + +@dataclass +class Retrieved: + chunk: Chunk + score: float # retriever score (cosine, BM25, or RRF) + dense: float = 0.0 + sparse: float = 0.0 + rerank: float | None = None # filled by the reranker, in [0, 1] + source: str = "retrieval" # or "conflict-search" (added by the verifier) + + @property + def relevance(self) -> float: + return self.rerank if self.rerank is not None else self.score + + +class DenseRetriever: + name = "Dense (FAISS)" + + def __init__(self, kb): + self.kb = kb + + def retrieve(self, query: str, k: int) -> list[Retrieved]: + if not self.kb.ready: + return [] + qv = self.kb.embedder.encode([query]) + scores, ids = self.kb.store.search(qv, k) + return [Retrieved(self.kb.chunks[i], float(s), dense=float(s)) for s, i in zip(scores, ids) if i >= 0] + + +class BM25Retriever: + name = "BM25" + + def __init__(self, kb): + self.kb = kb + + def retrieve(self, query: str, k: int) -> list[Retrieved]: + if not self.kb.ready: + return [] + s = self.kb.bm25.get_scores(content_tokens(query)) + order = np.argsort(-s)[:k] + return [Retrieved(self.kb.chunks[i], float(s[i]), sparse=float(s[i])) for i in order if s[i] > 0] + + +class HybridRetriever: + """Semantic + keyword retrieval fused with Reciprocal Rank Fusion (Cormack et al., 2009).""" + name = "Hybrid (FAISS + BM25, RRF)" + + def __init__(self, kb, rrf_k: int = config.RRF_K): + self.dense, self.sparse, self.rrf_k = DenseRetriever(kb), BM25Retriever(kb), rrf_k + + def retrieve(self, query: str, k: int, candidates: int = config.CANDIDATES) -> list[Retrieved]: + d = self.dense.retrieve(query, candidates) + s = self.sparse.retrieve(query, candidates) + fused: dict[str, Retrieved] = {} + for rank, r in enumerate(d): + fused[r.chunk.chunk_id] = Retrieved(r.chunk, 1 / (self.rrf_k + rank + 1), dense=r.dense) + for rank, r in enumerate(s): + cur = fused.get(r.chunk.chunk_id) or Retrieved(r.chunk, 0.0) + cur.score += 1 / (self.rrf_k + rank + 1) + cur.sparse = r.sparse + fused[r.chunk.chunk_id] = cur + return sorted(fused.values(), key=lambda x: -x.score)[:k] diff --git a/src/system.py b/src/system.py new file mode 100644 index 0000000000000000000000000000000000000000..7fb744b4a76583bf043e6e6ca0737099acb9cc12 --- /dev/null +++ b/src/system.py @@ -0,0 +1,62 @@ +"""Factory that loads every component once and exposes the four evaluated configurations.""" +from __future__ import annotations + +import logging +import os + +import config +from src.baseline_rag import BaselineRAG +from src.embeddings import load_embedder +from src.enhanced_rag import EvidenceGuardRAG +from src.evidence_verifier import EvidenceVerifier, load_nli +from src.llm_generator import AnswerGenerator +from src.reranker import load_reranker +from src.vector_store import KnowledgeBase + +log = logging.getLogger(__name__) + +CONFIG_NAMES = { + "baseline": "1. Baseline RAG", + "rerank": "2. RAG + hybrid retrieval & reranking", + "verify": "3. RAG + evidence verification", + "full": "4. EvidenceGuard (complete)", +} + + +class EvidenceGuardSystem: + def __init__(self, backend: str = config.EG_BACKEND, llm_backend: str = config.LLM_BACKEND, + load_sample_data: bool = True, thresholds: dict | None = None): + if backend == "lite": + os.environ.setdefault("HF_HUB_OFFLINE", "1") + self.backend = backend + self.embedder = load_embedder(backend) + self.kb = KnowledgeBase(self.embedder) + self.reranker = load_reranker(self.kb, backend) + self.nli = load_nli(backend) + from src.reranker import CrossEncoderReranker + self.effective_backend = "full" if isinstance(self.reranker, CrossEncoderReranker) else "lite" + self.verifier = EvidenceVerifier(self.kb, self.nli, thresholds or config.load_thresholds(self.effective_backend)) + self.generator = AnswerGenerator(self.kb, llm_backend) + self.pipelines = { + "baseline": BaselineRAG(self.kb, self.generator, name=CONFIG_NAMES["baseline"]), + "rerank": BaselineRAG(self.kb, self.generator, self.reranker, use_hybrid=True, use_rerank=True, + name=CONFIG_NAMES["rerank"]), + "verify": EvidenceGuardRAG(self.kb, self.generator, self.reranker, self.verifier, use_hybrid=False, + use_rerank=False, name=CONFIG_NAMES["verify"]), + "full": EvidenceGuardRAG(self.kb, self.generator, self.reranker, self.verifier, + name=CONFIG_NAMES["full"]), + } + self.sample_infos = self.kb.load_folder(config.SAMPLE_DATA_DIR) if load_sample_data else [] + + def set_thresholds(self, th: dict): + self.verifier.th = dict(th) + + def component_names(self) -> dict: + return { + "Embeddings": self.embedder.name, + "Vector store": "FAISS IndexFlatIP (cosine)", + "Keyword retrieval": "BM25 (rank_bm25) fused with Reciprocal Rank Fusion", + "Reranker": self.reranker.name, + "Evidence verifier": self.verifier.name, + "Generator": self.generator.name, + } diff --git a/src/text_utils.py b/src/text_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..db7fe3884f65882c363a31eb080efecb26c93d4d --- /dev/null +++ b/src/text_utils.py @@ -0,0 +1,127 @@ +"""Shared text helpers: normalisation, tokenisation, sentence splitting, fact extraction.""" +from __future__ import annotations + +import re +import unicodedata + +STOPWORDS = set(""" +a an the and or of to in on for by with at from as is are was were be been being this that these those +it its into than then there their they them what which who whom whose when where why how can could +may might must shall should will would do does did done have has had having i me my we our you your +he she his her not no yes if any all each every per about after before up down over under again +further once only own same so too very s t just also both either neither such other some more most +given since as under according am i'm my is there does do much many long within how during while +""".split()) + +# Words so common in this domain that they say little about *what* is being asked. +DOMAIN_STOPWORDS = set(""" +student students university avu aranya valley course courses semester policy rule rules document +documents regulation regulations required require requires requirement allowed allow need needed +""".split()) + +_SENT_SPLIT = re.compile(r"(?<=[.!?])\s+(?=[A-Z0-9(])") +_TOKEN = re.compile(r"[a-z0-9]+(?:[.:'+-][a-z0-9]+)*%?|[a-z]\+") + + +def normalize(text: str) -> str: + """Lower-case, unify unicode, drop thousands separators, collapse whitespace.""" + text = unicodedata.normalize("NFKC", text or "") + text = text.replace("โ€“", "-").replace("โ€”", "-").replace("โ€™", "'") + text = re.sub(r"(?<=\d),(?=\d)", "", text) # 6,00,000 -> 600000 + text = re.sub(r"\s+", " ", text) + return text.lower().strip() + + +def tokenize(text: str) -> list[str]: + return _TOKEN.findall(normalize(text)) + + +def content_tokens(text: str, drop_domain: bool = False) -> list[str]: + toks = [t for t in tokenize(text) if t not in STOPWORDS and len(t) > 1 or t[:1].isdigit()] + if drop_domain: + toks = [t for t in toks if t not in DOMAIN_STOPWORDS] + return toks + + +def split_sentences(text: str) -> list[str]: + text = re.sub(r"\s+", " ", text or "").strip() + if not text: + return [] + return [s.strip() for s in _SENT_SPLIT.split(text) if s.strip()] + + +# ---------------------------------------------------------------- fact signatures +_NUM_UNIT = re.compile( + r"(?:inr\s*)?(\d+(?:\.\d+)?)\s*(%|percent|working days|calendar days|days|day|weeks|months|" + r"books|book|marks|credits|minutes|hours|contact hours|mb|gb|members|semesters|years)?", +) +_DATE = re.compile(r"\b(\d{1,2})\s+(january|february|march|april|may|june|july|august|september|october|" + r"november|december)\s+(\d{4})\b") +_TIME = re.compile(r"\b(\d{1,2}:\d{2})\s*(am|pm)\b") +_WORD_NUM = {"one": "1", "two": "2", "three": "3", "four": "4", "five": "5", "six": "6"} + + +def extract_facts(text: str) -> set[str]: + """Return a set of normalised value strings (numbers with units, dates, times, money).""" + t = normalize(text) + facts: set[str] = set() + for d, m, y in _DATE.findall(t): + facts.add(f"date:{int(d)} {m} {y}") + t_wo_dates = _DATE.sub(" ", t) + for hm, ap in _TIME.findall(t_wo_dates): + facts.add(f"time:{hm}{ap}") + t_wo = _TIME.sub(" ", t_wo_dates) + for m in re.finditer(r"inr\s*(\d+)", t_wo): + facts.add(f"inr:{m.group(1)}") + t_wo = re.sub(r"inr\s*\d+", " ", t_wo) + for w, n in _WORD_NUM.items(): + t_wo = re.sub(rf"\b{w}\b(?=\s+(semesters|years|make-up|external|members|books))", n, t_wo) + for num, unit in _NUM_UNIT.findall(t_wo): + if unit: + unit = {"percent": "%", "day": "days", "book": "books", "calendar days": "days"}.get(unit, unit) + facts.add(f"{unit}:{float(num):g}") + return facts + + +def fact_occurrences(text: str, before: int = 75, after: int = 45) -> list[tuple[str, str, str]]: + """Each value mention as (unit, value, surrounding context text without the value itself).""" + t = normalize(text) + occ, taken = [], [] + + def free(a, b): + return all(b <= x or a >= y for x, y in taken) + + pats = [ + (_DATE, lambda m: ("date", f"{int(m.group(1))} {m.group(2)} {m.group(3)}")), + (_TIME, lambda m: ("time", f"{m.group(1)}{m.group(2)}")), + (re.compile(r"inr\s*(\d+)"), lambda m: ("inr", m.group(1))), + (re.compile(r"(\d+(?:\.\d+)?)\s*(%|percent|working days|calendar days|days|weeks|months|books|marks|" + r"credits|minutes|contact hours|hours|mb|gb|members|semesters|years)\b|(\d+(?:\.\d+)?)%"), + lambda m: ("%" if m.group(3) else {"percent": "%", "calendar days": "days"}.get(m.group(2), m.group(2)), + f"{float(m.group(1) or m.group(3)):g}")), + ] + for pat, fn in pats: + for m in pat.finditer(t): + a, b = m.span() + if not free(a, b): + continue + taken.append((a, b)) + unit, val = fn(m) + ctx = t[max(0, a - before):a] + " " + t[b:b + after] + occ.append((unit, val, ctx)) + return occ + + +def fact_values(text: str) -> set[str]: + """Just the numeric parts (used for loose support checks).""" + out = set() + for f in extract_facts(text): + out.add(f.split(":", 1)[1]) + return out + + +def keyword_present(answer: str, keyword: str) -> bool: + """keyword may contain alternatives separated by '|'.""" + a = " " + normalize(answer) + " " + return any(normalize(k) in a if not k.endswith(" ") else normalize(k) + " " in a + for k in keyword.split("|")) diff --git a/src/vector_store.py b/src/vector_store.py new file mode 100644 index 0000000000000000000000000000000000000000..35f12ec5c67d53d3f7644c5772fbf1a12b8923a0 --- /dev/null +++ b/src/vector_store.py @@ -0,0 +1,112 @@ +"""FAISS vector store plus the KnowledgeBase that owns documents, chunks, dense and BM25 indexes.""" +from __future__ import annotations + +import math +from collections import Counter +from pathlib import Path + +import faiss +import numpy as np + +from src.document_processor import Chunk, DocumentInfo, process_pdf +from src.text_utils import content_tokens + + +class FaissStore: + """Exact inner-product search over L2-normalised vectors (= cosine similarity).""" + + def __init__(self, dim: int): + self.index = faiss.IndexFlatIP(dim) + + def add(self, vectors: np.ndarray): + self.index.add(np.ascontiguousarray(vectors, dtype="float32")) + + def search(self, query_vec: np.ndarray, k: int): + k = min(k, self.index.ntotal) + if k == 0: + return [], [] + scores, ids = self.index.search(np.ascontiguousarray(query_vec, dtype="float32"), k) + return scores[0].tolist(), ids[0].tolist() + + @property + def size(self): + return self.index.ntotal + + +class KnowledgeBase: + """Holds the chunk collection and every index built over it.""" + + def __init__(self, embedder): + from rank_bm25 import BM25Okapi # noqa: F401 (import check) + self.embedder = embedder + self.docs: dict[str, DocumentInfo] = {} + self.chunks: list[Chunk] = [] + self.store: FaissStore | None = None + self.bm25 = None + self.idf: dict[str, float] = {} + self.max_idf = 1.0 + + # ---------------------------------------------------------------- ingestion + def add_pdfs(self, paths, doc_ids=None) -> list[DocumentInfo]: + infos = [] + for i, p in enumerate(paths): + did = doc_ids[i] if doc_ids else None + info, chunks = process_pdf(p, did) + if info.doc_id in self.docs: # re-upload replaces the old version + self.chunks = [c for c in self.chunks if c.doc_id != info.doc_id] + if info.status != "error": + self.docs[info.doc_id] = info + self.chunks.extend(chunks) + infos.append(info) + self.rebuild() + return infos + + def remove_doc(self, doc_id: str): + self.docs.pop(doc_id, None) + self.chunks = [c for c in self.chunks if c.doc_id != doc_id] + self.rebuild() + + def rebuild(self): + from rank_bm25 import BM25Okapi + texts = [self._index_text(c) for c in self.chunks] + if not texts: + self.store, self.bm25 = None, None + return + if getattr(self.embedder, "needs_fit", False): + self.embedder.fit(texts) + vecs = self.embedder.encode(texts) + self.store = FaissStore(vecs.shape[1]) + self.store.add(vecs) + toks = [content_tokens(t) for t in texts] + self.bm25 = BM25Okapi(toks) + df = Counter(t for doc in toks for t in set(doc)) + n = len(toks) + self.idf = {t: math.log(1 + (n - d + 0.5) / (d + 0.5)) for t, d in df.items()} + self.max_idf = max(self.idf.values()) if self.idf else 1.0 + + @staticmethod + def _index_text(c: Chunk) -> str: + return f"{c.title}. {c.text}" + + # ---------------------------------------------------------------- helpers + def term_idf(self, term: str) -> float: + """IDF of a term; terms never seen in the corpus get the highest weight (+1).""" + return self.idf.get(term, self.max_idf + 1.0) + + def in_vocab(self, term: str) -> bool: + return term in self.idf + + @property + def ready(self) -> bool: + return self.store is not None and self.store.size > 0 + + def load_folder(self, folder: Path, use_manifest_ids: bool = True): + import json + folder = Path(folder) + pdfs = sorted(folder.glob("*.pdf")) + ids = None + mf = folder / "corpus_manifest.json" + if use_manifest_ids and mf.exists(): + m = {d["filename"]: d["id"] for d in json.loads(mf.read_text())} + ids = [m.get(p.name) for p in pdfs] + return self.add_pdfs(pdfs, ids)