Back to search

Universidade de Coimbro

Language Models for Legal Domain Tasks in Portuguese

Abstract

dc:description.abstract

The increasing complexity and volume of legislation, as a reflection of the modernisation of society, pose significant consequences for judicial systems, such as prolonged duration of proceedings. For this reason, there is an urgent need for technological innovation. In this context, Natural Language Processing (NLP) has emerged as a promising tool to support legal professionals by automating and enhancing tasks such as document annotation and classification. This work investigates the application of modern NLP methodologies to legal domain tasks in Portuguese, focusing on the annotation of legal entities and the classification of legal documents through the assignment of legal descriptors.The work is developed within the scope of the AI4JURIS project and addresses two complementary objectives. For the Named Entity Recognition (NER) task, an in-context learning (ICL) approach using Large Language Models (LLMs) is explored, motivated by the limited availability of annotated corpora. Prompt engineering strategies are evaluated to assess their effectiveness for NER in the Portuguese legal domain. In contrast, for the classification task, a large annotated corpus is available. Moreover, the problem can be framed as an Extreme Multi-label Classification (XMLC) task due to the extremely large and unbalanced label space, which poses challenges that make it difficult to address using traditional Machine Learning (ML) methods. Therefore, the proposed solution does not treat the task purely as a classification problem. Specifically, we follow a two-stage methodology, in which candidate descriptors are freely generated from the input legal document and then each generated descriptor is mapped to the predefined label space. Based on this, the work enables a comprehensive comparison between unsupervised, prompting-based, and fine-tuning approaches.Our findings highlight the potential of prompt-based methods to address data scarcity, while also showing that fine-tuning smaller models can outperform much larger general-purpose models in domain-specific settings. Overall, this thesis contributes to the scientific community by providing a study of state-of-the-art methodologies, presenting their applicability to the legal domain, and delivering innovations intended for daily use by legal professionals within the context of the project.

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Medeiros, Giovanni Maffeo de
Advisor dc:contributor.advisor
  • Oliveira, Hugo Ricardo Gonçalo

Subjects

dc:subject × 10

Rights

dc:rights
Statement dc:rights
  • openAccess
Language dc:language.iso
eng

Identifiers

dc:identifier.*
Dc Identifier Tid
204414008

Chain of custody

source
Harvested from
Universidade de Coimbro
Base URL
estudogeral.sib.uc.pt/oai/request
Last updated
2026-11-26
Source record
OAI-PMH GetRecord
citation

Medeiros, Giovanni Maffeo de. Language Models for Legal Domain Tasks in Portuguese. 2026. https://hdl.handle.net/10316/124729