Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
In this step, we calculate the sentiment of each tweet. We create the new table tweets_sentiment
which
groups the tweets of l3
view on the basis of id, sums up the polarity of each word and assigns each
tweet a sentiment label such as positive, negative, or neutral.
Question-
What is the sentiment of tweet with id as 330043911940751360
?
Launch hive console by typing the hive
command in the web console.
hive
Create a tweets_sentiment
table. Each row of `tweets_sentiment table stores the sentiment of the tweet. Run below command in the Hive on your web console
create table tweets_sentiment stored as orc as select
id,
case
when sum( polarity ) > 0 then 'positive'
when sum( polarity ) < 0 then 'negative'
else 'neutral' end as sentiment
from l3 group by id;
Sample rows of tweets_sentiment
table are
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...