Named Entity Recognition and Structured Information Extraction in TCE/RN Rulings with Large Language Models
Named Entity Recognition; Large Language Models; Courts of Accounts; Natural Language Processing; Information Extraction.
The decisions issued by Courts of Accounts carry normative force and considerable potential for fiscal and administrative impact, yet they remain predominantly stored as unstructured text, which hinders the systematic monitoring of compliance with the rulings issued. This work investigates how to reliably extract structuring decision elements fine, obligation, recommendation, and reimbursement — from the unstructured text of these decisions, adopting the Court of Accounts of the State of Rio Grande do Norte (TCE/RN) as a case study. To this end, decicontas.br was built, an annotated Named Entity Recognition (NER) corpus comprising 861 real TCE/RN decisions, of which 232 contain at least one entity, totaling 459 entities. Annotation quality was audited using confident learning. A controlled empirical comparison was conducted among nine large language models (LLMs) in a few-shot setting and four supervised models fine-tuned to the domain (BiLSTM-CRF, BERTimbau base and large, and Legal-BERTimbau), further evaluating two structured-output mechanisms and three prompting techniques. The evaluation adopted macro-averaged span-level F1 (IoU ≥ 0.5) as the primary metric, and uncertainty was quantified using a paired document-level bootstrap. The results indicate that an open-weights model led in performance, in a statistical tie with the best proprietary model, and that the LLMs significantly outperformed the supervised baselines on the minority classes, a finding interpreted as sample efficiency in a lowannotation-volume regime. The central contribution of this work lies in the public corpus and the controlled comparative evidence, of which a structured extraction tool with relational-database persistence constitutes the applied extension.