{"id":15066259,"url":"https://github.com/bhaskrr/megazine-subscription-sentiment-analyzer","last_synced_at":"2026-01-03T13:03:46.465Z","repository":{"id":255656742,"uuid":"853201520","full_name":"bhaskrr/megazine-subscription-sentiment-analyzer","owner":"bhaskrr","description":"This is the repository for the files required to host the developed model for sentiment analysis of amazon megazine subscriptions data","archived":false,"fork":false,"pushed_at":"2024-09-06T13:32:17.000Z","size":1229,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T14:45:14.527Z","etag":null,"topics":["deep-learning","natural-language-processing","sentiment-analysis","streamlit","tensorflow"],"latest_commit_sha":null,"homepage":"https://amazon-megazine-sentiment-analyzer.streamlit.app/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhaskrr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-06T07:27:23.000Z","updated_at":"2024-09-06T13:32:20.000Z","dependencies_parsed_at":"2024-09-06T15:38:35.296Z","dependency_job_id":"0aa6f2b8-b297-443a-95e1-a625a9e692ae","html_url":"https://github.com/bhaskrr/megazine-subscription-sentiment-analyzer","commit_stats":null,"previous_names":["bhaskrr/megazine-subscription-sentiment-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskrr%2Fmegazine-subscription-sentiment-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskrr%2Fmegazine-subscription-sentiment-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskrr%2Fmegazine-subscription-sentiment-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskrr%2Fmegazine-subscription-sentiment-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhaskrr","download_url":"https://codeload.github.com/bhaskrr/megazine-subscription-sentiment-analyzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814893,"owners_count":20352038,"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":["deep-learning","natural-language-processing","sentiment-analysis","streamlit","tensorflow"],"created_at":"2024-09-25T01:04:30.724Z","updated_at":"2026-01-03T13:03:46.414Z","avatar_url":"https://github.com/bhaskrr.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentiment Analysis of Amazon'23 Megazine Subscription dataset\n\nThis is an End-to-end machine learning project that uses the publicly available **Amazon'23** Megazine Subscriptions dataset to perform sentiment analysis. The dataset consists of `71,497` reviews and the corresponding numerical ratings.\n\n## Dataset\n\nClass distribution of the dataset is given by the following table:\n\n| Sentiment | Number of entries |\n| :-----: | :-----: |\n| Positive | 52826 |\n| Neutral | 5033 |\n| Negative | 13638 |\n\n### Bar chart representing class distribution of the dataset\n![](./sentiment.png)\n\nIn the above chart:\n- 0 represents `Negative`\n- 1 represents `Neutral`\n- 2 represents `Positive`\n\nDataset Link: https://amazon-reviews-2023.github.io/\n\n## Data Preprocessing\n\nThe dataset undergoes preprocessing to prepare it for the next steps. Preprocessing steps performed are:\n\n1. Lowercasing\n2. Whitespace stripping\n3. Removal of links\n4. Removal of brackets\n5. Removal of html tags\n6. Removal of digits\n7. Removal of punctuation\n8. Removal of multiple spaces\n9. Lemmatization\n\n## GloVe Word Embeddings\nGloVe stands for Global Vectors for Word Representation. It is an unsupervised learning algorithm for generating word embeddings, which are vector representations of words in a continuous space. It was developed by researchers at Stanford and is based on aggregating global word-word co-occurrence statistics from a large corpus.\n\nIn this project, **6B.100d** GloVe embeddings are utilized to convert text data into vector representations, which are then fed into the machine learning model. The embeddings help capture the semantic meaning of the text and improve the model's ability to understand the relationships between words.\n\n## Data Resampling\n\nThe dataset is highly imbalanced with almost **74%** of the entries belonging to the **Positive** sentiment category whereas **7%** and **19%** of the data belongs to the categories **Neutral** and **Negative** respectively.\n\nTo handle class imbalance, a resampling technique known as **Random Oversampling** is used.\n\nIn random oversampling, instances from the minority class are randomly selected and duplicated until the minority class has the same number of instances as the majority class. This effectively balances the class distribution by increasing the size of the minority class.\n\nClass distribution of the dataset after resampling is given by the following table:\n\n| Sentiment | Number of entries |\n| :-----: | :-----: |\n| Positive | 52826 |\n| Neutral | 52826 |\n| Negative | 52826 |\n\n## Data Splitting\nThe dataset was split into **train** and **test** sets with **80%** and **20%** of the data respectively.\n\n## Model\n\nThe **Gated Recurrent Unit** variant of Recurrent Neural Network is used in this project.\n\nThe model is trained for `50` epochs with `32` batch_size.\n\nThe **categorical_crossentropy** loss function is used along with **Adaptive Moment Estimation** optimizer.\n\nEarly stopping is used to prevent overfitting that monitors `val_loss` parameter with a patience of `5`. The performance of the model is evaluated in terms of `Accuracy`, `Precision`, `Recall` and `Loss`.\n\n## Results\n\nThe results produced by the model are:\n| Metric | Obtained Value |\n|:---:|:---:|\n|Accuracy| 90.33%|\n|Precision| 0.9091|\n|Recall| 0.8945|\n|Loss|0.3367|\n\n### Training and Validation accuracy curve with respect to epochs\n![](./accuracy.png)\n\n### Training and Validation loss curve with respect to epochs\n![](./loss.png)\n\n## Deployment\n\nThe trained model is deployed using [Streamlit](https://streamlit.io/) in [Streamlit community cloud](https://streamlit.io/cloud) platform.\n\nSee the live site [here](https://amazon-megazine-sentiment-analyzer.streamlit.app/).\n\n## Requirements\n\nTo run this project, the following dependencies are required:\n\n- Python 3.10.12\n- Numpy 1.26.4\n- Pandas 2.2.2\n- NLTK 3.9.1\n- TensorFlow 2.17.0\n- Keras 3.5.0\n- Scikit-Learn 1.5.1\n- Imbalanced-Learn 0.12.3\n- GloVe 6B.100d pretrained word embeddings\n- Streamlit 1.38.0\n\n\u0026copy; 2024 all rights reserved.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhaskrr%2Fmegazine-subscription-sentiment-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhaskrr%2Fmegazine-subscription-sentiment-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhaskrr%2Fmegazine-subscription-sentiment-analyzer/lists"}