GitHub Park

AI Fake News Detector

AI Fake News Detector is an automated fact-checking system designed to detect false news. It leverages large language models (such as Qwen2.5-14B) and the BGE-M3-Embedding model to automatically extract verifiable core claims from news texts. By using the DuckDuckGo search engine to gather relevant evidence in real-time, the system performs semantic matching and processes chunked evidence. Based on the analyzed evidence, the fake news detector determines the veracity of the news (correct, false, or partially correct) and presents the entire verification process in real-time through a streaming web interface built with Streamlit.

AI Fake News Detector can automatically identify input text in languages such as Chinese, English, Japanese, and Korean, without requiring manual language switching. It supports user-defined output languages and can also automatically match and present results in the corresponding language based on the input, while providing a complete interface in both Chinese and English.

AI Fake News Detector is compatible with various model services:

Ollama: Supports local deployment, pre-equipped with GPT-OSS 120B Cloud and Nomic Embed models by default. • LM Studio: Can connect to local model services. • OpenAI: Directly calls official GPT series models. • Custom API: Compatible with any model service that follows the OpenAI API format.

The AI Fake News Detector first intelligently extracts core verifiable claims from the news and then gathers multi-source web evidence using search engines such as SearXNG and DuckDuckGo. Advanced embedding models are utilized to calculate the relevance of evidence, ensuring verification accuracy. Finally, it presents a detailed reasoning process and evidence sources, making the verification results traceable. All fact-checking history is automatically saved for future reference. The system supports generating professional PDF verification reports for archiving and sharing, while also enabling multiple users to operate independently with their data kept isolated.

Environment Requirements for Installation

• Python 3.12 or higher must be installed in the runtime environment. • It is recommended to install Ollama or other model services compatible with the OpenAI API. • SearXNG can be optionally installed to enhance search functionality.

Installing AI Fake News Detector

  1. Clone the repository
git clone https://github.com/CaptainYifei/fake-news-detector.git
cd fake-news-detector
  1. Install dependencies
pip install -r requirements.txt
  1. Configure model services (using Ollama as an example)
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull recommended models
ollama pull gpt-oss:120b-cloud
ollama pull nomic-embed-text:latest
  1. Configure search service (optional)
# Start SearXNG using Docker
docker run -d -p 8090:8080 searxng/searxng
  1. Launch the application
streamlit run app.py

Once the application starts, you can access it at http://localhost:8501.

Visit CaptainYifei/fake-news-detector to access the source code and obtain more information.