Chinese smartphone brands suffer negative sentiment on Twitter amid India’s “boycott China” outrage

Chinese smartphone brands suffer negative sentiment on Twitter amid India’s “boycott China” outrageRuby YeBlockedUnblockFollowFollowingMar 14The Chinese smartphone brand Oppo suffered the most negative sentiment on Twitter among the world’s top mobile companies on Thursday, as Indian Twitter users are boycotting Chinese products.

After China blocked UN’s move to designate Jaish-e-Mohammad chief Masood Azhar as a global terrorist, India social media users started boycotting Chinese goods as a message to China.

As the sponsor of the Board of Control for Cricket in India(BCCI), the national governing body for cricket in India, Oppo became one of the most unwelcomed Chinese brands in India.

Many Indian Twitter users were requesting BCCI to remove Oppo as the sponsor.

The outrage had a strong impact on Twitter data.

Twitter sentiment analysis shows the percentage of negative sentiment terms in twitters containing “#Oppo” was the highest among 10 smartphone companies worldwide, at approximately 0.

034%, followed by the figure for Huawei, at 0.

022%.

Twitter posts mentioning LG and Samsung, two well-known South Korean brands were less negative than tweets about other companies.

As for positive sentiment terms, no big differences were shown among these 10 companies.

Chinese brand Xiaomi received slightly more positive comments than others.

Oppo was the only brand that had a negative sentiment score, which means in tweets mentioning Oppo, negative terms were used more than positive terms.

Chinese brands Huawei and Vivo also got low sentiment scores.

At the same time, when talking about Oppo, Twitter users seemed to become more sentimental, as tweets containing “#Oppo” also had the highest proportion of sentient terms.

Top 10 Hashtags (Oppo)The reason was linked to India’s “boycott Chinese products” outrage as data shows that “#BoycottChineseProducts” and “#BoycottChina” were the most frequently used hashtags when netizens are tweeting about Oppo.

Top 10 locations of 500 Tweets containing “Oppo”Besides, most of those who tweeted about Oppo are located in India, according to social media data.

However, Oppo is not the brand that most Twitter users are angry about.

When analyzing the NRC’s sentiment among different smartphone brands, Huawei, Xiaomi and One Plus showed the highest anger score.

The anger score of Oppo was the second last in the diagram, only slightly higher than LG.

As for the percentage of fear posts, the figure for Huawei is much higher than any other nine brands, which illustrates that netizens on Twitter were feeling uncertainty about Huawei and its outcoming 5G technology.

R code1# Mobile companies sentiment analysisif (!require("rtweet")) install.

