Exploring Crime Reports from Social Media Through Transformer-Based Text Classification and Geovisualization
Abstract
The analysis of criminal acts is of great importance within society, as it enables the identification of high-risk areas with elevated crime rates. This type of knowledge not only provides insightful information about the safety of the environment to the population but can also serve as a strategic instrument for directing essential resources towards areas warranting attention so that the necessary resources can be allocated. This study delves into diverse data sources, encompassing open data and social media networks, to construct an extensive dataset in Spanish. By harnessing the potential of natural language processing (NLP) techniques and geospatial modeling, this dataset facilitates the classification and recognition of criminal reports made through the training of a machine learning model. To visually depict the reported cases, choropleth and heat maps are generated to highlight regions with a high prevalence of crime. Initially, a baseline was determined, where the two main algorithms were Support Vector Machine (SVM) and Random Forest. These were trained with different feature representations such as N-grams and embeddings. Notably, SVM employing multilingual Universal Sentence Encoder (M-USE) embedding attains the best outcome of the two algorithms with an F1-score of 0.78. However, this research also employs pre-trained deep learning transformer models, specifically the Bidirectional Encoder Representations from Transformers (BERT) architecture. Using BETO, a Spanish variant of BERT, this method achieves an F1-score of 0.86, significantly surpassing the established baseline and demonstrating the effectiveness of advanced deep learning models in crime classification.