Fact Check LIAR
Evidence-aware political claim verification
A fact-checker has to do more than attach a label to a sentence. It needs to find relevant prior claims, distinguish wording from meaning, and show enough context for the verdict to be inspected. FactCheckLIAR treats those as separate, replaceable stages rather than one opaque prediction.
Truth Is Not Binary
The LIAR dataset records short political statements together with speaker, party, context, and truthfulness history. Its six ordered labels preserve the uncertainty that a true-or-false interface would erase.
- Manually labelled claims
- 12,800
- Truthfulness labels
- 6
- Retrieval channels
- BM25 + FAISS
- Classifier
- BERT
Each claim also carries contextual metadata that can be inspected alongside the retrieved statement.
Evidence Before Verdict
The application makes the path from a submitted claim to a readable answer explicit. Every stage produces an artefact that the next stage can use and the interface can expose.
Hybrid Retrieval
Political claims are often paraphrased, so neither exact term matching nor semantic similarity is reliable alone. FactCheckLIAR normalizes both signals and fuses them before selecting supporting claims.
Tokenized LIAR statements are ranked by term relevance, preserving names, places, institutions, and distinctive phrases.
Six-Way Classification
The classifier is unshDee/liar_qa, a bert-base-uncased sequence classifier fine-tuned for the six LIAR labels. A local model directory takes priority; the saved model is downloaded only when it is not already available.
Human-Readable Response
A label is useful for evaluation, but a visitor needs an answer. The final stage can produce a reproducible template or ask a local Ollama model to turn the same evidence into more natural prose.
Template responses work without an LLM and make repeated runs easy to compare. The --no-llm flag forces this path.
Operational Design
Persistent Indexes
Rebuilding sparse and dense indexes on every start interrupted iteration. The current version caches both indexes and uses a dataset hash to invalidate them whenever data/train.tsv changes.
Failure-Safe Generation
Ollama is an enhancement rather than a runtime dependency. If it is unavailable or deliberately disabled, the application falls back to the deterministic response path instead of withholding a result.
Interfaces
The same pipeline is available as a direct command-line workflow and a Streamlit interface. The terminal exposes evidence for development; the browser version focuses on claim entry, detail level, and response mode.
Terminal Workflow
$ python app.py --query "A claim to verify" --verbose --no-llm Loading cached BM25 and FAISS indexes Retrieving lexical and semantic evidence Ready: evidence, six-way label, deterministic explanation $ streamlit run streamlit_app.py Local interface available in the browser
Streamlit Demo
The hosted interface keeps the interaction deliberately small. The demo action in the project header opens it in a separate tab, avoiding a slow or sleeping third-party embed inside the article.
The result is not a claim of automated certainty. It is a compact, inspectable workflow for comparing a new statement with labelled political claims and seeing how the predicted verdict was assembled.