{"id":24835670,"url":"https://github.com/narendraysf/lstmemotion-sentiment-analytics","last_synced_at":"2025-04-12T08:21:44.947Z","repository":{"id":274413074,"uuid":"922819728","full_name":"NarendraYSF/LSTMEmotion-Sentiment-Analytics","owner":"NarendraYSF","description":"An LSTM-based sentiment analysis model for classifying text emotions. Built with deep learning techniques to accurately detect and predict sentiment in text data.","archived":false,"fork":false,"pushed_at":"2025-02-17T18:23:43.000Z","size":10532,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T03:30:34.496Z","etag":null,"topics":["ai","emotion-detection-emotion-classification","jupyter-notebook","keras","lstm-sentiment-analysis","recurrent-neural-networks","social-media-analysis","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NarendraYSF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-27T06:02:28.000Z","updated_at":"2025-03-17T11:39:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f7bcaf9-fbc2-4287-ae4b-2e77f3a6f825","html_url":"https://github.com/NarendraYSF/LSTMEmotion-Sentiment-Analytics","commit_stats":null,"previous_names":["narendraysf/lstmemotion-sentiment-analytics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NarendraYSF%2FLSTMEmotion-Sentiment-Analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NarendraYSF%2FLSTMEmotion-Sentiment-Analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NarendraYSF%2FLSTMEmotion-Sentiment-Analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NarendraYSF%2FLSTMEmotion-Sentiment-Analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NarendraYSF","download_url":"https://codeload.github.com/NarendraYSF/LSTMEmotion-Sentiment-Analytics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537302,"owners_count":21120729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","emotion-detection-emotion-classification","jupyter-notebook","keras","lstm-sentiment-analysis","recurrent-neural-networks","social-media-analysis","tensorflow"],"created_at":"2025-01-31T04:51:11.668Z","updated_at":"2025-04-12T08:21:44.925Z","avatar_url":"https://github.com/NarendraYSF.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentiment Analysis on Movie Reviews  \n\n## Project Overview  \nThis project implements a sentiment analysis model using Long Short-Term Memory (LSTM) networks to classify IMDB movie reviews as positive or negative. The model leverages deep learning techniques for text analysis, providing a robust solution to evaluate user sentiments.  \n\n## Features  \n- Binary classification of movie reviews (positive or negative).  \n- Preprocessing pipeline with tokenization and padding for textual data.  \n- LSTM-based architecture for sequential data learning.  \n- A user-friendly function for real-time sentiment predictions.  \n\n---\n\n## Technologies Used  \n- **Programming Language:** Python  \n- **Libraries:**  \n  - TensorFlow/Keras  \n  - Pandas  \n  - Scikit-learn  \n- **Tools:** Kaggle API for dataset retrieval  \n\n---\n\n## Dataset  \n- **Source:** IMDB Dataset of 50K Movie Reviews  \n- **Access:** Downloaded via Kaggle API.  \n- **Structure:** Includes 50,000 movie reviews labeled as \"positive\" or \"negative.\"  \n\n---\n\n## Workflow  \n\n### 1. Dataset Handling  \n- **Download:** Use the Kaggle API to fetch the dataset.  \n- **Extraction:** Extract the CSV file from the zip archive.  \n\n### 2. Data Preprocessing  \n- Load the dataset using Pandas.  \n- Convert sentiment labels into numerical values (`positive: 1`, `negative: 0`).  \n\n### 3. Train-Test Split  \n- Split the data into 80% training and 20% testing subsets.  \n\n### 4. Tokenization and Padding  \n- Tokenize text to convert words into sequences of integers.  \n- Apply padding to ensure consistent sequence lengths for the LSTM model.  \n\n### 5. Model Architecture  \nThe LSTM model consists of:  \n- **Embedding Layer:** Converts word indices to dense vectors.  \n- **LSTM Layer:** Processes sequential data for sentiment classification.  \n- **Dense Output Layer:** Sigmoid activation for binary classification.  \n\n### 6. Model Training  \n- Trained for 5 epochs with a batch size of 64.  \n- Validation split: 20% of the training data.  \n\n### 7. Model Evaluation  \n- Evaluate the trained model on the test dataset.  \n- Metrics: Accuracy and binary cross-entropy loss.  \n\n### 8. Sentiment Prediction  \n- Implement a function to classify the sentiment of user-provided reviews.  \n\n---\n\n## Results  \n- The LSTM model achieved significant accuracy on the test data.  \n- Example Predictions:  \n  - **Input:** \"This movie was not so interesting.\" -\u003e **Prediction:** Negative  \n  - **Input:** \"This movie was very amazing.\" -\u003e **Prediction:** Positive  \n\n---\n\n## How to Run  \n\n1. Clone this repository:  \n   ```bash\n   git clone https://github.com/NarendraYSF/LSTMEmotion-Sentiment-Analytics.git\n   ```  \n\n2. Install the required dependencies:  \n   ```bash\n   pip install -r requirements.txt\n   ```  \n\n3. Run the Jupyter Notebook to train, evaluate, and test the model.  \n\n---\n\n## Future Scope  \n- **Expand Dataset:** Include more diverse reviews to improve generalization.  \n- **Optimize Hyperparameters:** Experiment with different learning rates, batch sizes, and epoch counts.  \n- **Alternative Architectures:** Explore GRU, Transformer-based models (e.g., BERT).  \n- **Deploy:** Build a web or API interface for real-time predictions.  \n\n---\n\n## License  \nThis project is licensed under the [GNU General Public License](https://opensource.org/licenses/GPL-3.0).  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarendraysf%2Flstmemotion-sentiment-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarendraysf%2Flstmemotion-sentiment-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarendraysf%2Flstmemotion-sentiment-analytics/lists"}