Skip to content

Using Twitter Developer API build a Sentiment Analyzer to give check if the emotions of users regarding the topics are positive, negative or neutral using their tweets by method of tokenization and Bag of Words algorithm.πŸŽ­πŸ”Šβš–πŸ“³πŸ™‚πŸ˜β˜Ή

Notifications You must be signed in to change notification settings

ShrishtiHore/Twitter_Sentiment_Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Twitter_Sentiment_Analysis

  • Twitter is a big storehouse of human emotions and how people react to situations every second. This emotional data can be used for sentiment analysis.
  • We use the process of tokenization ie; by dividing th received tweet into different parts.
  • By the algorithm called as Bag of Words model we count the no. of times a word has been repeated in a tweet and the appraoch to this program is Lexicon Based.
  • We use Twitter Developer and make an account in twitter api then we get 4 tokens 2 Consumer API keys and 2 Access token & access token secret as the two main keys for the same.
  • We use the twitter api system connect it to the sentiment analyzer and use it in the script.
  • The to main libraries in this program are tweepy and textblob.
  • In the end we get to factors to measure polarity means emotions expressed in a sentence eg:emotional negative (-2), rational negative (-1), neutral (0), rational positive (+1), and emotional positive (+2) and subjectivity means personal feeling, views or beliefs.

Code and Resources Used

Language: Python 3.8

Libraries and Modules: Tweepy, textblob, pandas

Dataset: Twitter Developer API

Keywords: sentiment analysis, twitter, nlp

Step 1: Import all required modules and libraries

Step 2: Insert you consumer key, consumer secret, access token and access token secret from your twitter developer account. Authorize them. Import your twitter api to code.

Step 3: Define which sentiments represent what words and their alternatives.

Step 4: Using textblob define polarity of sentiment in dictionary.

Step 5: Test the analyzer and export the result in a csv format.

Results

sentiment

tweet

References

  1. https://github.com/rishavinvincible/Siraj-Raval-
  2. https://www.youtube.com/watch?v=o_OZdbCzHUA
  3. https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqa3hWUlIyU1lLSnN2V2tvWEFUVmFxLUR0Slk1Z3xBQ3Jtc0tsS3l5YjdsOUpsaktUNV9kcmFoSHI2bWdHTXAtQWI2dEREeVFsaXl2VkhpNTNhT01ScE9vb0gwWFNLSGE1SDJycjV0RUE0dlJhYzJvaUlwNFdEMWZMZ09SdGxyeEhqel9IVlkwTUZnYkJJNmNVMVhBZw&q=https%3A%2F%2Fgithub.com%2FllSourcell%2Ftwitter_sentiment_challenge

About

Using Twitter Developer API build a Sentiment Analyzer to give check if the emotions of users regarding the topics are positive, negative or neutral using their tweets by method of tokenization and Bag of Words algorithm.πŸŽ­πŸ”Šβš–πŸ“³πŸ™‚πŸ˜β˜Ή

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages