*3.1.4. Barack Obama's visit to Jamaica*

**Figure 8** shows that the majority (2583) tweets of the three thousand five hundred and one (3500) tweets collected on Barack Obama's visit to Jamaica were positive. This demonstrates that the Jamaican citizens on Twitter social supported the visit of the President to Jamaica. However, six hundred and fifty eight (658) Jamaicans on Twitter expressed negative sentiments toward Barack Obama's visit to Jamaica. There was a movement suggesting the success of visit of his visit was dependent on whether he offered or announced a Presidential Pardon to the country's first national hero Marcus Garvey, civil rights activist in Jamaica and the USA, who allegedly was falsely convicted of mail fraud in the USA. Failure to grant a pardon to the civil rights activists spurred some of the negative tweets. Hence, *anger* appears on the word cloud in **Figure 9**, generated by RStudio.

**Figure 8.** Sentiment polarity of tweets obtained on Barack Obama's visit to Jamaica.

**3.2. Emotions of topical issues**

classifieds "unknown".

other topical issues selected (**Figure 11**).

*3.2.1. No-retweets*

This section will present information on emotions expressed for each topic, with noretweets. In everyday speech, emotion is viewed as one's state of mind and instinctive response and are intertwined with mood, temperament, personality and disposition. Emotions are elicited by significant events that are significant when they touch upon one or more of the concerns of the subject. Emotions thus result from the interaction of an event's actual or anticipated consequences and the subject's concerns [6]. In this research several emotions were highlighted: anger, fear, joy, sadness, surprise and disgust. However, due to RStudio's incapability to classify some of the tweets into emotions many tweets were

Using Sentiment Analysis and Machine Learning Algorithms to Determine Citizens' Perceptions

http://dx.doi.org/10.5772/intechopen.72521

75

Tweets posted by authors were of mixed emotions, varying from anger to joy. As depicted in the **Figures 11**–**14**, RStudio encountered difficulty in classifying the emotions associated with majority of the tweets. As a result of this, majority of the tweets for the decriminalization of marijuana in Jamaica were classified as "unknown" in **Figure 11**. Many factors including the use of the Jamaican creole and the use of sarcasm may have contributed to R's difficulty in determining the emotions of the tweets. This was noticed for the emotions depicted on the

**Figure 11.** Sentiment emotion of no-retweets obtained on the decriminalization of marijuana in Jamaica.

**Figure 9.** Word cloud showing frequently tweeted words associated with Barack Obama's visit to Jamaica.