packages("rtweet", repos="https://cran.

cnr.

berkeley.

edu/", dependencies = TRUE)if (!require("tidyverse")) install.

packages("tidyverse", repos="https://cran.

cnr.

berkeley.

edu/", dependencies = TRUE)if (!require("tidytext")) install.

packages("tidytext", repos="https://cran.

cnr.

berkeley.

edu/", dependencies = TRUE)if (!require("stringr")) install.

packages("stringr", repos="https://cran.

cnr.

berkeley.

edu/", dependencies = TRUE)if (!require("SnowballC")) install.

packages("SnowballC", repos="https://cran.

cnr.

berkeley.

edu/", dependencies = TRUE)require(tidyverse) # sentiment analysisrequire(tidytext) # text manuipationrequire(rtweet) # Twitter search require(stringr) # String manuipationrequire(plotly) # plotting packagerequire(SnowballC) # Word Stemmingappname <- "something"consumerKey <- "something"consumerSecret <- "something"twitter_token <- create_token(app = appname, consumer_key = consumerKey, consumer_secret = consumerSecret, set_renv =TRUE)sentiment_term <- get_sentiments("bing")#Setting functionsFind_total_terms <- function(btw_text){btw_words <- strsplit(btw_text,' ')tt <- sum(unlist(sapply(MAGA_words, length)))return(tt)}Find_pos_sentiments <- function(btw_text){btw_words <- strsplit(btw_text,' ')s <- table(unlist(sapply(btw_words,function(z){sentiment_term$sentiment[sentiment_term$word %in% wordStem(z,"english")]})))return(positive=s[2])}Find_neg_sentiments <- function(btw_text){btw_words <- strsplit(btw_text,' ')s <- table(unlist(sapply(btw_words,function(z){sentiment_term$sentiment[sentiment_term$word %in% wordStem(z,"english")]})))return(negative=s[1])}Find_sentimentscore <- function(btw_text){btw_words <- strsplit(btw_text,' ')s <- table(unlist(sapply(btw_words,function(z){sentiment_term$sentiment[sentiment_term$word %in% wordStem(z,"english")]})))score <- (s[2]-s[1])/(s[2]+s[1])return(score=score)}# Selected mobile companieshashtags <- c("#Samsung","#Apple","#Huawei","#OPPO","#Vivo","#Xiaomi","#Nokia","#OnePlus","#LG")# Establish a for loop to search each location and combine all data to become data.

frame all_dataall_data <- c()for(h in hashtags){st <- search_tweets(h, n=500, include_rts = FALSE, lang="en") if (nrow(st)!=0){st$text <- gsub('[[:punct:]]',' ',st$text) # removing all punctation charactersst$text <- gsub('[^[:alnum:] ]',' ',st$text) # removing non alphanumeric charactersst$text <- tolower(st$text) # in lower casest$hashtag <- hall_data <- rbind(all_data,st)}Sys.

sleep(10)}aggregate(text~hashtag,all_data,length)ad_tlt <- aggregate(text~hashtag,all_data,Find_total_terms)ad_pos <- aggregate(text~hashtag,all_data,Find_pos_sentiments)ad_neg <- aggregate(text~hashtag,all_data,Find_neg_sentiments)ad_ssc <- aggregate(text~hashtag,all_data,Find_sentimentscore)ad_ssc$sent_p <- (ad_pos$text + ad_neg$text) / ad_tlt$textad_ssc$possent_p <- ad_pos$text / ad_tlt$textad_ssc$negsent_p <- ad_neg$text / ad_tlt$text#Plot % of Sentiment Termsp1 <- plot_ly(ad_ssc, x = ~hashtag, y = ~sent_p, name = ~hashtag, type = 'bar')p1 <- layout(p1, title = "% of Sentiment Terms", xaxis = list(title = "#Hashtag"), yaxis = list (title = "Percentage"))p1Sys.

setenv("plotly_username"="something")Sys.

setenv("plotly_api_key"="something")api_create(p1, filename = "% of Sentiment Terms")# Plot % of Negative Sentiment termsp2 <- plot_ly(ad_ssc, x = ~hashtag, y = ~negsent_p, name = ~hashtag, type = 'bar')p2 <- layout(p2, title = "% of Negative Sentiment Terms", xaxis = list(title = "#Hashtag"), yaxis = list (title = "Percentage"))p2api_create(p2, filename = "% of Negative Sentiment Terms")# Plot % of Positive Sentiment termsp3 <- plot_ly(ad_ssc, x = ~hashtag, y = ~possent_p, name = ~hashtag, type = 'bar')p3 <- layout(p3, title = "% of Positive Sentiment Terms", xaxis = list(title = "#Hashtag"), yaxis = list (title = "Percentage"))p3api_create(p3, filename = "% of Positive Sentiment Terms")# Plot % of Sentiment Scorep4 <- plot_ly(ad_ssc, x = ~hashtag, y = ~text, name = ~hashtag, type = 'bar')p4 <- layout(p4, title = "Sentiment Score", xaxis = list(title = "#Hashtag"), yaxis = list (title = "Score"))p4api_create(p4, filename = "Sentiment Score")2# Findind out why oppo has the most negative sentimentif (!require("rtweet")) install.

packages("rtweet", repos="https://cran.

cnr.

berkeley.

edu/", dependencies = TRUE)if (!require("httpuv")) install.

packages("httpuv", repos="https://cran.

cnr.

berkeley.

edu/", dependencies = TRUE)require("rtweet") # load the required libraryrequire("httpuv")require("plotly")#Searching 500 tweets with "oppo" in Englishoppo <- search_tweets("oppo", n = 500, include_rts = FALSE,lang = 'en') #Getting Top10 hashtags of 500 tweets with "oppo" oppo_text <- oppo$texttop10hashtag <- function(x){sort(table(unlist(str_extract_all(x,'#[0-9a-zA-Z_]+|#[0-9a-zA-Z_]+$'))),decreasing=TRUE)[1:10]}top10hashtag2 <- top10hashtag(oppo)p <- plot_ly(x = names(top10hashtag2), y = top10hashtag2, name = "Top 10 Hashtags", type = 'bar')p <-layout(p, title = "Top 10 Hashtags (Oppo)", xaxis = list(title = "@Name"), yaxis = list (title = "Frequency"))pSys.

setenv("plotly_username"="ruby_ye")Sys.

setenv("plotly_api_key"="tYOj6SILBUaALYnQkf4o")api_create(p, filename = "Top 10 Hashtags (Oppo)")3# Mobile companies NRC analysissentiment_term2 <- get_sentiments("nrc")Find_NRC_sentiments <- function(oppo_text){oppo_words <- strsplit(oppo_text,' ')nrc_sentiment <- prop.

table(table(unlist(sapply(oppo_words,function(z){ sentiment_term2$sentiment[sentiment_term2$word %in% wordStem(z,"english")]}))))return(nrc_sentiment)}ad_anger <- aggregate(text~hashtag,all_data,Find_NRC_sentiments)ad_anger$text# Plot NRC's Anger Post %p6 <- plot_ly(ad_anger, x = ~hashtag, y = ~text[,1], name = ~hashtag, type = 'bar')p6 <- layout(p6, title = "NRC's Anger Post %", xaxis = list(title = "#Hashtag"), yaxis = list (title = "%"))p6api_create(p6, filename = "NRC's Anger Post %")# Plot NRC's Fear Post %p5 <- plot_ly(ad_anger, x = ~hashtag, y = ~text[,4], name = ~hashtag, type = 'bar')p5 <- layout(p5, title = "NRC's Fear Post %", xaxis = list(title = "#Hashtag"), yaxis = list (title = "%"))p5api_create(p5, filename = "NRC's Fear Post %").

. More details

Leave a Reply