This project trains a Logistic Regression classifier to detect emotions in text and provides a simple web demo using Streamlit.
-
Install the requirements:
pip install -r requirements.txt
-
Download the spaCy language model (required before running
train_model.pyor the Streamlit demo):python -m spacy download en_core_web_sm
-
Train the model (this creates
best_model.pkl):python train_model.py
model.predict()will raise an error if this file is missing, so be sure to run the training script before using the app or the library functions. -
Run the demo app:
streamlit run app.py
The training data is provided in text_emotions.csv.