Mining Twitter Data for Business Intelligence Using Naive Bayes Algorithm for Sentiment Analysis

Ugochukwu E. Orji, Modesta E. Ezema, Jonathan C. Agbo


Today social media has grown to be a big player in the way businesses and organizations operate, especially with the coronavirus pandemic increasing the online footprint of organizations. The use of data from social media to drive business intelligence is now of growing interest to both researchers and business owners. Business owners can now utilize platforms like Twitter to learn about their target audience and improve their business processes to meet their growing needs. Twitter makes it easy to see what is going or about to go viral and vital details like why it is going viral and the players behind it. This research aims to help business owners’ especially small and medium enterprises and start-ups gain a competitive advantage in their industry by using the "crowd wisdom" opportunity via social media. The proposed system is based on Twitter and crawls the platform for relevant data, including; locations, trends, and important actors (influencers) within a specified field; the system cleans the data and presents the information in an actionable format. Python was used for Twitter data mining, and sentiment analysis of the tweets was done using Naive Bayes classifiers.


Twitter Sentiment Analysis, Twitter Sentiment Analysis for Business Intelligence, Naive Bayes algorithm, Bayes Theorem, Business intelligence, Sentiment analysis.

Full Text:



Banji Oyelaran-Oyeyinka., "SME: Issues, Challenges and Prospects," FSS 2020 International Conference.

“Nigeria SME survey: Assessing current market conditions and business growth prospects.” Accessed on: March 23, 2021. [Online] Available at:

U. Sivarajah, Z. Irani, S. Gupta, and K. Mahroof; "Role of big data and social media analytics for business to business sustainability: A participatory web context." Industrial Marketing Management 86 (2020): 163-179.

R.A. Callcut, S. Moore, G. Wakam, A.E. Hubbard, and M.J. Cohen; "Finding the signal in the noise: Could social media be utilized for early hospital notification of multiple casualty events?." Plos one 12, no. 10 (2017): e0186118.

Tian L., Zhang X., Wang Y., Liu H. (2020) Early Detection of Rumours on Twitter via Stance Transfer Learning. In: Jose J. et al. (eds) Advances in Information Retrieval. ECIR 2020. Lecture Notes in Computer Science, vol 12035. Springer, Cham.

E. Foley, & M. G. Guillemette, "What is business intelligence?" International Journal of Business Intelligence Research, Vol. 1(4), pp. 1–28, 2010.

D. J. Power, & G. Phillips-Wren, "Impact of social media and Web 2.0 on decision-making." Journal of decision systems, Vol. 20, pp. 249–261, 2011.

Vincent Dutot & Elaine Mosconi (Guest Editors); "Social media and business intelligence: defining and understanding social media intelligence," Journal of Decision Systems, Vol. 25:3, pp. 191-192, 2016.

“Sprout Social report on Number of global social network users 2017-2025;” Accessed on: June 23, 2021. [Online] Available at:

“Global retail e-commerce sales 2014-2024;” [Online] Available at:

“16 Online Shopping Statistics: How Many People Shop Online?” [Online] Available at:

“Mintel Report on Clothing retailing;” Accessed on: March 23, 2021. [Online] Available at:

, P. N. Tan, M. Steinbach, V. Kumar, “Introduction to Data Mining”. Pearson Addison Wesley: Boston, 2006.

J. Han, M. Kamber, and J. Pei, “Data Mining: Concepts and Techniques”, Morgan Kaufmann: San Francisco, 2011.

V. Tundjungsari; “Business Intelligence with Social Media and Data Mining to Support Customer Satisfaction in Telecommunication Industry.” International Journal of Computer Science and Electronics Engineering (IJCSEE) Volume. 2013;1.

Pritam GundechaHuan Liu. "Mining Social Media: A Brief Introduction." In INFORMS Tutorials in Operations Research. Published online: 14 Oct 2014; pp. 1-17. https://pubsonline [Accessed 20 Nov 2019].

G. Bello-Orgaz, J. J. Jung, D. Camacho; “Social big data: Recent achievements and new challenges.” Information Fusion. Vol. 1;28:45-59. Mar. 2016

Twitter Q3 2019 Letter to Shareholders; doc_financials/2019/q3/Q3-2019-Shareholder-Letter.pdf (accessed May, 2020)

