How mohsinalijoo/fake-news-classifier works
This Flask application classifies manually entered news and fetched live articles, returning a label and confidence score. Its separate training script prepares text, fits and evaluates a TF-IDF/XGBoost model, and saves artifacts that the web application loads. The source confirms these flows; the referenced model files and dataset files are not present in the supplied tree.
Main entry points: app.py Flask application · train_model.py Training workflow · index.html Web interface · data_preparation.py Text cleaning
Components 10
Web experience
- Web interface
templates/index.html - Flask application
app.py
Classification
- Text cleaning
data_preparation.py - TF-IDF vectorizer
app.py - XGBoost classifier
app.py
Model training
- Training workflow
train_model.py - Model artifacts
train_model.py
Other components
- News reader
- NewsAPI
- Training datasets
Connections 13
- News reader → Web interface: uses
- Web interface → Flask application: submits input
- Flask application → Text cleaning: cleans text
- Flask application → TF-IDF vectorizer: transforms text
- Flask application → XGBoost classifier: predicts label
- Flask application → NewsAPI: fetches articles
- Flask application → Web interface: renders results
- Training datasets → Training workflow: provides data
- Training workflow → Text cleaning: cleans text
- Training workflow → TF-IDF vectorizer: fits features
- Training workflow → XGBoost classifier: fits and evaluates
- Training workflow → Model artifacts: saves model
- Model artifacts → Flask application: loaded at startup