Decisões Judiciais Automatizadas: Sistema Baseado em Programação, Templates e IA Generativa
Autores
Silva Filho, Antonio Carlos Ferreira da
Orientador
Trecenti, Julio Adolfo Zucon
Co-orientadores
Citações na Scopus
Tipo de documento
Relatório de Iniciação Científica
Data
2025
Resumo
O aumento contínuo do volume processual e a necessidade de padronização de
textos gerados em decisões judiciais ou outros documentos no meio jurídico motivam
até hoje diversas tentativas de criar ferramentas de automação de documentos.
Modelos de linguagem de larga escala (LLMs) ampliam o potencial de automação,
mas a geração direta de texto traz riscos de alucinação e dificuldades de verificação
que podem ser tão grandes quanto os potenciais ganhos de produtividade. Este
trabalho propõe uma abordagem intermediária, o tipo human in the loop (HITL) que
transforma o problema de redação automática por um problema de geração de
códigos, capaz de criar de documentos em Microsoft Word, usando exclusivamente
conteúdos previamente elaborados por humanos. O trabalho fornece três
contribuições principais: um esquema de marcação em diferentes estruturas baseado
em tags; um prompt estruturado que, a partir de um documento anotado e um conjunto
de metadados, produz um código na linguagem de programação Python capaz de
gerar novos documentos, preservando formatação, marcações e aplicar regras de
complexas, baseadas no contexto e variáveis definidas no template fornecido; uma
aplicação interativa na web para configuração de templates parametrizados, geração
de códigos usando LLMs e criação dos documentos a partir do preenchimento de um
formulário criado automaticamente. Em avaliação exploratória com especialistas em
decisões judiciais, a estratégia mostrou viabilidade prática, reduzindo alucinações ao
restringir a saída ao espaço definido pelas anotações e padronizando trechos
repetitivos de decisões. As limitações concentram-se na qualidade da anotação e na
cobertura de variações em problemas de borda. A abordagem é replicável para outros
tipos de documentos, como contratos, petições e despachos repetitivos, podendo
impactar positivamente na produtividade de diversos atores do sistema de justiça.
The continuous growth in case volume and the need to standardize texts produced in judicial decisions and other legal documents have long motivated attempts to build document automation tools. Large Language Models (LLMs) expand the automation frontier, but direct text generation increases hallucination risks and verification burdens that can offset productivity gains. This work proposes an intermediate, human in the loop (HITL) approach that reframes the automatic drafting problem as a code generation problem, aiming to create Microsoft Word documents using exclusively human authored content. It offers three main contributions: a tag based markup scheme for multiple structural layers; a structured prompt that, given an annotated document and metadata, produces Python code capable of generating new documents while preserving formatting, and applying complex, context dependent rules based on variables of the template; and a web based interactive application for configuring parameterized templates, generating code via LLMs, and instantiating documents from an automatically generated form. In an exploratory evaluation with specialists in judicial decisions, the strategy proved practically viable: it reduced hallucinations by constraining outputs to the annotated space and standardized repetitive sections of decisions while keeping humans in control of the final content. Limitations center on annotation quality and coverage of edge cases. The approach is replicable for other document types, such as contracts and routine orders, and can positively impact the productivity of various actors across the justice system
The continuous growth in case volume and the need to standardize texts produced in judicial decisions and other legal documents have long motivated attempts to build document automation tools. Large Language Models (LLMs) expand the automation frontier, but direct text generation increases hallucination risks and verification burdens that can offset productivity gains. This work proposes an intermediate, human in the loop (HITL) approach that reframes the automatic drafting problem as a code generation problem, aiming to create Microsoft Word documents using exclusively human authored content. It offers three main contributions: a tag based markup scheme for multiple structural layers; a structured prompt that, given an annotated document and metadata, produces Python code capable of generating new documents while preserving formatting, and applying complex, context dependent rules based on variables of the template; and a web based interactive application for configuring parameterized templates, generating code via LLMs, and instantiating documents from an automatically generated form. In an exploratory evaluation with specialists in judicial decisions, the strategy proved practically viable: it reduced hallucinations by constraining outputs to the annotated space and standardized repetitive sections of decisions while keeping humans in control of the final content. Limitations center on annotation quality and coverage of edge cases. The approach is replicable for other document types, such as contracts and routine orders, and can positively impact the productivity of various actors across the justice system
Palavras-chave
automação de documentos jurídicos; modelos de linguagem; human in the loop; interface web; inteligência artificial; legal document assembly; large language models; artificial intelligence; web interface
Titulo de periódico
URL da fonte
Título de Livro
URL na Scopus
Sinopse
Objetivos de aprendizagem
Idioma
Português
Notas
Membros da banca
Área do Conhecimento CNPQ
CIENCIAS SOCIAIS APLICADAS
CIENCIAS SOCIAIS APLICADAS::DIREITO
CIENCIAS SOCIAIS APLICADAS::DIREITO