Crowd control, planning, and prediction using sentiment analysis: an alert system for city authorities

Malik, T., Hanif, N., Tahir, A., Abbas, S., Hanif, M. S., Tariq, F., Ansari, S. , Abbasi, Q. H. and Imran, M. A. (2023) Crowd control, planning, and prediction using sentiment analysis: an alert system for city authorities. Applied Sciences, 13(3), 1592. (doi: 10.3390/app13031592)

[img] Text
285895.pdf - Published Version
Available under License Creative Commons Attribution.

2MB

Abstract

Modern means of communication, economic crises, and political decisions play imperative roles in reshaping political and administrative systems throughout the world. Twitter, a micro-blogging website, has gained paramount importance in terms of public opinion-sharing. Manual intelligence of law enforcement agencies (i.e., in changing situations) cannot cope in real time. Thus, to address this problem, we built an alert system for government authorities in the province of Punjab, Pakistan. The alert system gathers real-time data from Twitter in English and Roman Urdu about forthcoming gatherings (protests, demonstrations, assemblies, rallies, sit-ins, marches, etc.). To determine public sentiment regarding upcoming anti-government gatherings (protests, demonstrations, assemblies, rallies, sit-ins, marches, etc.), the alert system determines the polarity of tweets. Using keywords, the system provides information for future gatherings by extracting the entities like date, time, and location from Twitter data obtained in real time. Our system was trained and tested with different machine learning (ML) algorithms, such as random forest (RF), decision tree (DT), support vector machine (SVM), multinomial naïve Bayes (MNB), and Gaussian naïve Bayes (GNB), along with two vectorization techniques, i.e., term frequency–inverse document frequency (TFIDF) and count vectorization. Moreover, this paper compares the accuracy results of sentiment analysis (SA) of Twitter data by applying supervised machine learning (ML) algorithms. In our research experiment, we used two data sets, i.e., a small data set of 1000 tweets and a large data set of 4000 tweets. Results showed that RF along with count vectorization performed best for the small data set with an accuracy of 82%; with the large data set, MNB along with count vectorization outperformed all other classifiers with an accuracy of 75%. Additionally, language models, e.g., bigram and trigram, were used to generate the word clouds of positive and negative words to visualize the most frequently used words.

Item Type:Articles
Status:Published
Refereed:Yes
Glasgow Author(s) Enlighten ID:Ansari, Dr Shuja and Tahir, Dr Ahsen and Imran, Professor Muhammad and Malik, Tariq and Abbasi, Dr Qammer
Authors: Malik, T., Hanif, N., Tahir, A., Abbas, S., Hanif, M. S., Tariq, F., Ansari, S., Abbasi, Q. H., and Imran, M. A.
College/School:College of Science and Engineering > School of Engineering > Autonomous Systems and Connectivity
College of Science and Engineering > School of Engineering > Electronics and Nanoscale Engineering
Journal Name:Applied Sciences
Publisher:MDPI
ISSN:2076-3417
ISSN (Online):2504-2289
Published Online:26 January 2023
Copyright Holders:Copyright © 2023 The Authors
First Published:First published in Applied Sciences 13(3): 1592
Publisher Policy:Reproduced under a Creative Commons License

University Staff: Request a correction | Enlighten Editors: Update this record

Project CodeAward NoProject NamePrincipal InvestigatorFunder's NameFunder RefLead Dept
317683UKRI EPSRC Impact Acceleration Accounts (IAA) 2022 - 2025Christopher PearceEngineering and Physical Sciences Research Council (EPSRC)EP/X525716/1ENG - Systems Power & Energy