LegalIA

Artificial intelligence for the Mexican legal domain

Legal artificial intelligence has advanced fastest where open corpora and specialized language models exist. For Mexican law, those resources are still missing. LegalIA, a project by INGEOTEC, sets out to build them.

Over four decades the field of artificial intelligence and law has moved from the symbolic modeling of legal reasoning to data-driven methods in which language models support classification, summarization, argument mining and the prediction of judicial outcomes (Graff and Llamas Covarrubias 2026). That progress has been uneven: the corpora behind it originate mostly in the European Union and the United States, Spanish appears in them only as one language among many, and there is no open, standardized repository — nor openly available models — that capture the structure, style and complexity of Mexican law. LegalIA addresses that gap on three fronts.

Open datasets

Corpora that document the Mexican legal system — standardized, openly available, and built for reproducible research.

Specialized models

Language models trained on Mexican legal text, released openly so that research and applications can build on them.

The research team

Mario Graff
INFOTEC/SECIHTI

Jersain Zadamig Llamas Covarrubias
Universidad de Guadalajara

Daniela Moctezuma
CentroGEO

Eric Sadit Tellez
INFOTEC/SECIHTI

Guillermo Ruiz
INFOTEC

The group brings more than a decade of work on natural language processing for Spanish: automated text categorization (Tellez et al. 2018), multilingual sentiment analysis (Tellez, Miranda-Jiménez, Graff, Moctezuma, Suárez, et al. 2017; Graff et al. 2020), the text transformations that matter when processing informal Spanish (Tellez, Miranda-Jiménez, Graff, Moctezuma, Siordia, et al. 2017), large-scale exploratory analysis of text collections (Graff et al. 2022), and evidence that lexical representations remain competitive across a myriad of classification challenges (Graff et al. 2025). Of direct relevance to LegalIA, it has built regionalized word embeddings and BERT models that capture the variations of Spanish across twenty-six Spanish-speaking regions (Tellez et al. 2023) — experience in creating, from raw text, precisely the kind of specialized resources this project requires.

The team also works on the bridge between machine learning and regulation: a taxonomic proposal of regulatory approaches to artificial intelligence (Llamas Covarrubias et al. 2022), a review of the discipline’s trajectory in the legal domain (Graff and Llamas Covarrubias 2026), and a treatment of its foundations oriented to rigorous and auditable evaluation (Tellez et al. 2026). The publications that support the project are collected in the References page.

First steps

The project is underway, and its starting point — the beginning of the collection, not its full extent — is the Diario Oficial de la Federación (DOF), the official gazette of the Mexican State: more than 1.2 million notas published without interruption since 1917. The collection of the data is facilitated by nota2md, which turns an individual note into Markdown from its official HTML or by OCR of its scanned pages, accompanied by dofjson and dof2md; a guided walkthrough is presented in From the gazette to Markdown. The resulting archive of daily note indices — what it contains, and how it is kept growing — is documented in The DOF note archive.

A first analysis examines the titles of the Diario Oficial, the gazette’s most elementary metadata; that page will be updated with the complete data up to December 2025, so that its figures describe full calendar years. Every page on this site, including this one, is a Jupyter notebook that can be executed outside the site — for instance on Google Colab.

Colophon

As with the rest of the project, this site was built by the LegalIA team together with Claude, Anthropic’s coding assistant, through Claude Code: the assistant helped set up the Quarto site and draft this page, with the authors reviewing and validating every change before it was committed.