How yash-030/sentimental_analysis works
This Flask application accepts restaurant reviews in a web form and returns a positive/negative prediction. Its core runtime path is the POST handler calling sentiment prediction, which preprocesses the review, loads the saved TF-IDF vectorizer and Logistic Regression model, and predicts a label. A separate training path reads and preprocesses Reviews.csv and saves the fitted model. The README documents the form workflow; source excerpts establish the handler and model operations, but the HTML template itself was not sampled.
Main entry points: sentiment_analysis.py Model training · app.py Flask routes · index.html Review form · model.pkl Saved classifier
Components 8
Web interface
- Review form
templates/index.html - Flask routes
app.py
Sentiment analysis
- Sentiment prediction
sentiment_analysis.py - Text preprocessing
sentiment_analysis.py - Saved classifier
model.pkl
Model training
- Model training
sentiment_analysis.py - Review dataset
Reviews.csv
Other components
- Review submitter
Connections 9
- Review submitter → Review form: enters review
README.md - Review form → Flask routes: submits review
README.md - Flask routes → Review form: renders result
app.py - Flask routes → Sentiment prediction: calls prediction
app.py - Sentiment prediction → Text preprocessing: preprocesses text
sentiment_analysis.py - Sentiment prediction → Saved classifier: loads classifier
sentiment_analysis.py - Model training → Review dataset: reads reviews
sentiment_analysis.py - Model training → Text preprocessing: preprocesses reviews
sentiment_analysis.py - Model training → Saved classifier: saves classifier
sentiment_analysis.py