YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)
Emotion Analysis with LSTM
This project implements an LSTM-based neural network for emotion analysis using the emotion_sentimen_dataset.csv.
Features
- Efficient Training: Uses a subset (20,000 samples) of the large dataset for faster experimentation while maintaining good accuracy.
- LSTM Architecture: Embedding -> SpatialDropout -> LSTM -> Dense.
- Deployment Ready: Includes scripts for training and real-time prediction.
Requirements
- Python 3.x
- TensorFlow / Keras
- Pandas, NumPy, Scikit-learn
Files
train_emotion_lstm.py: Script to preprocess data, build, train, and save the model.predict_emotion.py: Script to load the trained model and predict emotions from user input.emotion_model.h5: The saved trained model.tokenizer.pickle: Saved tokenizer for text processing.label_encoder_classes.npy: Saved label encoder classes.
Usage
1. Training
To train the model (if you want to re-train):
python train_emotion_lstm.py
This produces emotion_model.h5 and necessary artifacts.
2. Prediction
To use the model for prediction:
python predict_emotion.py
Type any sentence when prompted, and the model will classify its emotion.
Performance
The model achieves high accuracy (>90%) on the test set even with a reduced dataset size, demonstrating efficiency.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support