How ventravs/fake-news-detector works
This repository implements a fake-news detector: article text is submitted to the FastAPI service, cleaned, vectorized, classified, and returned with confidence and influential words. The service also persists predictions and exposes recent history; its frontend is served from the repository’s frontend directory. A separate training script prepares labeled data, fits TF-IDF and logistic-regression components, evaluates them, and saves artifacts for inference. README-described Chrome extension support has no implementation file in the supplied tree. The graph reflects the active FastAPI code; the available excerpts do not show frontend or extension internals.
Main entry points: app.py FastAPI routes · index.html Web frontend · train_model.py Training preparation
Components 15
User clients
- Web frontend
frontend/index.html - Chrome extension
Detection service
- FastAPI routes
app.py - Text cleaning
app.py - TF-IDF vectorizer
app.py - Logistic classifier
app.py - Verdict adjustment
app.py - Top-word analysis
app.py
Prediction records
- Oracle database
- Prediction history
app.py
Model training
- Labeled articles
train_model.py - Training preparation
train_model.py - TF-IDF and model fit
train_model.py - Saved model artifacts
train_model.py
Other components
- Article submitter
Connections 14
- Article submitter → Web frontend: submits article
README.md - Web frontend → FastAPI routes: calls detection
README.md - FastAPI routes → Text cleaning: cleans text
app.py - FastAPI routes → TF-IDF vectorizer: transforms text
app.py - FastAPI routes → Logistic classifier: predicts probabilities
app.py - FastAPI routes → Verdict adjustment: adjusts verdict
app.py - FastAPI routes → Top-word analysis: ranks words
app.py - FastAPI routes → Oracle database: inserts prediction
app.py - Prediction history → Oracle database: reads recent records
app.py - Article submitter → Prediction history: requests history
app.py - Chrome extension → FastAPI routes: uses detection
README.md - Labeled articles → Training preparation: cleans and labels
train_model.py - Training preparation → TF-IDF and model fit: trains on split
train_model.py - TF-IDF and model fit → Saved model artifacts: saves model
train_model.py