How jaya19prakash72/sentiment-analysis works
This is a Flask sentiment-analysis dashboard. Users submit text through the browser, the server classifies it with a trained Naive Bayes model, records results, and returns them for display; the dashboard also presents aggregate counts and recent history. Batch analysis and sample-data training are additional product capabilities. The source excerpts establish the server, model, storage, and browser request flow; page structure and styling roles are documented in the README, whose details are not independently verified against those files.
Main entry points: app.py API routes · app.js Browser interactions · sentiment_model.py Model training · index.html Dashboard page
Components 12
Browser dashboard
- Dashboard page
templates/index.html - Dashboard styling
static/css/style.css - Browser interactions
static/js/app.js
Flask application
- API routes
app.py - Batch analysis
app.py - Stats and history
app.py
Sentiment model
- Text tokenization
model/sentiment_model.py - Model training
model/sentiment_model.py - Sentiment prediction
model/sentiment_model.py
CSV persistence
- Training samples
data/sentiment_data.csv - Analysis history
data/analysis_history.csv
Other components
- Dashboard user
Connections 18
- Dashboard user → Browser interactions: submits text
README.txt - Dashboard page → Browser interactions: provides interface
README.txt - Dashboard styling → Dashboard page: styles
README.txt - Browser interactions → API routes: posts analysis
static/js/app.js - API routes → Dashboard page: renders
README.txt - API routes → Model training: trains at startup
app.py - Model training → Training samples: reads samples
- Model training → Text tokenization: tokenizes training text
model/sentiment_model.py - API routes → Sentiment prediction: predicts text
app.py - Sentiment prediction → Text tokenization: tokenizes input
model/sentiment_model.py - API routes → Analysis history: appends results
app.py - API routes → Batch analysis: dispatches batch request
app.py - Batch analysis → Sentiment prediction: predicts each text
app.py - Batch analysis → Analysis history: appends results
app.py - Browser interactions → Stats and history: fetches stats
static/js/app.js - Stats and history → Analysis history: reads records
app.py - Stats and history → Browser interactions: returns counts and history
static/js/app.js - API routes → Browser interactions: returns prediction
static/js/app.js