Repo containing the dataset legal-doc-simplification-pt and the code used for its creation
Jupyter Notebook
0
36 commits
updated Apr 11, 2026
This repository contains code and resources for building and evaluating a large-scale dataset for legal document simplification in Portuguese.
GitHub: https://github.com/scalercio/legal-doc-simplification-data
Hugging Face Dataset: https://huggingface.co/datasets/melll-uff/legal-simplification-pt
This project introduces LegalSim-PT, a large-scale dataset for automatic simplification of legal documents, containing nearly 1 million document pairs.
The repository includes:
The dataset is publicly available on Hugging Face under:
melll-uff/legal-simplification-pt
It is released in two configurations:
random_splitStandard machine learning split:
trainvalidationtestby_sourceGrouped by document origin:
from datasets import load_dataset
# Random split version
dataset = load_dataset("melll-uff/legal-simplification-pt", "random_split")
# By-source version
dataset_by_source = load_dataset("melll-uff/legal-simplification-pt", "by_source")
You can also download the files directly from the dataset page:
https://huggingface.co/datasets/melll-uff/legal-simplification-pt
The data used in this repository should be placed under:
data/legal-simplification-pt/
├── random_split/
│ ├── train_random.parquet
│ ├── val_random.parquet
│ └── test_random.parquet
└── by_source/
├── acordaos_tcu.parquet
├── stf_decisions.parquet
├── stf_votes.parquet
├── tjsp.parquet
├── trf5.parquet
└── ulysses_tesemo.parquet
The main scripts are located in the src/ directory.
src/gen_paraphrases.py
Generates simplified legal documents using LLMs.
src/gen_paraphrases_gguf.py
Generates simplified legal documents using GGUF-based LLMs.
src/finetune_qwen3.py
Fine-tunes the Qwen3-1.7B model.
src/finetune_chat.py
Fine-tunes the Qwen2.5-7B model.
src/annotate_parquet.py
Performs morphosyntactic annotation of documents.src/eval_qwen2_5.py
Runs inference with Qwen2.5-7B.
src/eval_qwen3.py
Runs inference with Qwen3-1.7B.
src/generate_bode.py
Runs inference with Bode (recogna-nlp/bode-7b-alpaca-pt-br).
src/generate_tucano.py
Runs inference with Tucano (TucanoBR/Tucano-2b4-Instruct).
src/groq-judge.py
Used for evaluation with an LLM-as-a-judge approach.statistics.ipynb
Notebook used to generate dataset statistics and analyses.This project explores:
If you use this dataset or repository, please cite:
@inproceedings{scalercio2026legalsim,
title={LegalSim-PT: Building a Dataset for Legal Document Simplification in Portuguese Leveraging Linguistic Metrics},
author={Scalercio, Arthur and others},
booktitle={Proceedings of the International Conference on Computational Processing of the Portuguese Language (PROPOR)},
year={2026}
}
Arthur Scalercio [email protected]
Repo containing the dataset legal-doc-simplification-pt and the code used for its creation
Jupyter Notebook
0
36 commits
updated Apr 11, 2026
This repository contains code and resources for building and evaluating a large-scale dataset for legal document simplification in Portuguese.
GitHub: https://github.com/scalercio/legal-doc-simplification-data
Hugging Face Dataset: https://huggingface.co/datasets/melll-uff/legal-simplification-pt
This project introduces LegalSim-PT, a large-scale dataset for automatic simplification of legal documents, containing nearly 1 million document pairs.
The repository includes:
The dataset is publicly available on Hugging Face under:
melll-uff/legal-simplification-pt
It is released in two configurations:
random_splitStandard machine learning split:
trainvalidationtestby_sourceGrouped by document origin:
from datasets import load_dataset
# Random split version
dataset = load_dataset("melll-uff/legal-simplification-pt", "random_split")
# By-source version
dataset_by_source = load_dataset("melll-uff/legal-simplification-pt", "by_source")
You can also download the files directly from the dataset page:
https://huggingface.co/datasets/melll-uff/legal-simplification-pt
The data used in this repository should be placed under:
data/legal-simplification-pt/
├── random_split/
│ ├── train_random.parquet
│ ├── val_random.parquet
│ └── test_random.parquet
└── by_source/
├── acordaos_tcu.parquet
├── stf_decisions.parquet
├── stf_votes.parquet
├── tjsp.parquet
├── trf5.parquet
└── ulysses_tesemo.parquet
The main scripts are located in the src/ directory.
src/gen_paraphrases.py
Generates simplified legal documents using LLMs.
src/gen_paraphrases_gguf.py
Generates simplified legal documents using GGUF-based LLMs.
src/finetune_qwen3.py
Fine-tunes the Qwen3-1.7B model.
src/finetune_chat.py
Fine-tunes the Qwen2.5-7B model.
src/annotate_parquet.py
Performs morphosyntactic annotation of documents.src/eval_qwen2_5.py
Runs inference with Qwen2.5-7B.
src/eval_qwen3.py
Runs inference with Qwen3-1.7B.
src/generate_bode.py
Runs inference with Bode (recogna-nlp/bode-7b-alpaca-pt-br).
src/generate_tucano.py
Runs inference with Tucano (TucanoBR/Tucano-2b4-Instruct).
src/groq-judge.py
Used for evaluation with an LLM-as-a-judge approach.statistics.ipynb
Notebook used to generate dataset statistics and analyses.This project explores:
If you use this dataset or repository, please cite:
@inproceedings{scalercio2026legalsim,
title={LegalSim-PT: Building a Dataset for Legal Document Simplification in Portuguese Leveraging Linguistic Metrics},
author={Scalercio, Arthur and others},
booktitle={Proceedings of the International Conference on Computational Processing of the Portuguese Language (PROPOR)},
year={2026}
}
Arthur Scalercio [email protected]