VeriFy is an intelligent Fake News Detection and Explanation system that combines deep learning–based text classification with LLM-powered explainability.
The project aims to not only classify news as Fake or Real, but also explain why a particular decision was made and collect user feedback to improve future model training.
With the rapid spread of misinformation across digital platforms, users often struggle to judge the credibility of online news.
Most existing tools either:
- Only classify news without explanation, or
- Provide generic AI-generated responses without grounding in model behavior.
VeriFy bridges this gap by combining:
- A trained deep learning model for classification
- Explainable AI (XAI) using Gemini
- Counterfactual reasoning
- Human-in-the-loop feedback collection
- News text is preprocessed and converted into sequences using a Tokenizer
- The sequences are padded to a fixed length (
maxlen = 1000) - A Word2Vec + LSTM neural network predicts whether the news is Fake or Real
- The prediction and original text are passed to Gemini LLM
- Gemini generates human-readable reasoning explaining why the model may have made that prediction
- This improves transparency and user trust
- The system highlights how small wording changes could flip the prediction
- Helps identify sensational terms, emotional language, or misleading phrases
- Users can confirm whether the prediction was correct
- Feedback is logged into a CSV file
- This data can be reused for future re-training and dataset expansion
-
Embedding Layer
- Pre-trained Word2Vec embeddings (100 dimensions)
- Embeddings frozen for stable semantic learning
-
LSTM Layer
- Captures long-term dependencies in news articles
- Effective for modeling narrative flow and context
-
Dense Output Layer
- Sigmoid activation for binary classification (Fake / Real)
📌 Why LSTM + Word2Vec?
- Handles long news articles better than traditional ML models
- Learns semantic and contextual patterns
- Performs well on sequential text data
- More interpretable than large black-box transformer models for this task
- Source: Aggregated fake and real news articles
- Preprocessing:
- Special character removal
- Tokenization
- Padding to uniform sequence length
- Labels:
0 → Fake1 → Real
- Python
- TensorFlow / Keras
- Gensim (Word2Vec)
- Streamlit (Frontend UI)
- Google Gemini API (Explainability)
- Pandas / NumPy
- Gemini LLM for explanations
- CSV-based feedback logging for retraining
Due to GitHub size limits, the trained model and tokenizer are hosted on Google Drive.
📥 Download from here:
👉 Google Drive Link – Model & Tokenizer
After downloading:
- Place
my_model.h5insidemodel/ - Place
tokenizer.pklinsidemodel/
git clone https://github.com/your-username/verify-fake-news.git
cd verify-fake-newspython -m venv venvsource venv/bin/activatevenv\Scripts\activatepip install -r requirements.txtCreate a file named api_key.env in the project root and add:
GEMINI_API_KEY=your_api_key_here