0% found this document useful (0 votes)
28 views2 pages

Algorithm: Extracting Sentiments On Twitter Posts

The document describes an algorithm to classify tweets as positive or negative sentiments. It contains 5 steps: 1) Connect to tweets, 2) Extract tweet content, 3) Search tweets for keywords, 4) Determine polarity and classify tweets as positive or negative, 5) Fetch tweets from a database by ID. The algorithm takes tweets as input and outputs their classified sentiment.

Uploaded by

Sandesh Ramesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Algorithm: Extracting Sentiments On Twitter Posts

The document describes an algorithm to classify tweets as positive or negative sentiments. It contains 5 steps: 1) Connect to tweets, 2) Extract tweet content, 3) Search tweets for keywords, 4) Determine polarity and classify tweets as positive or negative, 5) Fetch tweets from a database by ID. The algorithm takes tweets as input and outputs their classified sentiment.

Uploaded by

Sandesh Ramesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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