| --- |
| language: |
| - en |
| license: apache-2.0 |
| task_categories: |
| - text-retrieval |
| - text-classification |
| tags: |
| - legal |
| - legislation |
| - information-retrieval |
| - semantic-textual-similarity |
| - retrieval |
| - brazil |
| - portuguese |
| - hypertext |
| pretty_name: SB² Dataset |
| size_categories: |
| - 100K<n<1M |
| --- |
| |
| # SB² Dataset: Similar Brazilian State Bills |
|
|
| The **SB² Dataset** is a dataset of Brazilian legislative bills annotated with institutional similarity links established during the legislative workflow. It was created to support research on Legal Information Retrieval (LIR), Semantic Textual Similarity (STS), Retrieval-Augmented Generation (RAG), document retrieval, and legislative recommendation systems. |
|
|
| The dataset accompanies the paper: |
|
|
| > **ReSB²: Machine-Assisted Linking of Legislative Bills using Domain-Adapted ModernBERT and Explainable AI** |
| > ACM Hypertext 2026 |
|
|
| ## Dataset Description |
|
|
| The dataset combines legislative bills from two Brazilian legislative bodies: |
|
|
| - **Legislative Assembly of Minas Gerais (ALMG)** |
| - **Brazilian Chamber of Deputies** |
|
|
| Unlike existing Brazilian legislative datasets, SB² includes **expert-validated similarity relationships** between legislative bills. These links were established by legislative analysts during the regular legislative process and represent institutional judgments regarding substantive legislative relatedness. |
|
|
| The dataset can be used for: |
|
|
| - Continued pre-training using Masked Language Modeling (MLM) |
| - Semantic Textual Similarity (STS) |
| - Dense retrieval |
| - Bi-Encoder training |
| - Cross-Encoder training |
| - Legal Information Retrieval |
| - Retrieval-Augmented Generation (RAG) |
| - Legislative recommendation systems |
|
|
| ## Repository Structure |
|
|
| ```text |
| data/ |
| ├── raw/ |
| │ ├── almg/ |
| │ │ ├── detalheProposicao.json.gz |
| │ │ ├── sessoes-legislativas.json |
| │ │ └── textoProposicao2.json.gz |
| │ │ |
| │ └── chamber_of_deputies/ |
| │ └── dataset_proposicoes_20240416.csv |
| │ |
| └── preprocessed/ |
| ├── almg/ |
| │ ├── sb2_almg_mlm.csv |
| │ └── sb2_almg_pairs.csv |
| │ |
| └── chamber_of_deputies/ |
| ├── sb2_chamber_mlm.csv |
| └── sb2_chamber_pairs.csv |
| ``` |
|
|
| ## Raw Data |
|
|
| The `raw` directory contains the original legislative data collected from the official sources. |
|
|
| ## Preprocessed Data |
|
|
| The `preprocessed` directory contains the datasets generated after the preprocessing pipeline described in the accompanying paper. |
|
|
| The scripts used to transform the raw legislative data into the preprocessed datasets are publicly available in the **ReSB² Framework** repository: |
|
|
| https://github.com/LucasLage/ReSB2-Framework |
|
|
|
|
| ### MLM Files |
|
|
| The files |
|
|
| - `sb2_almg_mlm.csv` |
| - `sb2_chamber_mlm.csv` |
|
|
| are intended for **continued pre-training using the Masked Language Modeling (MLM) objective**. |
|
|
| Each file contains the following columns: |
|
|
| | Column | Description | |
| |---------|-------------| |
| | `doc_id` | Unique legislative bill identifier. | |
| | `preprocessed_text` | Preprocessed legislative bill text. | |
|
|
| ### Similarity Pair Files |
|
|
| The files |
|
|
| - `sb2_almg_pairs.csv` |
| - `sb2_chamber_pairs.csv` |
|
|
| contain document pairs for supervised similarity learning (e.g., Bi-Encoder and Cross-Encoder training). |
|
|
| Each file contains the following columns: |
|
|
| | Column | Description | |
| |---------|-------------| |
| | `doc_id_1` | Identifier of the first bill. | |
| | `preprocessed_text_1` | Preprocessed text of the first bill. | |
| | `doc_id_2` | Identifier of the second bill. | |
| | `preprocessed_text_2` | Preprocessed text of the second bill. | |
| | `label` | Similarity label (`1` = similar, `0` = not similar). | |
|
|
| ## Similarity Labels |
|
|
| Positive pairs correspond to similarity links established by legislative analysts during the regular legislative workflow. |
|
|
| These labels represent **institutional legislative similarity**, rather than purely lexical or semantic similarity, and therefore incorporate domain knowledge and procedural legislative criteria. |
|
|
| ## Statistics |
|
|
| | Source | Bills | Similar Pairs | |
| |---------|------:|--------------:| |
| | Legislative Assembly of Minas Gerais (ALMG) | 49,868 | 3,754 | |
| | Brazilian Chamber of Deputies | 71,898 | 43,484 | |
|
|
| ## Citation |
|
|
| If you use this dataset, please cite: |
|
|
| ```bibtex |
| @inproceedings{lage2026resb2, |
| title={ReSB²: Machine-Assisted Linking of Legislative Bills using Domain-Adapted ModernBERT and Explainable AI}, |
| author={Lage, Lucas Gabriel and others}, |
| booktitle={Proceedings of the ACM Conference on Hypertext and Social Media}, |
| year={2026} |
| } |
| ``` |
|
|
| ## License |
|
|
| Please refer to the licenses of the original legislative data providers. |
|
|
| This repository distributes processed versions of publicly available legislative documents for research purposes. |
|
|
| ## Acknowledgments |
|
|
| This work was supported by the Legislative Assembly of Minas Gerais (ALMG), CNPq, CAPES, and FAPEMIG. |
|
|