Sentiment and Emoji Analysis through Twitter API: American Airlines vs. United Airlines
How do people feel about United Airlines and American Airlines when they tweeting about them?
Are tweets with emojis happier or angrier than those without?
Top Emotional Emojis in Tweets Mentioning AA & UA
Emoji Analysis
Emoji Analysis
United Airlines and American Airlines are the
two largest air carriers in the U.S. considering both domestic and
international flight operations. Recently, there are news reporting negative
incidents regarding customer service of both air carriers. I am wondering what twitter users’ experience
with these two airlines are. Are they happy or angry about the two air lines in
general? Do they like AA over UA or the other way around? Are they use Emojis
to help them express their feelings?
To answer these questions, I conduct a sentiment analysis and emoji analysis through Twitter API streaming.
METHOD
1. Use Twitter streaming API to obtain real time tweets related to United Airlines and American Airlines
- Instead of just searching tweets with tags of the two airlines, I included four search parameters, for example: “American Airlines”, “AA”, “#AmericanAirlines”, “#AA”.
- In the end, I got in total of 12126 tweets.
2. Filter tweets
- Since I want cleaner Emoji data, I filter tweets based on the retweet count. I did not exclude all retweets because sometimes we retweet our friends’ twitter to express similar feeling or support them. Therefore, I filter the tweets based on a criterion that the retweet count is less than 10.
- For easier comparison between tweets mentioning AA and UA, I make sure that the total number of filtered tweets mentioning AA is the same as the filtered ones mentioning UA.
3. Match tweet texts with emoji based on emoji encodings in Twitter
4. Find out the tweets with emojis and those without
5. Plot top 15 emotional emojis in tweets mentioning AA and UA, and plot emotional emojis used in both tweets mentioning AA and UA for comparison
- From the list of emojis used in AA tweets and UA tweets, I manually select out 15 emojis expressing emotions, from high to low frequency count
- When I say emojis expressing emotions, I mean those emojis containing facial expressions, or some emojis like thumbs up, ok hand sign or clapping hand
The results of step 5 are shown above and below.
To answer these questions, I conduct a sentiment analysis and emoji analysis through Twitter API streaming.
METHOD
1. Use Twitter streaming API to obtain real time tweets related to United Airlines and American Airlines
- Instead of just searching tweets with tags of the two airlines, I included four search parameters, for example: “American Airlines”, “AA”, “#AmericanAirlines”, “#AA”.
- In the end, I got in total of 12126 tweets.
2. Filter tweets
- Since I want cleaner Emoji data, I filter tweets based on the retweet count. I did not exclude all retweets because sometimes we retweet our friends’ twitter to express similar feeling or support them. Therefore, I filter the tweets based on a criterion that the retweet count is less than 10.
- For easier comparison between tweets mentioning AA and UA, I make sure that the total number of filtered tweets mentioning AA is the same as the filtered ones mentioning UA.
3. Match tweet texts with emoji based on emoji encodings in Twitter
4. Find out the tweets with emojis and those without
5. Plot top 15 emotional emojis in tweets mentioning AA and UA, and plot emotional emojis used in both tweets mentioning AA and UA for comparison
- From the list of emojis used in AA tweets and UA tweets, I manually select out 15 emojis expressing emotions, from high to low frequency count
- When I say emojis expressing emotions, I mean those emojis containing facial expressions, or some emojis like thumbs up, ok hand sign or clapping hand
The results of step 5 are shown above and below.
Emotional Emojis in Both Tweets Mentioning AA & UA
Emoji Analysis
Emoji Analysis
6. Conduct Sentiment Analysis
There are two parts in the sentiment analysis: air carrier comparison and emojis comparison
- For air carrier comparison, I calculate the sentiment scores for UA tweets and AA tweets using NRC method, and then visualize the scores in bar plots
- For emojis comparison, I first separate all tweets, including UA and AA tweets, into two parts: tweets with and tweets without emojis. Then I repeat the score calculation process and create a bar plot visualizing NRC sentiment scores for tweets containing emojis and those without emojis.
There are two parts in the sentiment analysis: air carrier comparison and emojis comparison
- For air carrier comparison, I calculate the sentiment scores for UA tweets and AA tweets using NRC method, and then visualize the scores in bar plots
- For emojis comparison, I first separate all tweets, including UA and AA tweets, into two parts: tweets with and tweets without emojis. Then I repeat the score calculation process and create a bar plot visualizing NRC sentiment scores for tweets containing emojis and those without emojis.
NRC Sentiment Scores
Comparison between tweets
mentioning AA & UA
Comparison between tweets
mentioning AA & UA
INTERPRETATION
From the emotional emojis bar plots, we can say that twitter users have mixed feelings about both AA and UA, and it is hard to say which air carrier they prefer based solely on the emojis they use when tweeting about UA and AA.
In terms of NRC sentiment score, while UA has prominently higher score compared to AA in “positive” and “trust” categories, it scores higher than UA in all negative categories as well. We can conclude that tweeters have more mixed feelings about UA. They love it and hate it at the same time.
From the emotional emojis bar plots, we can say that twitter users have mixed feelings about both AA and UA, and it is hard to say which air carrier they prefer based solely on the emojis they use when tweeting about UA and AA.
In terms of NRC sentiment score, while UA has prominently higher score compared to AA in “positive” and “trust” categories, it scores higher than UA in all negative categories as well. We can conclude that tweeters have more mixed feelings about UA. They love it and hate it at the same time.
NRC Sentiment Scores
Comparison between tweets
with and without Emojis
Comparison between tweets
with and without Emojis
The
sentiment scores are similar for tweets with and without emojis. However, from
“fear”, ”sadness”, “negative” categories, we can see higher scores for tweets
without emojis. Therefore, it is safe to say that tweeters prefer to
used emojis to emphasize their positive feelings and tend not to use emojis
when they want to express negative feelings about the air carriers.