Four Lines, Different Deaths: Exploring the Classification of Humor in Calaveritas Poems

Authors

  • Victor Manuel Palma Instituto Politécnico Nacional. Centro de Investigación en Computación https://orcid.org/0000-0001-8711-1106
  • Liana Ermakova Université de Bretagne Occidentale, HCTI – EA 4249 https://orcid.org/0000-0002-7598-7474
  • Grigori Sidorov Instituto Politécnico Nacional. Centro de Investigación en Computación
  • Carolina Palma Preciado Instituto Politécnico Nacional. Centro de Investigación en Computación https://orcid.org/0000-0003-3253-4464

DOI:

https://doi.org/10.61467/2007.1558.2026.v17i3.1348

Keywords:

Humor, Poems, Calaveritas, Deep Learning, Humorous Text, BERT-like, Aprendizaje profundo, Textos humorísticos, Modelo similar a BERT

Abstract

Calaveritas are seen as a sort of poem or ode to the dead, since is a Mexican tradition linked to the Day of the death, in which through text you could see the personification of death and popular characters been mock and satirize, this topic is quite interesting because it have humor and the structure of the more serious poem. The classification of this textual genre could help locate text that contain humor with unconventional variants or structures and to preserver in a way this written scheme. To tackle this task, it was decided use a machine learning approach for the baseline, taking quite good results around 94% on the F1-score for the top methods of the baseline, in this case the main approach was to finetune Transformers like BETO or BERT-multilingual obtaining 98% and 97% on de F1-score and analyze the similarities and to observer the characteristic inherent to each class. The classes were quite separable since the calaveritas are more near related to humor than to the classical approach of poem, since the text of these classes contain words that are more easily identifiable. Given the observed degree of separability between classes, we sought to ensure that the classification was not primarily driven by topical information. To this end, we masked the most frequent words in each class as a preliminary control experiment, the produced results were broadly comparable to those obtained through fine-tuning our main models, suggesting that structural features may play a role in the classification process. In a way humour intervenes to create a poem-like structure with a humoristic content, A hybrid, perhaps.

Spanish-language metadata / Metadatos en español

Título en español:

Cuatro versos, diferentes muertes: un análisis de la clasificación del humor en los poemas de calaveritas


Resumen:

Las calaveritas se consideran una especie de poema u oda a los muertos, ya que se trata de una tradición mexicana vinculada al Día de los Muertos, en la que, a través del texto, se puede observar cómo se personifica a la muerte y se burlan y satirizan a personajes populares; este tema resulta bastante interesante porque combina el humor con la estructura de un poema más serio. La clasificación de este género textual podría ayudar a identificar textos que contengan humor con variantes o estructuras poco convencionales y a preservar de alguna manera este esquema escrito. Para abordar esta tarea, se decidió utilizar un enfoque de aprendizaje automático como referencia, obteniendo resultados bastante buenos, en torno al 94 % en el F1-score, para los mejores métodos de la referencia. En este caso, el enfoque principal consistió en ajustar modelos Transformers como BETO o BERT-multilingual, obteniendo un 98 % y un 97 % en el F1-score, así como en analizar las similitudes y observar las características inherentes a cada clase. Las clases resultaron bastante fáciles de separar, ya que las calaveritas se acercan más al humor que al enfoque clásico del poema, y el texto de estas clases contiene palabras más fáciles de identificar. Dado el grado de separabilidad observado entre las clases, nos propusimos asegurarnos de que la clasificación no se basara principalmente en información temática. Con este fin, ocultamos las palabras más frecuentes en cada clase como experimento de control preliminar; los resultados obtenidos fueron, en líneas generales, comparables a los obtenidos tras el ajuste fino de nuestros modelos principales, lo que sugiere que las características estructurales pueden influir en el proceso de clasificación. En cierto modo, el humor interviene para crear una estructura similar a la de un poema con un contenido humorístico; un híbrido, tal vez.

Palabras Claves:

Humor, Poemas, Calaveritas, Aprendizaje profundo, Textos humorísticos, Modelo similar a BERT

Smart citations:

https://scite.ai/reports/10.61467/2007.1558.2026.v17i3.1348
Dimensions.
Open Alex.

References

Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M., Kudlur, M., Levenberg, J., Monga, R., Moore, S., Murray, D. G., Steiner, B., Tucker, P., Vasudevan, V., Warden, P., & Zheng, X. (2016). TensorFlow: A system for large-scale machine learning. En Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16) (pp. 265–283). USENIX Association. https://www.usenix.org/conference/osdi16/technical-sessions/presentation/abadi

Argüelles, J. D. (2003, noviembre 2). La adulteración de las calaveras. La Jornada Semanal, 452. https://www.jornada.com.mx/2003/11/02/sem-domingo.html

Bengio, Y., Ducharme, R., Vincent, P., & Jauvin, C. (2003). A neural probabilistic language model. Journal of Machine Learning Research, 3, 1137–1155.

Bird, S., & Loper, E. (2004, julio). NLTK: The natural language toolkit. En Proceedings of the ACL Interactive Poster and Demonstration Sessions (pp. 214–217). Association for Computational Linguistics. https://aclanthology.org/P04-3031

Cañete, J., Chaperon, G., Fuentes, R., Ho, J.-H., Kang, H., & Pérez, J. (2020). Spanish pre-trained BERT model and evaluation data. En Proceedings of the PML4DC Workshop at ICLR 2020. https://users.dcc.uchile.cl/~jperez/papers/pml4dc2020.pdf