Number of monthly active Facebook users worldwide as of 2nd quarter 2020; (accessed May, 2020)

YouTube for Press; (accessed May, 2020).

From Wikipedia, the free encyclopedia; (accessed May, 2020).

S. Yardi, D. Romero, G. Schoenebeck, and D. Boyd. "Detecting spam in a Twitter network." First Monday 15.1 (2010).

Z. Chu, S. Gianvecchio, H. Wang, and S. Jajodia. "Who is tweeting on Twitter: Human, bot, or cyborg?" Proceedings of the 26th Annual Computer Security Applications Conference. Association for Computing Machinery, New York, pp. 21-30, 2010.

The Free Library. S.V. “A comparative study on sentiment analysis.” Accessed on: March 23, 2021. [Online] Available at:

B. Pang and L. Lee. "Opinion mining and sentiment analysis." Foundations and Trend in Information Retrieval Vol. 2.1–2, pp. 1-135, 2008.

A. M. Popescu and O. Etzioni. "Extracting product features and opinions from reviews." Proceedings of the Conference on Human Language Technology and Empirical Methods in Natural Language Processing. Association for Computational Linguistics, Stroudsburg, PA, pp. 339-346, 2005.

H. Liu and P. Maes. “InterestMap: Harvesting social network roles for recommendations.” Workshop: Beyond Personalization, San Diego, 2005.

E. Rilo and J. Wiebe. "Learning extraction patterns for subjective expressions." Proceedings of the 2003 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, Stroudsburg, PA, pp. 105-112, 2003.

H. Yu and V. Hatzivassiloglou. "Towards answering opinion questions: Separating facts from opinions and identifying the polarity of opinion sentences & Proceedings of the 2003 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, Stroudsburg, PA, pp. 129-136, 2003.

B. Agarwal, N. Mittal; “Machine Learning Approach for Sentiment Analysis. In: Prominent Feature Extraction for Sentiment Analysis.” Socio-Affective Computing. Springer, Cham. 2016

S.S. Kamble, A.R. Itkikar; “Study of supervised machine learning approaches for sentiment analysis.” International Research Journal of Engineering and Technology (IRJET). Vol. 5(04). Apr. 2018.

Nagesh Singh Chauhan; “Naïve Bayes Algorithm: Everything you need to know.” Accessed on: March 23, 2021. [Online] Available at:

B. Sriram, D. Fuhry, E. Demir, H. Ferhatosmanoglu, & M. Demirbas; “Short text classification in twitter to improve information filtering.” In Proceedings of the 33rd international ACM SIGIR conference on Research and development in information retrieval 2010 Jul. 19 (pp. 841-842).

K.W. Kiprono, E.O. Abade; “Comparative Twitter sentiment analysis based on linear and probabilistic models.” International Journal on Data Science and Technology. 2016;2(4):41-5.

Ernawati, Siti, Risa Wati, Nuzuliarini Nuris, Lita Sari Marita, and Eka Rini Yulia. "Comparison of Naïve Bayes Algorithm with Genetic Algorithm and Particle Swarm Optimization as Feature Selection for Sentiment Analysis Review of Digital Learning Application." In Journal of Physics: Conference Series, vol. 1641, no. 1, p. 012040. IOP Publishing, 2020.

Hilman Wisnu et al, Sentiment analysis on customer satisfaction of digital payment in Indonesia: A comparative study using KNN and Naïve Bayes 2020 J. Phys.: Conf. Ser. 1444 012034

Dubey Akash Dutt, “Twitter Sentiment Analysis during COVID-19 Outbreak” Accessed on: March 23, 2021. [Online] Available at: SSRN: or

N. Mishra, A. Singh; “Use of twitter data for waste minimization in beef supply chain.” Ann Oper Res 270, 337–359 (2018).

Ana Valdivia M. Victoria Luzón, and Francisco Herrera; “Sentiment Analysis in TripAdvisor;” University of Granada, IEEE INTELLIGENT SYSTEMS, Published by the IEEEComputer Society.

Neethu M S,Rajasree R, “Sentiment Analysis in Twitter using Machine Learning Techniques.

;” IEEE - 31661,4th ICCCNT 2013 July 4 - 6, 2013,



  • There are currently no refbacks.

Copyright (c) 2021 Ugochukwu E. Orji

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.