How adi-s28/machine_learning_project works
This is a Streamlit sentiment-analysis app with account/guest access, text classification, per-user result history, and sentiment-count visualization. The main workflow in app.py is: a user selects a page, submits text, the app predicts sentiment, stores the result, and displays history or metrics. streamlit_app.py provides a second, function-based implementation with its own data-loading and training flow. The excerpts omit parts of app.py’s model setup, so detailed preprocessing and dataset wiring are shown only where supported.
Main entry points: app.py Main app · streamlit_app.py Alternate app · users.db SQLite database
Components 14
Streamlit interface
- Main app
app.py - Alternate app
streamlit_app.py - Login and signup
app.py - Analysis page
app.py - Metrics page
app.py
Accounts and sessions
- User authentication
app.py - Session state
app.py
Sentiment analysis
- Sentiment analyzer
app.py - TF-IDF and Naive Bayes
app.py - Data loading and split
streamlit_app.py - Training and prediction
streamlit_app.py
Results and storage
- Database handler
app.py - SQLite database
users.db
Other components
- User
Connections 19
- User → Main app: uses
- Main app → Login and signup: routes pages
- Main app → Analysis page: routes pages
- Main app → Metrics page: routes pages
- Main app → User authentication: creates
- Main app → Sentiment analyzer: creates
- Main app → Database handler: creates
- Login and signup → User authentication: authenticates
- User authentication → Database handler: reads and writes
- User authentication → Session state: updates
- Analysis page → Sentiment analyzer: predicts sentiment
- Sentiment analyzer → TF-IDF and Naive Bayes: vectorizes and classifies
- Analysis page → Database handler: stores and reads
- Metrics page → Database handler: loads counts
- Database handler → SQLite database: queries and updates
- User → Alternate app: uses alternative
- Alternate app → Data loading and split: loads and splits
- Data loading and split → Training and prediction: provides training data
- Alternate app → Training and prediction: trains and predicts