{"id":19273180,"url":"https://github.com/ahasannn/multilevel_textual_emotion_classifier","last_synced_at":"2026-05-05T09:31:24.644Z","repository":{"id":174075574,"uuid":"563925818","full_name":"Ahasannn/Multilevel_Textual_Emotion_Classifier","owner":"Ahasannn","description":"Emotion detection from social media texts using machine learning algorithms.","archived":false,"fork":false,"pushed_at":"2022-11-13T08:37:43.000Z","size":4689,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-09T16:53:13.638Z","etag":null,"topics":["anaconda","jupyter","machine-learning","matplotlib","nltk","numpy","pandas","pip","python","scikit-multilearn","scikitlearn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ahasannn.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":"2022-11-09T16:15:01.000Z","updated_at":"2024-05-16T05:44:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"9cf7a2d4-dbb3-437f-8a6d-2cd1ddb29f25","html_url":"https://github.com/Ahasannn/Multilevel_Textual_Emotion_Classifier","commit_stats":null,"previous_names":["ahasannn/multilevel_textual_emotion_classifier"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ahasannn/Multilevel_Textual_Emotion_Classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahasannn%2FMultilevel_Textual_Emotion_Classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahasannn%2FMultilevel_Textual_Emotion_Classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahasannn%2FMultilevel_Textual_Emotion_Classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahasannn%2FMultilevel_Textual_Emotion_Classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ahasannn","download_url":"https://codeload.github.com/Ahasannn/Multilevel_Textual_Emotion_Classifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahasannn%2FMultilevel_Textual_Emotion_Classifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["anaconda","jupyter","machine-learning","matplotlib","nltk","numpy","pandas","pip","python","scikit-multilearn","scikitlearn"],"created_at":"2024-11-09T20:41:19.891Z","updated_at":"2026-05-05T09:31:24.626Z","avatar_url":"https://github.com/Ahasannn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multilevel Textual Emotion Classifier\n\nMulti-Label Textual Emotion Classification of Social Media Contents using Machine Learning Algorithms implemented with python.\n\n\u003chr/\u003e\n\n# Description\n\nIn this project, we have classified emotions from texts. Emotions considered in this work are Joy, Sadness, Anger, Disgust, Admiration, Surprise, Interest, Fear. We have collected our text data from twitter. We have used two algorithm adaptations methods to work with multiple labels. One is Multi-label K nearest neighbors (MLkNN) and another one combines approaches from both Binary Relevance and K-Nearest neighbor (BRkNN).\n\n## MLkNN\n\n* Adapts K nearest neighbor algorithm to work with multiple labels\n* Uses Maximum a posteriori (MAP) principal to determine labels for unidentified data\n* MAP is based on the information from nearest neighbors\n\n## BRkNN\n\n* Combines approaches from binary relevance and k nearest neighbors \n* Has two extensions BRkNN-a \u0026 BRkNN-b\n* BRkNN-a outputs labels present in half of the nearest neighbors\n* BRkNN-b outputs first k labels with highest confidence value, where k is label density rounded to nearest integer\n\n\n\n\u003chr/\u003e\n\n# Outline of Methodology\n\n![Outline_of_Methodology](Images/Outline_of_Methodology.png)\n\n\u003chr/\u003e\n\n# Multi-Label Emotion Classifier Framework\n\n![Outline_of_Methodology](Images/Multi-Label_Emotion_Classifier_Framework.png)\n\n\u003chr/\u003e\n\n# Dataset Description \n\n* Tweets selected from Sentiment140 dataset\n* Tweets were labeled according to emotions (Joy, Sadness, Anger, Disgust, Admiration, Surprise, Interest, Fear)\n* Total number of tweets 8501\n* Label Cardinality 1.5\n* Label Density 0.1875\n\n## Emotion Distribution in the dataset\n\n| Emotion      | No. of Tweets |\n| ----------- | ----------- |\n| Joy     | 2406    |\n| Sadness  | 4126     |\n| Anger    | 989   |\n| Disgust  | 1380    |\n| Admiration   | 578    |\n| Surprise  | 624     |\n| Interest   | 2134   |\n| Fear  | 674    |\n\n\u003chr/\u003e\n\n# Experimental Results\n\n| Evaluation Metric      | MLkNN | BRkNN-a | BRkNN-b |\n| ----------- | ----------- | ------ | ------ |\n|  Hamming Loss |  0.169   | 0.17 | 0.255 |\n|  0/1 Subset Loss |  0.202   | 0.169 | 0.094 |\n|  Macro F-Score |  0.887   | 0.891 | 0.821 |\n|  Mircro F-Score |  0.901   | 0.902 | 0.843 |\n|  Average Accuracy |  0.83   | 0.829 | 0.744 |\n\n\u003chr/\u003e\n\n# Software Requirements\n\nThe software environment used to execute the system is given below:\n\n* Microsoft Windows 10 (OS Build 19042.928)\n* python =\u003e 3.8.5\n* anaconda =\u003e 2020.11\n* pip =\u003e 20.2.4\n* jupyter =\u003e 1.0.0\n* numpy =\u003e 1.19.2\n* pandas =\u003e 1.1.3\n* matplotlib =\u003e 3.3.2\n* nltk =\u003e 3.5\n* scikit-learn =\u003e 0.23.2\n* scikit-multilearn =\u003e 0.2.0\n\nAlthough the system was run in an windows environment, with the proper packages present, this can be run in other operating systems too. The dependencies\nof the given packages are also needed to be installed for this to work properly.\nAll the packages aren’t needed at once to run the system.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahasannn%2Fmultilevel_textual_emotion_classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahasannn%2Fmultilevel_textual_emotion_classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahasannn%2Fmultilevel_textual_emotion_classifier/lists"}