Analysis of Citizen Perspectives on Traffic Accidents Shared on Social Media Using Large Language Models

Document Type : Original Article

Authors
1 Assistant Professor, School of Civil Engineering, Iran University of Science and Technology, Tehran, Iran.
2 M.Sc., Student, School of Civil Engineering, Iran University of Science and Technology, Tehran, Iran.
Abstract
Recently, social media discourse has provided transportation researchers with a valuable opportunity to evaluate public sentiment toward road safety across multiple dimensions. In this study, a process for the opinion analysis of accident-related social media messages using large language models is proposed and applied as a case study. In this process, after extraction, the data are preprocessed, and then the Gemma‑4 generative language model is fine-tuned and employed for three tasks: text classification, sentiment analysis, and summarization. In the first step, accident-related messages were classified and separated. In the second step, the fine-tuned language model was able to perform sentiment analysis on accident-related messages with an accuracy of 87%. Finally, thematic summarization of the messages and analysis of the results were conducted. The results of sentiment analysis and thematic summarization showed that although most messages were news oriented, approximately 21% of them contained negative opinions and complaints from users, pointing to various issues including infrastructural road safety challenges as well as certain managerial and cultural aspects. These findings indicate that these messages, in addition to providing information about accidents, reflect citizens’ views, criticisms, and suggestions. They can contribute to a better understanding of road safety and transportation issues, especially at the local level where public surveys are not regularly conducted.
Keywords

-Abedi, M. M., & Sacchi, E. (2024). A machine learning tool for collecting and analyzing subjective road safety data from Twitter. Expert Systems with Applications, 240, 122582.
-Aggarwal, C. C., & Reddy, C. K. (2013). Data Clustering: Algorithms and Applications. Chapman & Hall/CRC.
-Ali, F., Ali, A., Imran, M., Naqvi, R. A., Siddiqi, M. H., & Kwak, K.-S. (2021). Traffic accident detection and condition analysis based on social networking data. Accident Analysis & Prevention, 151, 105973.
-Banerjee, S., & Lavie, A. (2005). METEOR: An automatic metric for MT evaluation with improved correlation with human judgments. Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization,
-Chakraborty, P., & Sharma, A. (2019). Public opinion analysis of the transportation policy using social media data: a case study on the Delhi odd–even policy. Transportation in Developing Economies, 5, 1–9.
 
