{"id":26664865,"url":"https://github.com/shahules786/twitter-sentiment","last_synced_at":"2025-07-02T02:07:15.470Z","repository":{"id":37738521,"uuid":"298178643","full_name":"shahules786/Twitter-Sentiment","owner":"shahules786","description":"Sentiment analyzer for your tweets.","archived":false,"fork":false,"pushed_at":"2020-10-29T15:24:18.000Z","size":3579,"stargazers_count":63,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T02:07:13.858Z","etag":null,"topics":["embedding-vectors","natural-language-processing","pytorch","sentiment-analyzer","twitter-domain"],"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/shahules786.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"shahules786","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-09-24T05:34:39.000Z","updated_at":"2024-07-20T17:22:17.000Z","dependencies_parsed_at":"2022-08-24T16:21:42.135Z","dependency_job_id":null,"html_url":"https://github.com/shahules786/Twitter-Sentiment","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/shahules786/Twitter-Sentiment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahules786%2FTwitter-Sentiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahules786%2FTwitter-Sentiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahules786%2FTwitter-Sentiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahules786%2FTwitter-Sentiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahules786","download_url":"https://codeload.github.com/shahules786/Twitter-Sentiment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahules786%2FTwitter-Sentiment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263061405,"owners_count":23407606,"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":["embedding-vectors","natural-language-processing","pytorch","sentiment-analyzer","twitter-domain"],"created_at":"2025-03-25T16:46:37.090Z","updated_at":"2025-07-02T02:07:15.448Z","avatar_url":"https://github.com/shahules786.png","language":"Python","funding_links":["https://patreon.com/shahules786"],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/github/issues/shahules786/Twitter-Sentiment)]()\n[![](https://img.shields.io/github/license/shahules786/Twitter-Sentiment)]()\n[![](https://img.shields.io/github/stars/shahules786/Twitter-Sentiment)]()\n\n\n# Twitter Sentiment analyzer\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/25312635/95116850-4d01ff80-0765-11eb-887d-c3fbcf3797d0.png\" /\u003e\n\u003c/p\u003e\n\n\nSentiment analysis is the task of determining the sentiment of a given expression in natural language, It is essentially a multiclass text classification text where the given input text is classified into positive, neutral, or negative sentiment. But the number of classes can vary according to the nature of the training dataset. This project aims to build a sentiment analyzer specifically for twitter domain.\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/25312635/94103308-f1c13a80-fe51-11ea-819e-def5948c479f.png\" width=\"50%\" /\u003e\n\u003c/p\u003e\n\n## Why a Custom model for twitter domain?\n\nSimply put, a Tweet is a message sent on Twitter. Most of the tweets do not follow normal English grammar and vocabulary mainly due to the limitation of the number of characters allowed in a tweet. This requires special care to yield better performance, hence this project.\n\n**Want to build a similar project? Read my [article](https://shahules786.medium.com/sentiment-analysis-build-your-nlp-project-d41257d06c8c) to find out how I build twittersentimt.**\n\n## Install\n`!pip install twittersentiment`\n\n## Examples\n\n- **Using pretrained model**\n\n```python\nfrom twittersentiment import TwitterSentiment\nsent = TwitterSentiment.Sentiment()\nsent.load_pretrained()\nsent.predict(\"hey how are you?\")\n```\n\n![basic](https://user-images.githubusercontent.com/25312635/96710969-71dbb100-13ba-11eb-9756-651384688a8b.gif)\n\n\n- **You can train your own model with custom dataset and your choice of word embedding**\n\n\n```python\nfrom twittersentiment import TwitterSentiment\nimport pandas as pd\ndf = pd.read_csv(\"your_dataset.csv\")\nsent = TwitterSentiment.Sentiment()\nsent.train(df[\"text\"],df[\"target\"],path=\"/your_model_save_path\",name=\"6B\",dim=100)\nsent.train(\"hey you just trained a custom model\")\n\n```\n\n\n\n see [examples](https://github.com/shahules786/Twitter-Sentiment/blob/master/examples/basic.ipynb) for more.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahules786%2Ftwitter-sentiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahules786%2Ftwitter-sentiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahules786%2Ftwitter-sentiment/lists"}