You are on page 1of 2

Algorithm: Extracting Sentiments on Twitter Posts

Input: Tweets posted by the users.

Output: Classifying Negative and Positive Sentiments from Large pool of tweets.

Step 1: Procedure Tweet_Connection()

tweet_id: ‘-----‘

tweet_name: ‘-----‘

username: ‘-----‘

tweet_content: ‘-----‘

access_token: ‘-----‘

encryption_key: ‘-----‘

end Procedure

Step 2: Procedure Extracting_Tweet(tweet_id)

tweet_id: ‘-----‘

tweet_content: ‘-----‘

end Procedure

Step 3: Procedure Tweet_Search_Keyword(key)

keyword: positive || negative

if(tweet_content==keyword)

keyword found

else

keyword not_found

}
end Procedure

Step 4: Procedure Classification_Tweets(tweet)

tweet = Extracting_Tweet(tweet_id)

tweet= Tweet_Search_Keyword(key)

tweet_polarity=tweet.sentiment_polarity

if(tweet_poarity==positive)

positive tweet

else

negative tweet

end Procedure

Step 5: Procedure Fetch_Tweet(tweet_id)

fetched_tweet= search(sql_query)

end Procedure

You might also like