Twitter-Social-Analyzer

Twitter sentiment analyzer that obtains a list of tweets from a given topic and analyzes the sentiments about it. It also uses a Kivy GUI as an app interface.

View project on GitHub

Twitter module

class twitter.TwitterAnalyzer

Bases: object

Twitter Sentiment Analyzer that contains a tweepy API. It can search most popular tweets, get subjectivity, polarity and a resume about any topic given.

analyze(topic: str, num_items: int, lang: str)

       Takes a topic, a number of tweets and language. Obtains n most recent tweets, applies NLP, generates a word cloud, computes subjectivity and polarity and creates several plots.

clean_txt(tweet: str)

       Takes a tweet text. Returns the tweet text without any mention, hashtag, RT or link.

get_analysis(score: float))

       Takes a score from a tweet. Returns the analysis (positive, negative or neutral).

get_lexical_tokens(tweet: str)

       Takes a tweet text. Returns just the lexical tokens.

get_polarity(tweet: str)

       Takes a tweet text. Returns the polarity.

get_popular_tweets(topic: str)

       Takes a topic. Returns the 3 most popular tweets about that topic.

get_resume()

       Returns the value counts and percentages of the tweets analysis.

get_subjectivity(tweet: str)

       Takes a tweet text. Returns the subjectivity.

get_tweets(topic: str, num_items: int)

       Takes a topic and a number of tweets. Returns the n most recent tweets about that topic.

print_popular_tweet(topic: str, num_items: int)

       Takes a topic and a number of tweets. Prints the n most popular tweets about the topic.

< Previous Next >