{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,6,1]],"date-time":"2026-06-01T09:07:37Z","timestamp":1780304857202,"version":"3.54.0"},"reference-count":53,"publisher":"MDPI AG","issue":"6","license":[{"start":{"date-parts":[[2026,5,31]],"date-time":"2026-05-31T00:00:00Z","timestamp":1780185600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Computation"],"abstract":"<jats:p>Sentiment analysis has broad applications in social media networks due to the high volume of user activity on diverse topics such as political debates. Transformer-based neural networks are among the technologies that achieve significant results in text classification. This study evaluates twelve pre-trained transformer-based models through fine-tuning for sentiment classification of Spanish-language political texts from the social media network X. Some of these models were originally created in Spanish, while others are multilingual models that include Spanish. The twelve models were trained to specialize in sentiment classification on political topics, using the same training and testing parameters, in order to compare them under equal conditions during fine-tuning. Good results were obtained with the precision, recall, and F1-score metrics mainly in multilingual models but also in some models originally created in Spanish. The study includes the detailed results of the evaluation in training and testing for the three metrics employed.<\/jats:p>","DOI":"10.3390\/computation14060127","type":"journal-article","created":{"date-parts":[[2026,6,1]],"date-time":"2026-06-01T08:09:16Z","timestamp":1780301356000},"page":"127","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":0,"title":["Evaluating Pre-Trained Transformer-Based Models for Political Sentiment Analysis on Social Media"],"prefix":"10.3390","volume":"14","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-7631-5565","authenticated-orcid":false,"given":"Mar\u00eda Patricia Tzili","family":"Cruz","sequence":"first","affiliation":[{"name":"Department of Informatics, Universidad Polit\u00e9cnica del Valle de M\u00e9xico, Tultitl\u00e1n 54910, Estado de M\u00e9xico, Mexico"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2385-284X","authenticated-orcid":false,"given":"Salvador Contreras","family":"Hern\u00e1ndez","sequence":"additional","affiliation":[{"name":"Department of Informatics, Universidad Polit\u00e9cnica del Valle de M\u00e9xico, Tultitl\u00e1n 54910, Estado de M\u00e9xico, Mexico"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7739-8657","authenticated-orcid":false,"given":"Jos\u00e9 Mart\u00edn Esp\u00ednola","family":"S\u00e1nchez","sequence":"additional","affiliation":[{"name":"Department of Informatics, Universidad Polit\u00e9cnica del Valle de M\u00e9xico, Tultitl\u00e1n 54910, Estado de M\u00e9xico, Mexico"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0007-4201-8750","authenticated-orcid":false,"given":"Ra\u00fal Hern\u00e1ndez","family":"Medina","sequence":"additional","affiliation":[{"name":"Department of Informatics, Universidad Polit\u00e9cnica del Valle de M\u00e9xico, Tultitl\u00e1n 54910, Estado de M\u00e9xico, Mexico"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0006-1156-5519","authenticated-orcid":false,"given":"Alma Alejandra Luna","family":"G\u00f3mez","sequence":"additional","affiliation":[{"name":"Department of Engineering, Universidad Nacional Aut\u00f3noma de M\u00e9xico, FES Cuautitl\u00e1n Campus 4, Cuautitl\u00e1n Izcalli 54714, Estado de M\u00e9xico, Mexico"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Adriana Marlene Pacheco","family":"Orozco","sequence":"additional","affiliation":[{"name":"Department of Informatics, Universidad Polit\u00e9cnica del Valle de M\u00e9xico, Tultitl\u00e1n 54910, Estado de M\u00e9xico, Mexico"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2026,5,31]]},"reference":[{"key":"ref_1","unstructured":"Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., and Polosukhin, I. (2017). Attention Is All You Need. arXiv."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"107","DOI":"10.1007\/978-3-030-61841-4_8","article-title":"Identifying Political Sentiments on YouTube: A Systematic Comparison Regarding the Accuracy of Recurrent Neural Network and Machine Learning Models","volume":"Volume 12259","author":"Preuss","year":"2020","journal-title":"Disinformation in Open Online Media"},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"101075","DOI":"10.1016\/j.csl.2020.101075","article-title":"Multilingual stance detection in social media political debates","volume":"63","author":"Lai","year":"2020","journal-title":"Comput. Speech Lang."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"17982","DOI":"10.1038\/s41598-023-45137-9","article-title":"Amharic political sentiment analysis using deep learning approaches","volume":"13","author":"Alemayehu","year":"2023","journal-title":"Sci. Rep."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"45","DOI":"10.1007\/s13278-024-01211-2","article-title":"Assembling a multi-platform ensemble social bot detector with applications to US 2020 elections","volume":"14","author":"Ng","year":"2024","journal-title":"Soc. Netw. Anal. Min."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"80","DOI":"10.1186\/s40537-024-00946-1","article-title":"PoLYTC: A novel BERT-based classifier to detect political leaning of YouTube videos based on their titles","volume":"11","author":"AlDahoul","year":"2024","journal-title":"J. Big Data"},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"1393","DOI":"10.1007\/s11135-025-02064-3","article-title":"Exploring the predictors of the populist vote using random forests","volume":"59","author":"Benati","year":"2025","journal-title":"Qual. Quant."},{"key":"ref_8","first-page":"389","article-title":"Multilingual sentiment mining system to prognosticate governance","volume":"71","author":"Bhatti","year":"2022","journal-title":"Comput. Mater. Contin."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"110317","DOI":"10.1016\/j.engappai.2025.110317","article-title":"Graph-aware pre-trained language model for political sentiment analysis in Filipino social media","volume":"146","author":"Aquino","year":"2025","journal-title":"Eng. Appl. Artif. Intell."},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"420","DOI":"10.1016\/j.procs.2022.11.194","article-title":"Data Science in Social Politics with Particular Emphasis on Sentiment Analysis","volume":"214","author":"Moreira","year":"2022","journal-title":"Procedia Comput. Sci."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"37","DOI":"10.1016\/j.osnem.2017.12.002","article-title":"Politics, sentiments, and misinformation: An analysis of the Twitter discussion on the 2016 Austrian Presidential Elections","volume":"5","author":"Strembeck","year":"2018","journal-title":"Online Soc. Netw. Media"},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"24","DOI":"10.1016\/j.knosys.2014.05.008","article-title":"PoliTwi: Early detection of emerging political topics on Twitter and the impact on concept-level sentiment analysis","volume":"69","author":"Rill","year":"2014","journal-title":"Knowl.-Based Syst."},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"145038","DOI":"10.1016\/j.jclepro.2025.145038","article-title":"Decoding public sentiments on energy transition in Japan\u2019s three major metropolitan areas: Social media analysis using machine learning","volume":"495","author":"Sun","year":"2025","journal-title":"J. Clean. Prod."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"e57395","DOI":"10.2196\/57395","article-title":"Public health discussions on social media: Evaluating automated sentiment analysis methods","volume":"9","author":"Gandy","year":"2025","journal-title":"JMIR Form. Res."},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"104078","DOI":"10.1016\/j.irfa.2025.104078","article-title":"Political sentiment and corporate payouts","volume":"102","author":"Hossain","year":"2025","journal-title":"Int. Rev. Financ. Anal."},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"114570","DOI":"10.1016\/j.rser.2024.114570","article-title":"Sentiment analysis of the United States public support of nuclear power on social media using large language models","volume":"200","author":"Kwon","year":"2024","journal-title":"Renew. Sust. Energy Rev."},{"key":"ref_17","first-page":"3345","article-title":"Improving sentiment analysis in election-based conversations on Twitter with ElecBERT language model","volume":"76","author":"Khan","year":"2023","journal-title":"Comput. Mater. Contin."},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"6028","DOI":"10.1038\/s41598-025-86766-6","article-title":"High risk of political bias in black box emotion inference models","volume":"15","author":"Plisiecki","year":"2025","journal-title":"Sci. Rep."},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"203","DOI":"10.1007\/s10462-024-10831-1","article-title":"A review on emotion detection by using deep learning techniques","volume":"57","author":"Chutia","year":"2024","journal-title":"Artif. Intell. Rev."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"989","DOI":"10.1016\/j.procs.2024.10.327","article-title":"Investigation of challenges in aspect-based sentiment analysis enhanced using softmax function on Twitter during the 2024 Indonesian presidential election","volume":"245","author":"Tanoto","year":"2024","journal-title":"Procedia Comput. Sci."},{"key":"ref_21","doi-asserted-by":"crossref","first-page":"62","DOI":"10.1186\/s40537-019-0224-1","article-title":"A machine learning approach to analyze customer satisfaction from airline tweets","volume":"6","author":"Kumar","year":"2019","journal-title":"J. Big Data"},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"100232","DOI":"10.1016\/j.teler.2025.100232","article-title":"In-context learning for propaganda detection on Twitter Mexico using large language model Meta AI","volume":"19","year":"2025","journal-title":"Telemat. Inform. Rep."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"100242","DOI":"10.1016\/j.osnem.2023.100242","article-title":"Negativity spreads faster: A large-scale multilingual Twitter analysis on the role of sentiment in political communication","volume":"33","author":"Antypas","year":"2023","journal-title":"Online Soc. Netw. Media"},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"2801","DOI":"10.1007\/s43681-024-00588-2","article-title":"AI versus AI for democracy: Exploring the potential of adversarial machine learning to enhance privacy and deliberative decision-making in elections","volume":"5","author":"Auliya","year":"2025","journal-title":"AI Ethics"},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"e47826","DOI":"10.2196\/47826","article-title":"Using Natural Language Processing to Explore Social Media Opinions on Food Security: Sentiment Analysis and Topic Modeling Study","volume":"26","author":"Molenaar","year":"2024","journal-title":"J. Med. Internet Res."},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"101658","DOI":"10.1016\/j.giq.2021.101658","article-title":"Voting intentions on social media and political opinion polls","volume":"39","author":"Pekar","year":"2022","journal-title":"Gov. Inf. Q."},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"458","DOI":"10.1016\/j.dsm.2025.04.001","article-title":"Public sentiment analysis of roadway work zones using social media data and machine learning models","volume":"8","author":"Sayed","year":"2025","journal-title":"Data Sci. Manag."},{"key":"ref_28","doi-asserted-by":"crossref","first-page":"931","DOI":"10.1007\/s42979-024-03296-0","article-title":"Sentiment Analysis Using Improved CT-BERT_CONVLayer Fusion Model for COVID-19 Vaccine Recommendation","volume":"5","author":"Umair","year":"2024","journal-title":"SN Comput. Sci."},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"27788","DOI":"10.1038\/s41598-025-97778-7","article-title":"A hybrid deep learning model for sentiment analysis of COVID-19 tweets with class balancing","volume":"15","author":"Talukder","year":"2025","journal-title":"Sci. Rep."},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"176","DOI":"10.1186\/s40537-024-01014-4","article-title":"A hybrid Hadoop-based sentiment analysis classifier for tweets associated with COVID-19 utilizing two machine learning algorithms: CNN, and fuzzy C4.5","volume":"11","author":"Qadir","year":"2024","journal-title":"J. Big Data"},{"key":"ref_31","doi-asserted-by":"crossref","first-page":"24882","DOI":"10.1038\/s41598-024-76079-5","article-title":"A hybrid transformer and attention based recurrent neural network for robust and interpretable sentiment analysis of tweets","volume":"14","author":"Jahin","year":"2024","journal-title":"Sci. Rep."},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"30","DOI":"10.1186\/s13677-025-00753-w","article-title":"Optimized hybrid deep learning for cross-linguistic sentiment analysis: A novel approach","volume":"14","author":"Jain","year":"2025","journal-title":"J. Cloud Comput."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"110","DOI":"10.1186\/s40537-023-00781-w","article-title":"Sentiment analysis classification system using hybrid BERT models","volume":"10","author":"Talaat","year":"2023","journal-title":"J. Big Data"},{"key":"ref_34","doi-asserted-by":"crossref","first-page":"13407","DOI":"10.1007\/s10462-023-10472-w","article-title":"A systematic review of social network sentiment analysis with comparative study of ensemble-based techniques","volume":"56","author":"Tiwari","year":"2023","journal-title":"Artif. Intell. Rev."},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"1488","DOI":"10.1108\/OIR-02-2024-0111","article-title":"Scientific evidence and specific context: Leveraging large language models for health fact-checking","volume":"48","author":"Ni","year":"2024","journal-title":"Online Inf. Rev."},{"key":"ref_36","doi-asserted-by":"crossref","first-page":"3148","DOI":"10.1109\/TAI.2025.3567369","article-title":"TrumorGPT: Graph-Based Retrieval-Augmented Large Language Model for Fact-Checking","volume":"6","author":"Hang","year":"2025","journal-title":"IEEE Trans. Artif. Intell."},{"key":"ref_37","unstructured":"(2025, December 20). Hugging Face. Available online: https:\/\/huggingface.co\/."},{"key":"ref_38","unstructured":"Ca\u00f1ete, J., Chaperon, G., Fuentes, R., Ho, J.-H., Kang, H., and P\u00e9rez, J. (2020, January 26). Spanish Pre-Trained BERT Model and Evaluation Data. Proceedings of the Practical ML for Developing Countries Workshop, International Conference on Learning Representations ICLR 2020, Addis Ababa, Ethiopia."},{"key":"ref_39","unstructured":"Wang, W., Wei, F., Dong, L., Bao, H., Yang, N., and Zhou, M. (2020). MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers. arXiv."},{"key":"ref_40","unstructured":"(2026, January 12). MMG Xlm-Roberta-Base-sa-Spanish [Machine Learning Model]. Hugging Face, 2025. Available online: https:\/\/huggingface.co\/MMG\/xlm-roberta-base-sa-spanish."},{"key":"ref_41","unstructured":"UMUTeam (2026, January 13). Beto-Cased-Political-Agendas [Machine Learning Model]. Hugging Face, 2025. Available online: https:\/\/huggingface.co\/UMUTeam\/beto-cased-political-agendas."},{"key":"ref_42","unstructured":"Newtral (2026, January 13). Xlm-r-Finetuned-Toxic-Political-Tweets-es [Machine Learning Model]. Hugging Face, 2023. Available online: https:\/\/huggingface.co\/Newtral\/xlm-r-finetuned-toxic-political-tweets-es."},{"key":"ref_43","unstructured":"Venkatakrishnan, V., and Ramesh, R. (2026, January 14). Hate_Speech_Spanish_vk [Machine Learning Model]. Hugging Face, 2025. Available online: https:\/\/huggingface.co\/Venkatakrishnan-Ramesh\/Hate_speech_spanish_vk."},{"key":"ref_44","unstructured":"Tabularisai, S., Gyamfi, S., Borisov, V., and Schreiber, R.H. (2026, February 13). Multilingual-Sentiment-Analysis (Revision 69afb83) [Machine Learning Model]. Hugging Face, 2025. Available online: https:\/\/doi.org\/10.57967\/hf\/5968."},{"key":"ref_45","unstructured":"(2026, February 13). GPLSIUA Toxicity_Model_RoBERTa-Base-bne [Machine Learning Model]. Hugging Face, 2025. Available online: https:\/\/huggingface.co\/gplsi\/Toxicity_model."},{"key":"ref_46","unstructured":"Marianna13 (2026, February 13). Bert-Multilingual-Sentiment [Machine Learning Model]. Hugging Face, 2025. Available online: https:\/\/huggingface.co\/marianna13\/bert-multilingual-sentiment."},{"key":"ref_47","unstructured":"Montes-y-G\u00f3mez, M., Gonzalo, J., Rangel, F., Casavantes, M.\u00c1., \u00c1lvarez-Carmona, M.\u00c1., Bel-Enguix, G., Escalante, H.J., Freitas, L., Miranda-Escalada, A., and Rodr\u00edguez-S\u00e1nchez, F. (2022). Zero-shot Reading Comprehension and Reasoning for Spanish with BERTIN GPT-J-6B. Proceedings of the Iberian Languages Evaluation Forum (IberLEF 2022), CEUR-WS.org. CEUR Workshop Proceedings."},{"key":"ref_48","first-page":"13","article-title":"BERTIN: Efficient Pre-Training of a Spanish Language Model using Perplexity Sampling","volume":"68","author":"Ponferrada","year":"2022","journal-title":"Proces. Leng. Nat."},{"key":"ref_49","unstructured":"Laurer, M., van Atteveldt, W., Casas, A., and Welbers, K. (2026, February 13). Less Annotating, More Classifying\u2014Addressing the Data Scarcity Issue of Supervised Machine Learning with Deep Transfer Learning and BERT-NLI. OSF Preprints 2022. Available online: https:\/\/osf.io\/wqc86\/files\/74b8k."},{"key":"ref_50","unstructured":"Yuan, L. (2026, February 13). DistilBERT Base Multilingual Cased Sentiments Student [Machine Learning Model]. Hugging Face, 2023. Available online: https:\/\/huggingface.co\/lxyuan\/distilbert-base-multilingual-cased-sentiments-student."},{"key":"ref_51","unstructured":"Sanh, V., Debut, L., Chaumond, J., and Wolf, T. (2019). DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter. arXiv."},{"key":"ref_52","unstructured":"(2026, February 13). PlanTL-GOB-ES RoBERTa-Base-BNE [Machine Learning Model]. Hugging Face, 2025. Available online: https:\/\/huggingface.co\/PlanTL-GOB-ES\/roberta-base-bne."},{"key":"ref_53","doi-asserted-by":"crossref","unstructured":"Minaee, S., and Liu, Z. (2018). Automatic question-answering using a deep learning approach. arXiv.","DOI":"10.1109\/GlobalSIP.2017.8309095"}],"container-title":["Computation"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2079-3197\/14\/6\/127\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,6,1]],"date-time":"2026-06-01T08:34:51Z","timestamp":1780302891000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2079-3197\/14\/6\/127"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,5,31]]},"references-count":53,"journal-issue":{"issue":"6","published-online":{"date-parts":[[2026,6]]}},"alternative-id":["computation14060127"],"URL":"https:\/\/doi.org\/10.3390\/computation14060127","relation":{},"ISSN":["2079-3197"],"issn-type":[{"value":"2079-3197","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,5,31]]}}}