{"id":29516193,"url":"https://github.com/anthonyray/sentiment-analysis","last_synced_at":"2025-07-16T14:42:04.600Z","repository":{"id":33766517,"uuid":"37422286","full_name":"anthonyray/sentiment-analysis","owner":"anthonyray","description":"Sentiment Analysis Algorithms for tweets","archived":false,"fork":false,"pushed_at":"2017-05-05T09:07:50.000Z","size":13,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-15T09:15:25.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/anthonyray.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}},"created_at":"2015-06-14T17:30:00.000Z","updated_at":"2022-02-18T16:11:45.000Z","dependencies_parsed_at":"2022-09-08T17:40:20.358Z","dependency_job_id":null,"html_url":"https://github.com/anthonyray/sentiment-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anthonyray/sentiment-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyray%2Fsentiment-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyray%2Fsentiment-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyray%2Fsentiment-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyray%2Fsentiment-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonyray","download_url":"https://codeload.github.com/anthonyray/sentiment-analysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyray%2Fsentiment-analysis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265518946,"owners_count":23781050,"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":[],"created_at":"2025-07-16T14:41:56.461Z","updated_at":"2025-07-16T14:42:04.587Z","avatar_url":"https://github.com/anthonyray.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tweets Sentiment Analysis\n\nSentiment analysis on Twitter data has attracted much attention recently. This program is a simple implementation of a sentiment classifier for a tweet. \n\nBased on the *sentiwordnet* corpus, the classifier can distinguish if a tweet is **Positive**, **Negative**, or **Objective**. \n\n## Usage \n\n- To see answers to the TP :  ```python tp.py```\n- To see the results of the classification using the first version of the algorithm : ```python tpv1.py```\n- To see the results of the classification using the second version of the algorithm :  ```python tpv2.py```\n- - To see the results of the classification using the third version of the algorithm :  ```python tpv3.py```\n\n## Requirements \n\nYou need the following libs : \n- sklearn\n- nltk\n- numpy\n\n## Processing pipeline\n\nThe processing pipeline for every tweet is the following : \n\n### Algorithm v1\n\n- Tweet preprocessing : removal of twitter-specific characters ( mentions : @, hashtags : #, retweets : RT)\n- POS tagging : assign every word to its POS tag (Part Of Speech Tag)\n- SentiSynset : For words such as adjective, words, nouns, and adverb, find the first sentisynset in the sentiwordnet corpus\n- Assign a score for the tweet by aggregating every individual score from the sentisynsets\n- Classify the tweet\n\n### Algorithm v2 : taking negation and modifiers into account\n\n- Tweet preprocessing : removal of twitter-specific characters ( mentions : @, hashtags : #, retweets : RT)\n- POS tagging : assign every word to its POS tag (Part Of Speech Tag)\n- SentiSynset : For words such as adjective, words, nouns, and adverb, find the first sentisynset in the sentiwordnet corpus\n- Assign a score for the tweet by aggregating every individual score from the sentisynsets\n- Modify the score to take care of negations and modifiers\n- Classify the tweet\n\n### Algorithm v3 : taking emojis into account\n\n- Tweet preprocessing : removal of twitter-specific characters ( mentions : @, hashtags : #, retweets : RT)\n- POS tagging : assign every word to its POS tag (Part Of Speech Tag)\n- SentiSynset : For words such as adjective, words, nouns, and adverb, find the first sentisynset in the sentiwordnet corpus\n- Assign a score for the tweet by aggregating every individual score from the sentisynsets\n- Modify the score to take care of negations and modifiers\n- Increase the positive or negative score by taking care of emojis\n- Classify the tweet\n\n# Classify tweets\n```\npython tpv1.py\n```\n\n```\npython tpv2.py\n```\n\n```\npython tpv3.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonyray%2Fsentiment-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonyray%2Fsentiment-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonyray%2Fsentiment-analysis/lists"}