How bijen-maharjan56/fake_news_detection_system works
This Flask application accepts political headlines or articles, classifies them as REAL or FAKE, and returns a confidence score and influential words. The main workflow runs from the browser through the prediction API into text cleaning, political-news validation, TF-IDF feature generation, and the saved classifier. A separate retraining workflow builds artifacts from the CSV dataset. The README also documents rejecting non-political input and displaying results; unsampled templates and dataset details are represented only at their supported paths.
Main entry points: model.py Training workflow · script.js Prediction interface · app.py Flask routes · templates Web pages
Components 15
Web interface
- Web pages
templates - Prediction interface
static/js/script.js - Flask routes
app.py - Prediction endpoint
app.py
Prediction
- Text cleaning
model.py - Political filter
model.py - TF-IDF features
model.py - News classifier
model.py - Prediction details
model.py
Model training
- Training command
train_model.py - Training workflow
model.py - Labeled dataset
datasets/final_dataset.csv
Model artifacts
- Classifier artifact
model.pkl - Word vectorizer
word_vectorizer.pkl
Other components
- News reader
Connections 17
- News reader → Web pages: opens
README.md - Flask routes → Web pages: renders
app.py - News reader → Prediction interface: enters news
README.md - Prediction interface → Prediction endpoint: posts news
static/js/script.js - Prediction endpoint → Text cleaning: calls prediction
app.py - Text cleaning → Political filter: checks text
model.py - Political filter → TF-IDF features: accepts political text
model.py - TF-IDF features → News classifier: supplies features
model.py - News classifier → Prediction details: provides prediction
model.py - Prediction endpoint → Prediction interface: returns JSON
app.py - Prediction interface → News reader: shows results
static/js/script.js - Training command → Training workflow: calls training
train_model.py - Training workflow → Labeled dataset: reads
model.py - Training workflow → Classifier artifact: writes
model.py - Training workflow → Word vectorizer: writes
model.py - Flask routes → Classifier artifact: loads
app.py - Flask routes → Word vectorizer: loads
app.py