Cañete, J., Donoso, S., Bravo-Márquez, F., Carvallo, A., & Araujo, V. (2022). ALBETO and DistilBETO: Lightweight Spanish language models. En Proceedings of the Language Resources and Evaluation Conference (LREC 2022) (pp. 4291–4298). European Language Resources Association. https://aclanthology.org/2022.lrec-1.457/

Cer, D., Yang, Y., Kong, S., Hua, N., Limtiaco, N., St. John, R., Constant, N., Guajardo-Céspedes, M., Yuan, S., Tar, C., Sung, Y., Strope, B., & Kurzweil, R. (2018). Universal sentence encoder. En Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP 2018) (pp. 169–174). Association for Computational Linguistics. https://aclanthology.org/D18-2029/

De la Rosa, J., Ros, S., Pérez, Á., Díaz, A., Hernández, L., De Sisto, M., & González-Blanco, E. (2021). PoetryLab as infrastructure for the analysis of Spanish poetry. En Selected Papers from the CLARIN Annual Conference 2020 (Vol. 180, pp. 75–82). Linköping Electronic Conference Proceedings. https://doi.org/10.3384/ecp1809

Deng, S., Wang, G., Wang, H., & Chang, F. (2021). An artificial intelligence-driven Spanish poetry classification framework. Big Data and Cognitive Computing, 7(4), 183. https://doi.org/10.3390/bdcc7040183

Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. En Proceedings of NAACL-HLT 2019 (pp. 4171–4186). https://aclanthology.org/N19-1423/

Inácio, M. L., & Oliveira, H. G. (2023). Attempting to recognize humor via one-class classification. En Proceedings of the Iberian Languages Evaluation Forum (IberLEF 2023) (Vol. 3496). CEUR Workshop Proceedings. https://ceur-ws.org/Vol-3496/huhu-paper4.pdf

Jhamtani, H., Mehta, S. V., Carbonell, J., & Berg-Kirkpatrick, T. (2019). Learning rhyming constraints using structured adversaries. En Proceedings of EMNLP-IJCNLP 2019 (pp. 6025–6031). Association for Computational Linguistics. https://aclanthology.org/D19-1621/

Kesarwani, V., Inkpen, D., & Tănăsescu, C. (2021). #GraphPoem: Automatic classification of rhyme and diction in poetry. Interférences Littéraires / Literaire Interferenties, 25, 218–235.

Kolesnikova, O. (2025). Lexical function detection in Spanish collocations using transformer architecture. Computación y Sistemas, 29(2). https://doi.org/10.13053/cys-29-2-5620

Maiya, A. S. (2020). ktrain: A low-code library for augmented machine learning. Journal of Machine Learning Research, 23(158), 1–6. https://jmlr.org/papers/v23/21-1259.html

Marchi, R. M. (2022). Day of the Dead in the USA: The migration and transformation of a cultural phenomenon. Rutgers University Press.

Marco, G., De la Rosa, J., Gonzalo, J., Ros, S., & González-Blanco, E. (2021). Automated metric analysis of Spanish poetry: Two complementary approaches. IEEE Access, 9, 51734–51746. https://doi.org/10.1109/ACCESS.2021.3069635

Palma Preciado, V. M., Palma Preciado, C., & Sidorov, G. (2024, octubre 20). CalaveritasVsPOEMs [Dataset]. Hugging Face. https://huggingface.co/datasets/vpalma/CalaveritasVsPOEMs

Panda, B., Sen, R. K., Dash, L., Panigrahi, C. R., & Pati, B. (2025). Machine learning approaches to sentiment analysis in social networks using political tweets. Computación y Sistemas, 29(4). https://doi.org/10.13053/cys-29-4-4996

Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., VanderPlas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830. http://jmlr.org/papers/v12/pedregosa11a.html

Romero-González, M. (2018). Día de Muertos – Day of the Dead: A multicultural tradition. En Text Sets (pp. 177–184). Brill. https://doi.org/10.1163/9789004368323_016

Tang, H., Kamei, S., & Morimoto, Y. (2023). Data augmentation methods for enhancing robustness in text classification tasks. Algorithms, 16(1), 59. https://doi.org/10.3390/a16010059

Winters, T., & Delobelle, P. (2020). Dutch humor detection by generating negative examples. En Proceedings of the 32nd Benelux Conference on Artificial Intelligence (BNAIC 2020). https://doi.org/10.48550/arXiv.2010.13652

Winters, T., & Delobelle, P. (2021). Survival of the wittiest: Evolving satire with language models. En Proceedings of the 12th International Conference on Computational Creativity (ICCC 2021) (pp. 82–86).

Zhou, Q., Li, R., Xu, L., Nallanathan, A., Yang, J., & Fu, A. (2023). Towards explainable meta-learning for DDoS detection. SN Computer Science, 5, 115. https://doi.org/10.1007/s42979-023-02383-y

Downloads

Published

2026-06-12

How to Cite

Palma, V. M., Ermakova, L., Sidorov, G., & Palma Preciado, C. (2026). Four Lines, Different Deaths: Exploring the Classification of Humor in Calaveritas Poems. International Journal of Combinatorial Optimization Problems and Informatics, 17(3), 82–97. https://doi.org/10.61467/2007.1558.2026.v17i3.1348

Issue

Section

Articles