This project implements a Sentiment Analysis system using Recurrent Neural Networks (RNN) to classify text into positive or negative sentiment.
The model learns contextual relationships in text using sequence modeling techniques, making it effective for Natural Language Processing (NLP) tasks.
- Text dataset (IMDb / custom dataset)
- Binary classification:
- Positive sentiment
- Negative sentiment
The model uses RNN (LSTM/GRU) architecture:
- Embedding Layer → Converts words into dense vectors
- RNN Layer → Captures sequential dependencies
- Fully Connected Layer → Produces output
- Sigmoid Activation → Binary classification
👉 RNN models are effective because they can capture dependencies between words in a sequence, making them suitable for text analysis :contentReference[oaicite:0]{index=0}
- Python
- PyTorch
- NumPy
- Matplotlib
- NLP Techniques
- Data Cleaning (remove special characters, lowercase)
- Tokenization
- Sequence Padding
- Model Building (Embedding + RNN)
- Model Training
- Evaluation & Prediction
- Accuracy
- Precision
- Recall
- Loss
| Metric | Value |
|---|---|
| Accuracy | ~85–90% |
| Loss | Reduced over epochs |
- Input: "This movie was amazing!" → ✅ Positive
- Input: "Worst experience ever." → ❌ Negative
- End-to-end NLP pipeline
- RNN-based sequence modeling
- Embedding-based text representation
- Real-time sentiment prediction
📦 RNN-Sentiment-Analysis
┣ 📂 data
┣ 📂 img
┣ 📂 model
┣ 📜 main.ipynb
┗ 📜 README.md
- RNN & LSTM architecture understanding
- Text preprocessing and tokenization
- Sequence modeling for NLP
- Model evaluation and tuning
- Bidirectional LSTM
- Attention mechanism
- FastAPI deployment
- Streamlit UI

