Sentiment Analysis of Tweets using Naïve Bayes Algorithm through R Programming - Syrien, Annie; Hanumanthappa, M; Sundaravadivazhagan, B (International Journal of Computer Sciences and Engineering, 2025)
The enlargement in development of web 2.0 and web enabled devices smacked huge user generated data hence attracted many researchers in the past years in the field of social media mining. The focal point in mining social media is for obtaining the important decision making opinions, attitudes, sentiments, and emotions. This paper uses naïve bayes algorithm to classify the sentiments and polarity of the tweets of Bengaluru traffic in detail with the help of opinion lexicon through R studio. The tweets on Bengaluru traffic are first accessed from twitter through streaming API, then preprocessed and functions containing naïve bayes classifier is used to classify the tweets into emotions and polarity, through classify emotions and classify polarity functions. Classify emotions functions makes use of naïve bayes algorithm for classifying the emotions into seven categories such as anger, disgust, fear, joy, sadness, surprise, and best fit. Classify polarity function receives two arguments, cleaned tweets and naïve bayes algorithm for classifying the polarity into positive sentiment and negative sentiment. The results are represented through plots in R studio.