-Chang, H., Li, L., Huang, J., Zhang, Q., & Chin, K.-S. (2022). Tracking traffic congestion and accidents using social media data: A case study of Shanghai. Accident Analysis & Prevention, 169, 106618.
-Chen, X., Wang, Z., & Di, X. (2023). Sentiment analysis on multimodal transportation during the covid-19 using social media data. Information, 14(2), 113.
-Das, S., & Zubaidi, H. A. (2023). City transit rider tweets: understanding sentiments and politeness. Journal of Urban Technology, 30(1), 111–126.
-Dettmers, T., Pagnoni, A., Holtzman, A., & Zettlemoyer, L. (2023). Qlora: Efficient finetuning of quantized llms. Advances in Neural Information Processing Systems, 36, 10088–10115.
-Devlin, J. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
-Efthymiou, D., & Antoniou, C. (2012). Use of social media for transport data collection. Procedia-Social and Behavioral Sciences, 48, 775–785.
-Evans-Cowley, J. S., & Griffin, G. (2012). Microparticipation with social media for community engagement in transportation planning. Transportation Research Record, 2307(1), 90–98.
-González-Ibáñez, R., Muresan, S., & Wacholder, N. (2011, June). Identifying Sarcasm in Twitter: A Closer Look. In D. Lin, Y. Matsumoto, & R. Mihalcea, Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies Portland, Oregon, USA.
-Grant‐Muller, S. M., Gal‐Tzur, A., Minkov, E., Nocera, S., Kuflik, T., & Shoor, I. (2015). Enhancing transport data collection through social media sources: methods, challenges and opportunities for textual data. IET Intelligent Transport Systems, 9(4), 407–417.
-Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., & Chen, W. (2022). Lora: Low-rank adaptation of large language models. ICLR, 1(2), 3.
ISPA. (2025). Iranians' usage rate of messaging apps and social networks.
-Japkowicz, N. (2013). Assessment metrics for imbalanced learning. Imbalanced learning: Foundations, algorithms, and applications,
187–206.
-Kamga, C., Kish, R., Mudigonda, S., & Tchamna, R. (2023). Utilizing Social Media Data for Estimating Transit Performance Metrics. Sustainability, 15(23), 16183.
-Kuflik, T., Minkov, E., Nocera, S.,
Grant-Muller, S., Gal-Tzur, A., & Shoor, I. (2017). Automating a framework to extract and analyse transport related social media content: The potential and the challenges. Transportation Research Part C: Emerging Technologies, 77, 275–291.
-Li, D., Zhang, Y., & Li, C. (2019). Mining public opinion on transportation systems based on social media data. Sustainability, 11(15), 4016.
-Liao, Y., Guo, H., & Shi, H. (2024). Research on the Public’s Intention to Use Shared Autonomous Vehicles: Based on Social Media Data Mining and Questionnaire Survey. Sustainability, 16(11), 4462.
-Liu, J., Shang, Z., Ke, W., Wang, P., Luo, Z., Liu, J., Li, G., & Li, Y. (2025, July). LLM-Guided Semantic-Aware Clustering for Topic Modeling. In W. Che, J. Nabende, E. Shutova, & M. T. Pilehvar, Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) Vienna, Austria.
-Lock, O., & Pettit, C. (2020). Social media as passive geo-participation in transportation planning–how effective are topic modeling & sentiment analysis in comparison with citizen surveys? Geo-Spatial Information Science, 23(4), 275–292.
-Manik, M. M. H., & Wang, G. (2026). Gemma 4, Phi-4, and Qwen3: Accuracy-Efficiency Tradeoffs in Dense and MoE Reasoning Language Models. arXiv preprint arXiv:2604.07035.
-Mathur, S., Ninan, J., Vuorinen, L., Ke, Y., & Sankaran, S. (2021). An exploratory study of the use of social media to assess benefits realization in transport infrastructure projects. Project Leadership and Society, 2, 100010.
-Méndez, J. T., Lobel, H., Parra, D., & Herrera, J. C. (2019). Using Twitter to infer user satisfaction with public transport: the case of Santiago, Chile. IEEE Access, 7, 60255–60263.
-Montes, C. M., Feldt, R., Martos, C. M., Ouhbi, S., Premanandan, S., & Graziotin, D. (2025). Large Language Models in Thematic Analysis: Prompt Engineering, Evaluation, and Guidelines for Qualitative Software Engineering Research. arXiv preprint arXiv:2510.18456.
-Radford, A., Narasimhan, K., Salimans, T., & Sutskever, I. (2018). Improving language understanding by generative pre-training.
Richardson, L. (2007). Beautiful soup documentation. In: April.
-Ruan, K., Wang, X., & Di, X. (2024). From twitter to reasoner: Understand mobility travel modes and sentiment using large language models. 2024 IEEE 27th International Conference on Intelligent Transportation Systems (ITSC),
-Sakaki, T., Okazaki, M., & Matsuo, Y. (2010). Earthquake shakes twitter users: real-time event detection by social sensors. Proceedings of the 19th international conference on World wide web,
-Saragih, M. H., & Girsang, A. S. (2017). Sentiment analysis of customer engagement on social media in transport online. 2017 International Conference on Sustainable Information Engineering and Technology (SIET),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
-Serna, A., Soroa, A., & Agerri, R. (2021). Applying deep learning techniques for sentiment analysis to assess sustainable transport. Sustainability, 13(4), 2397.
-Sujon, M., & Dai, F. (2021). Social media mining for understanding traffic safety culture in washington state using twitter data. Journal of Computing in Civil Engineering, 35(1), 04020059.
-Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., & Azhar, F. (2023). Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
Vaswani, A. (2017). Attention is all you need. Advances in Neural Information Processing Systems.
-Wang, S., Zhao, Z., Xie, Y., Ma, M., Chen, Z., Wang, Z., Su, B., Xu, W., & Li, T. (2024). Recent surge in public interest in transportation: Sentiment analysis of Baidu Apollo Go using Weibo data. arXiv preprint arXiv:2408.10088.
-Wojtowicz, J., & Wallace, W. A. (2016). Use of social media by transportation agencies for traffic management. Transportation Research Record, 2551(1), 82–89.