Sentiment Analysis in Psychotherapy in Brazilian Portuguese: The Role of Domain-Specific Fine-Tuning
Resumo
Text analysis has become an important tool in mental healthcare. However, the development of Natural Language Processing (NLP) applications for Brazilian Portuguese remains challenging, as most advanced pre-trained models are primarily designed for English and come from different domains than mental health. This study explores sentiment analysis in psychotherapy session transcripts using traditional NLP techniques, large language models, including the contextual model BERTimbau. We compare their performance on a pilot Brazilian labeled dataset of mental health dialogs. Results indicate that fine-tuning BERTimbau on domain-specific data, even when the available dataset is relatively small, significantly improves classification accuracy.Referências
Ali, A. and Renals, S. (2018). Word error rate estimation for speech recognition: eWER. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 20–24.
Bengio, Y., Lecun, Y., and Hinton, G. (2021). Deep learning for AI. Communications of the ACM, 64(7):58–65.
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020). Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901.
Brum, H. B. and Nunes, M. d. G. V. (2017). Building a sentiment corpus of tweets in Brazilian Portuguese. arXiv e-prints, pages arXiv–1712.
Calvo, R. A., Milne, D. N., Hussain, M. S., and Christensen, H. (2017). Natural language processing in mental health applications using non-clinical texts. Natural Language Engineering, 23(5):649–685.
Chollet, F. (2021). Deep learning with Python. Simon and Schuster.
da Fonseca Schuck, A., Garcia, G. L., Manesco, J. R. R., Paiola, P. H., and Papa, J. P. (2025). Evaluating large language models for brazilian portuguese sentiment analysis: A comparative study of multilingual state-of-the-art vs. brazilian portuguese fine-tuned llms. Journal of the Brazilian Computer Society, 31(1):884–916.
Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
Garcia, G. L., Paiola, P. H., Morelli, L. H., Candido, G., Júnior, A. C., Jodas, D. S., Afonso, L. C. S., Guilherme, I. R., Penteado, B. E., and Papa, J. P. (2024). Introducing bode: A fine-tuned large language model for Portuguese Prompt-Based Task.
Goldberg, S. B., Flemotomos, N., Martinez, V. R., Tanana, M. J., Kuo, P. B., Pace, B. T., Villatte, J. L., Georgiou, P. G., Van Epps, J., Imel, Z. E., et al. (2020). Machine learning and natural language processing in psychotherapy research: Alliance as example use case. Journal of counseling psychology, 67(4):438.
Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735–1780.
Kalinich, M., Luccarelli, J., Maria Jr, J. S., Williams, G., Moss, F., and Torous, J. (2026). Evaluating the effect of mental health fine-tuning relative to other model characteristics on LLM safety performance. medRxiv, pages 2026–01.
Levy, O. and Goldberg, Y. (2014). Linguistic regularities in sparse and explicit word representations. In Proceedings of the eighteenth conference on computational natural language learning, pages 171–180.
Liu, B. (2022). Sentiment analysis and opinion mining. Springer Nature.
Luna, A. S., Machado-Lima, A., and Nunes, F. L. (2022). Analysis of transcription tools for Brazilian Portuguese with focus on disfluency detection. In Proceedings of the 21st Brazilian Symposium on Human Factors in Computing Systems, pages 1–10.
Panchbhai, B. S. and Pathak, V. M. (2022). A Systematic Review of Natural Language Processing in Healthcare. Journal of Algebraic Statistics, 13(1).
Picard, R. W. (2000). Affective computing. MIT press.
Pires, R., Abonizio, H., Almeida, T. S., and Nogueira, R. (2023). Sabiá: Portuguese Large Language Models. In Naldi, M. C. and Bianchi, R. A. C., editors, Intelligent Systems, pages 226–240, Cham. Springer Nature Switzerland.
Radford, A., Kim, J. W., Xu, T., Brockman, G., McLeavey, C., and Sutskever, I. (2023). Robust speech recognition via large-scale weak supervision. In International conference on machine learning, pages 28492–28518. PMLR.
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. (2019). Language models are unsupervised multitask learners. OpenAI blog, 1(8):9.
Souza, F., Nogueira, R., and Lotufo, R. (2020). BERTimbau: Pretrained BERT models for Brazilian Portuguese. In Cerri, R. and Prati, R. C., editors, Intelligent Systems, pages 403–417, Cham. Springer International Publishing.
Tao, J. and Tan, T. (2005). Affective computing: A review. In International Conference on Affective computing and intelligent interaction, pages 981–995. Springer.
Van Der Veen, A. M. and Bleich, E. (2025). The advantages of lexicon-based sentiment analysis in an age of machine learning. PloS one, 20(1):e0313092.
Yosef, S., Zisquit, M., Cohen, B., Klomek, A. B., Bar, K., and Friedman, D. (2025). The impact of fine-tuning LLMs on the quality of automated therapy assessed by digital patients. npj Mental Health Research, 4(1):43.
Bengio, Y., Lecun, Y., and Hinton, G. (2021). Deep learning for AI. Communications of the ACM, 64(7):58–65.
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020). Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901.
Brum, H. B. and Nunes, M. d. G. V. (2017). Building a sentiment corpus of tweets in Brazilian Portuguese. arXiv e-prints, pages arXiv–1712.
Calvo, R. A., Milne, D. N., Hussain, M. S., and Christensen, H. (2017). Natural language processing in mental health applications using non-clinical texts. Natural Language Engineering, 23(5):649–685.
Chollet, F. (2021). Deep learning with Python. Simon and Schuster.
da Fonseca Schuck, A., Garcia, G. L., Manesco, J. R. R., Paiola, P. H., and Papa, J. P. (2025). Evaluating large language models for brazilian portuguese sentiment analysis: A comparative study of multilingual state-of-the-art vs. brazilian portuguese fine-tuned llms. Journal of the Brazilian Computer Society, 31(1):884–916.
Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
Garcia, G. L., Paiola, P. H., Morelli, L. H., Candido, G., Júnior, A. C., Jodas, D. S., Afonso, L. C. S., Guilherme, I. R., Penteado, B. E., and Papa, J. P. (2024). Introducing bode: A fine-tuned large language model for Portuguese Prompt-Based Task.
Goldberg, S. B., Flemotomos, N., Martinez, V. R., Tanana, M. J., Kuo, P. B., Pace, B. T., Villatte, J. L., Georgiou, P. G., Van Epps, J., Imel, Z. E., et al. (2020). Machine learning and natural language processing in psychotherapy research: Alliance as example use case. Journal of counseling psychology, 67(4):438.
Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735–1780.
Kalinich, M., Luccarelli, J., Maria Jr, J. S., Williams, G., Moss, F., and Torous, J. (2026). Evaluating the effect of mental health fine-tuning relative to other model characteristics on LLM safety performance. medRxiv, pages 2026–01.
Levy, O. and Goldberg, Y. (2014). Linguistic regularities in sparse and explicit word representations. In Proceedings of the eighteenth conference on computational natural language learning, pages 171–180.
Liu, B. (2022). Sentiment analysis and opinion mining. Springer Nature.
Luna, A. S., Machado-Lima, A., and Nunes, F. L. (2022). Analysis of transcription tools for Brazilian Portuguese with focus on disfluency detection. In Proceedings of the 21st Brazilian Symposium on Human Factors in Computing Systems, pages 1–10.
Panchbhai, B. S. and Pathak, V. M. (2022). A Systematic Review of Natural Language Processing in Healthcare. Journal of Algebraic Statistics, 13(1).
Picard, R. W. (2000). Affective computing. MIT press.
Pires, R., Abonizio, H., Almeida, T. S., and Nogueira, R. (2023). Sabiá: Portuguese Large Language Models. In Naldi, M. C. and Bianchi, R. A. C., editors, Intelligent Systems, pages 226–240, Cham. Springer Nature Switzerland.
Radford, A., Kim, J. W., Xu, T., Brockman, G., McLeavey, C., and Sutskever, I. (2023). Robust speech recognition via large-scale weak supervision. In International conference on machine learning, pages 28492–28518. PMLR.
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. (2019). Language models are unsupervised multitask learners. OpenAI blog, 1(8):9.
Souza, F., Nogueira, R., and Lotufo, R. (2020). BERTimbau: Pretrained BERT models for Brazilian Portuguese. In Cerri, R. and Prati, R. C., editors, Intelligent Systems, pages 403–417, Cham. Springer International Publishing.
Tao, J. and Tan, T. (2005). Affective computing: A review. In International Conference on Affective computing and intelligent interaction, pages 981–995. Springer.
Van Der Veen, A. M. and Bleich, E. (2025). The advantages of lexicon-based sentiment analysis in an age of machine learning. PloS one, 20(1):e0313092.
Yosef, S., Zisquit, M., Cohen, B., Klomek, A. B., Bar, K., and Friedman, D. (2025). The impact of fine-tuning LLMs on the quality of automated therapy assessed by digital patients. npj Mental Health Research, 4(1):43.
Publicado
19/10/2026
Como Citar
VASCONCELOS, Lucas M.; CORCHS, Felipe; NUNES, Fátima L. S.; MACHADO-LIMA, Ariane.
Sentiment Analysis in Psychotherapy in Brazilian Portuguese: The Role of Domain-Specific Fine-Tuning. In: ENCONTRO NACIONAL DE INTELIGÊNCIA ARTIFICIAL E COMPUTACIONAL (ENIAC), 23. , 2026, Cuiabá/MT.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2026
.
p. 1-12.
ISSN 2763-9061.
DOI: https://doi.org/10.5753/eniac.2026.26009.
