How aakanksha-2025/fake_news_detector works
This is a fake-news classification project with two prediction interfaces: a Flask JSON API and a Streamlit app. Its data workflow combines labeled fake/real news, cleans it, then trains and evaluates a TF-IDF/Logistic Regression model and saves the model and vectorizer. At prediction time, each interface uses those artifacts to classify user text. The README describes the capabilities, but the data files and test implementation are not in the supplied tree; the graph shows only documented data stages and sampled runtime wiring.
Main entry points: train_model.py Train and evaluate · api.py Flask prediction API · app.py Streamlit app · model.pkl Classifier
Components 12
Data preparation
- Combine and label
prepare_data.py - news.csv
- Clean text
preprocess.py - news_cleaned.csv
Model training
- Train and evaluate
train_model.py - Classifier
model.pkl - TF-IDF vectorizer
vectorizer.pkl
Prediction interfaces
- Flask prediction API
api.py - Streamlit app
app.py
Other components
- Kaggle news data
- API caller
- Streamlit user
Connections 13
- Kaggle news data → Combine and label: provides CSVs
- Combine and label → news.csv: writes
- Clean text → news.csv: reads
- Clean text → news_cleaned.csv: writes
- Train and evaluate → news_cleaned.csv: reads
- Train and evaluate → Classifier: saves
- Train and evaluate → TF-IDF vectorizer: saves
- API caller → Flask prediction API: posts text
- Flask prediction API → Classifier: loads and predicts
- Flask prediction API → TF-IDF vectorizer: loads and transforms
- Streamlit user → Streamlit app: enters text
- Streamlit app → Classifier: loads and predicts
- Streamlit app → TF-IDF vectorizer: loads and transforms