LexIris-pt and LexBert-pt: Specialized Sentence Embeddings for Legal Similarity in Brazilian Portuguese
Paper · 2026 · Willgnner Ferreira Santos, João Gabriel Grandotto Viana, Antônio Pires de Castro Júnior et al.
Summary
Brazilian courts handle huge numbers of lawsuits, and many initial petitions repeat the same facts and legal arguments. This produces repetitive claims and, at worst, predatory litigation, which are slow and inconsistent to triage by hand. The authors build sentence embedding models for Portuguese legal similarity using 20,000 first-instance initial petitions from the Court of Justice of Goiás (TJGO). The petitions were supplied through the BERNA system, which pairs each document with its most similar counterpart.
They compare three settings:
- zero-shot similarity with pretrained encoders;
- supervised fine-tuning on petition pairs;
- vector retrieval with HNSW indexing in Milvus plus threshold-based incremental clustering.
Fine-tuning reliably raised correlation with the reference similarity scores and improved retrieval. The choice of index metric (cosine or inner product) changed how finely the collection was partitioned, even at a fixed threshold. The encoder, metric and threshold therefore need to be calibrated together.
After expert audit, two fine-tuned models, LexIris-pt and LexBert-pt, were adopted at TJGO for claim screening. They are publicly released, which makes them a practical resource for Portuguese legal NLP.
Key points
- Corpus: 20,000 anonymized initial petitions, each with four fields: Paradigm Facts, Similar Facts, Paradigm Legal Basis and Similar Legal Basis. Access is on request only, under LGPD and CNJ Resolution No. 615/2025.
- Data split: 10,000 documents for fine-tuning (80/16/4 train/validation/test, seed 42) and a 10,000-document holdout for indexing. Zero-shot evaluation used 500 pairs from the holdout.
- Truncation: inputs were cut at 512 tokens, with no windowing. Roughly 61–62% of Facts fields and about 79% of Legal Basis fields exceed that length under the BERTimbau tokenizer.
- Models: LexIris-pt is derived from STJ Iris and LexBert-pt from BERTimbau Large. Both are published on Hugging Face under DIACDE.
- Limitations: the data come from a single jurisdiction, there is no end-to-end latency or cost measurement, and drift and fairness were not assessed.
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksSocial Sciences · 1,772 worksLaw · 77 works
🧭 Topics 1Research subjects and languages the work is about.Legal AI · 134 works
Cite
Cite as Willgnner Ferreira Santos, João Gabriel Grandotto Viana, Antônio Pires de Castro Júnior, Fernando Ribeiro Trindade and Nádia Félix Felipe da Silva. 2026. LexIris-pt and LexBert-pt: Specialized Sentence Embeddings for Legal Similarity in Brazilian Portuguese. Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026) - Vol. 1.
@inproceedings{santos2026lexiris,
title = {{LexIris-pt and LexBert-pt: Specialized Sentence Embeddings for Legal Similarity in Brazilian Portuguese}},
author = {Willgnner Ferreira Santos, João Gabriel Grandotto Viana, Antônio Pires {de Castro Júnior}, Fernando Ribeiro Trindade and Nádia Félix Felipe {da Silva}},
booktitle = {Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026) - Vol. 1},
year = {2026},
url = {https://aclanthology.org/2026.propor-1.53/}
}References
- Bruna Armonas Colombo, Pedro Buck, and Vinicius Miana Bezerra. 2017. Challenges when using jurimetrics in brazil—a survey of courts. Future Internet, 9(4):68. ↗
- Mina Ghadimi Atigh, Stephanie Nargang, Martin Keller-Ressel, and Pascal Mettes. 2025. Simzsl: Zero-shot learning beyond a pre-defined semantic embedding space. International Journal of Computer Vision, pages 1–17. ↗
- Iz Beltagy, Kyle Lo, and Arman Cohan. 2019. Scibert: A pretrained language model for scientific text. Preprint, arXiv:1903.10676. ↗
- Murillo Simiema Campos. 2022. O uso da inteligência artificial no poder judiciário: as contribuições do sistema berna para o tribunal de justiça de goiás. find
- Caio Castelliano, Tomas Aquino Guimaraes, and Adalmir de Oliveira Gomes. 2024. Fatores que aumentam o tempo do processo judicial no brasil. Revista de Administração Pública, 58:e2023–0175. ↗
- Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras, and Ion Androutsopoulos. 2020. Legal-bert: The muppets straight out of law school. Preprint, arXiv:2010.02559. ↗
- Ilias Chalkidis, Abhik Jana, Dirk Hartung, Michael Bommarito, Ion Androutsopoulos, Daniel Katz, and Nikolaos Aletras. 2022. Lexglue: A benchmark dataset for legal language understanding in english. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4310–4330, Dublin, Ireland. Association for Computational Linguistics. ↗
- Conselho Nacional de Justiça (Brasil). 2025. Resolution no. 615 of march 11, 2025. Atos Normativos do Conselho Nacional de Justiça. Accessed on: 9 dez. 2025. find
- Daniel da Silva Junior, Paulo Roberto dos Santos Corval, Daniel de Oliveira, and Aline Paes. 2024. Datasets for portuguese legal semantic textual similarity. Journal of Information and Data Management, 15(1):206– 215. ↗
- Harshil Darji, Jelena Mitrović, and Michael Granitzer. 2021. Exploring semantic similarity between german legal texts and referred laws. In International Joint Conference on Knowledge Discovery, Knowledge Engineering, and Knowledge Management, pages 37– 50. Springer. find
- Graziella De Martino, Gianvito Pio, and Michelangelo Ceci. 2023. Multi-view overlapping clustering for the identification of the subject matter of legal judgments. Information Sciences, 638:118956. ↗
- Raphael Souza de Oliveira and Erick Giovani Speran-dio Nascimento. 2021. Clustering by similarity of brazilian legal documents using natural language processing approaches. In Data clustering. IntechOpen. ↗
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pages 4171–4186. ↗
- Mingqiang Guo, Ying Huang, Qingfeng Guan, Zhong Xie, and Liang Wu. 2017. An efficient data organization and scheduling strategy for accelerating large vector data rendering. Transactions in GIS, 21(6):1217–1236. ↗
- Suchin Gururangan, Ana Marasović, Swabha Swayamdipta, Kyle Lo, Iz Beltagy, Doug Downey, and Noah A. Smith. 2020. Don’t stop pretraining: Adapt language models to domains and tasks. Preprint, arXiv:2004.10964. ↗
- Sarika Jain, Deepak Jaglan, and Kapil Gupta. 2022. Investigating the similarity of court decisions. ACI@ ISIC, pages 316–326. find
- Jinhyuk Lee, Wonjin Yoon, Sungdong Kim, Donghyeon Kim, Sunkyu Kim, Chan Ho So, and Jaewoo Kang. 2019. Biobert: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 36(4):1234–1240. ↗
- Tiago Lima, Kellyton Brito, André CA Nascimento, George Valença, and Fábio Pedrosa. 2022. Using natural language processing to improve transparency by enhancing the understanding of legal decisions. In EGOV-CeDEM-ePart-*. find
- George C Linderman and Stefan Steinerberger. 2019. Clustering with t-sne, provably. SIAM journal on mathematics of data science, 1(2):313–332. ↗
- Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692. ↗
- Laila Neves Lorenzon. 2021. Análise comparada entre regulamentações de dados pessoais no brasil e na união europeia (lgpd e gdpr) e seus respectivos instrumentos de enforcement. Revista do Programa de Direito da União Europeia, 1:39–52. find
- Maria Duarte, Pedro A Santos, João Dias, and Jorge Baptista. 2022. Semantic norm recognition and its application to portuguese law. arXiv preprint arXiv:2203.05425. ↗
- E Fonseca, L Santos, Marcelo Criscuolo, and S Aluisio. 2016. Assin: Avaliacao de similaridade semantica e inferencia textual. In Computational Processing of the Portuguese Language-12th International Conference, Tomar, Portugal, pages 13–15. find
- Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2022. Simcse: Simple contrastive learning of sentence embeddings. Preprint, arXiv:2104.08821. ↗
- Eduardo Garcia, Nadia Silva, Felipe Siqueira, Juliana Gomes, Hidelberg O Albuquerque, Ellen Souza, Eliomar Lima, and André de Carvalho. 2024. Rober-talexpt: A legal roberta model pretrained with deduplication for portuguese. In Proceedings of the 16th International Conference on Computational Processing of Portuguese-Vol. 1, pages 374–383. find
- Angelina Grace. 2025. Leveraging natural language processing (nlp) for intelligent incident ticket classification. find
- Yu A Malkov and Dmitry A Yashunin. 2018. Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. IEEE transactions on pattern analysis and machine intelligence, 42(4):824–836. ↗
- Arpan Mandal, Kripabandhu Ghosh, Saptarshi Ghosh, and Sekhar Mandal. 2021. Unsupervised approaches for measuring textual similarity between legal court case reports. Artificial Intelligence and Law, 29(3):417–451. ↗
- Arooba Maqsood, Adnan Ul-Hasan, and Faisal Shafait. 2024. Transformer-based architecture for judgment prediction and explanation in legal proceedings. In International Workshop on Document Analysis Systems, pages 20–36. Springer. find
- Philip May. 2021. Machine translated multilingual sts benchmark dataset. find
- Leland McInnes, John Healy, Steve Astels, and 1 others. 2017. hdbscan: Hierarchical density based clustering. J. Open Source Softw., 2(11):205.
- Leland McInnes, John Healy, and James Melville. 2018. Umap: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426. ↗
- Rui Melo, Pedro A. Santos, and João Dias. 2023. A semantic search system for the supremo tribunal de justiça. In Progress in Artificial Intelligence, pages 142–154, Cham. Springer Nature Switzerland. find
- Fatemehsadat Mireshghallah, Archit Uniyal, Tianhao Wang, David Evans, and Taylor Berg-Kirkpatrick. 2022. Memorization in nlp fine-tuning methods. arXiv preprint arXiv:2205.12506. ↗
- Maheshwaran Nithya, S Harini, S Kavyadharshini, and K Srinidhi. 2024. Ai-driven legal automation to enhance legal processes with natural language processing. In 2024 International Conference on IoT Based Control Networks and Intelligent Systems (ICICNIS), pages 1246–1253. IEEE. find
- Joshua Page and Joe Soss. 2021. The predatory dimensions of criminal justice. Science, 374(6565):291– 294. ↗
- Felipe Maia Polo, Gabriel Caiaffa Floriano Mendonça, Kauê Capellato J Parreira, Lucka Gianvechio, Peterson Cordeiro, Jonathan Batista Ferreira, Leticia Maria Paz de Lima, Antônio Carlos do Amaral Maia, and Renato Vicente. 2021. Legalnlp–natural language processing methods for the brazilian legal language. arXiv preprint arXiv:2110.15709. ↗
- Livy Real, Erick Fonseca, and Hugo Goncalo Oliveira. 2020. The assin 2 shared task: a quick overview. In International Conference on Computational Processing of the Portuguese Language, pages 406–412. Springer. find
- Nils Reimers and Iryna Gurevych. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks. Preprint, arXiv:1908.10084. ↗
- Patrick Fernandes Rezende Ribeiro, Juliane de Lima Pires, Patrick Alves Bastos, Roberto Rigo, Henrique Assumpção dos Reis, Kamilly Voitkiv Hubner, Maria Fernanda Zandoná Casagrande, Bruno de Paula Marafiga, Dante Krol Simba, and Denise Fukumi Tsunoda. 2025. Bancos vetoriais e modelos de embedding: Avaliação comparativa de desempenho na recuperação semântica em língua portuguesa. Research, Society and Development, 14(10):e106141049768–e106141049768. ↗
- Daniel da Silva Junior, Daniel de Oliveira, and Aline Paes. 2025. Evaluating text representations for unsupervised legal semantic textual similarity in brazilian portuguese. Discover Data, 3(1):23. ↗
- Raquel Silveira, Caio Ponte, Vitor Almeida, Vládia Pinheiro, and Vasco Furtado. 2023. Legalbert-pt: A pre-trained language model for the brazilian portuguese legal domain. In Brazilian Conference on Intelligent Systems, pages 268–282. Springer. find
- Saurabh Kumar Singh and Radhe Shyam Jha. 2024. Legal framework vs. practical realities: The effectiveness of fast track courts in achieving speedy justice. Issue 3 Int’l JL Mgmt. & Human., 7:2117. find
- Fábio Souza, Rodrigo Nogueira, and Roberto Lotufo. 2020. Bertimbau: pretrained bert models for brazilian portuguese. In Brazilian conference on intelligent systems, pages 403–417. Springer. find
- Daniela Vianna, Edleno Silva de Moura, and Altigran Soares da Silva. 2024. A topic discovery approach for unsupervised organization of legal document collections. Artificial Intelligence and Law, 32(4):1045–1074. ↗
- Carolina Castro Costa Viegas. 2022. Dos limites do dever de informar e do dever de informar-se: análise a partir do impacto da assimetria da informação no direito contratual. Ph.D. thesis, Universidade de São Paulo. ↗
- Charles FO Viegas, Bruno C Costa, and Renato P Ishii. 2023. Jurisbert: a new approach that converts a classification corpus into an sts one. In International Conference on Computational Science and Its Applications, pages 349–365. Springer. find
- Liang Wang, Nan Yang, Xiaolong Huang, Linjun Yang, Rangan Majumder, and Furu Wei. 2024. Multilingual e5 text embeddings: A technical report. Preprint, arXiv:2402.05672. ↗
- Ashwini V Zadgaonkar and Avinash J Agrawal. 2021. An overview of information extraction techniques for legal document analysis and processing. International Journal of Electrical & Computer Engineering (2088-8708), 11(6). ↗
- Rodrigo Amorim Ruiz. 2021. Jurisprudence search based on facts similarity using NLP and ML techniques. Ph.D. thesis, Universidade de São Paulo. ↗
- Jaakko Sauvola, Sasu Tarkoma, Mika Klemettinen, Jukka Riekki, and David Doermann. 2024. Future of software development with generative ai. Automated Software Engineering, 31(1):26. ↗
- Hendrik Schuff, Lindsey Vanderlyn, Heike Adel, and Ngoc Thang Vu. 2023. How to do human evaluation: A brief introduction to user studies in nlp. Natural Language Engineering, 29(5):1199–1222. ↗
- Luciano Zanuz and Sandro José Rigo. 2022. Fostering judiciary applications with new fine-tuned models for legal named entity recognition in portuguese. In International Conference on Computational Processing of the Portuguese Language, pages 219–229. Springer. find
- Lucia Zheng, Neel Guha, Brandon R Anderson, Peter Henderson, and Daniel E Ho. 2021. When does pre-training help? assessing self-supervised learning for law and the casehold dataset of 53,000+ legal holdings. In Proceedings of the eighteenth international conference on artificial intelligence and law, pages 159–168. find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/santos-2026-lexiris-pt-lexbert-pt-specialized/