Datasets:

Modalities:
Tabular
Text
Formats:
parquet
Languages:
Portuguese
ArXiv:
Tags:
legal
Libraries:
Datasets
Dask
File size: 8,227 Bytes
5b9db96
ec46bfa
 
5b9db96
ec46bfa
 
5b9db96
 
 
 
ec46bfa
a8d6b28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d48dbed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec46bfa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a8d6b28
 
 
 
d48dbed
 
 
 
ec46bfa
 
 
 
5b9db96
 
 
a5b6992
5b9db96
 
 
a5b6992
 
 
 
5b9db96
37d4f41
 
 
 
 
 
 
a5b6992
5b9db96
 
 
 
 
 
a5b6992
5b9db96
 
 
 
 
 
 
 
 
 
a5b6992
5b9db96
abdb46d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5b9db96
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
---
language:
- pt
license: cc-by-4.0
size_categories:
- 1B<n<10B
task_categories:
- text-generation
tags:
- legal
dataset_info:
- config_name: all
  features:
  - name: text
    dtype: string
  - name: meta
    struct:
    - name: dedup
      struct:
      - name: exact_norm
        struct:
        - name: cluster_main_idx
          dtype: int64
        - name: cluster_size
          dtype: int64
        - name: exact_hash_idx
          dtype: int64
        - name: is_duplicate
          dtype: bool
      - name: minhash
        struct:
        - name: cluster_main_idx
          dtype: int64
        - name: cluster_size
          dtype: int64
        - name: is_duplicate
          dtype: bool
        - name: minhash_idx
          dtype: int64
  - name: source
    dtype: string
  - name: orig_id
    dtype: int64
  - name: id
    dtype: int64
  splits:
  - name: train
    num_bytes: 7047806791
    num_examples: 1399648
  download_size: 3783112421
  dataset_size: 7047806791
- config_name: datastf
  features:
  - name: text
    dtype: string
  - name: meta
    struct:
    - name: dedup
      struct:
      - name: exact_norm
        struct:
        - name: cluster_main_idx
          dtype: int64
        - name: cluster_size
          dtype: int64
        - name: exact_hash_idx
          dtype: int64
        - name: is_duplicate
          dtype: bool
      - name: minhash
        struct:
        - name: cluster_main_idx
          dtype: int64
        - name: cluster_size
          dtype: int64
        - name: is_duplicate
          dtype: bool
        - name: minhash_idx
          dtype: int64
  - name: id
    dtype: int64
  splits:
  - name: train
    num_bytes: 3699382656
    num_examples: 737769
  download_size: 1724245648
  dataset_size: 3699382656
- config_name: iudicium_textum
  features:
  - name: text
    dtype: string
  - name: meta
    struct:
    - name: dedup
      struct:
      - name: exact_norm
        struct:
        - name: cluster_main_idx
          dtype: int64
        - name: cluster_size
          dtype: int64
        - name: exact_hash_idx
          dtype: int64
        - name: is_duplicate
          dtype: bool
      - name: minhash
        struct:
        - name: cluster_main_idx
          dtype: int64
        - name: cluster_size
          dtype: int64
        - name: is_duplicate
          dtype: bool
        - name: minhash_idx
          dtype: int64
  - name: id
    dtype: int64
  splits:
  - name: train
    num_bytes: 896139675
    num_examples: 198387
  download_size: 408025309
  dataset_size: 896139675
configs:
- config_name: all
  data_files:
  - split: train
    path: all/train-*
- config_name: datastf
  data_files:
  - split: train
    path: datastf/train-*
- config_name: iudicium_textum
  data_files:
  - split: train
    path: iudicium_textum/train-*
---
# LegalPT

LegalPT aggregates the maximum amount of publicly available legal data in Portuguese, drawing from varied sources including legislation, jurisprudence, legal articles, and government documents.

## Dataset Details

Dataset is composed by six corpora: 
[Ulysses-Tesemõ](https:github.com/ulysses-camara/ulysses-tesemo), [MultiLegalPile (PT)](https://arxiv.org/abs/2306.02069v2), [ParlamentoPT](http://arxiv.org/abs/2305.06721),
[Iudicium Textum](https://www.inf.ufpr.br/didonet/articles/2019_dsw_Iudicium_Textum_Dataset.pdf), [Acordãos TCU](https://link.springer.com/chapter/10.1007/978-3-030-61377-8_46), and 
[DataSTF](https://legalhackersnatal.wordpress.com/2019/05/09/mais-dados-juridicos/).

- **MultiLegalPile**: a multilingual corpus of legal texts comprising 689 GiB of data, covering 24 languages in 17 jurisdictions. The corpus is separated by language, and the subset in Portuguese contains 92GiB of data, containing 13.76 billion words. This subset includes the jurisprudence of the Court of Justice of São Paulo (CJPG), appeals from the [5th Regional Federal Court (BRCAD-5)](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0272287), the Portuguese subset of legal documents from the European Union, known as [EUR-Lex](https://eur-lex.europa.eu/homepage.html), and a filter for legal documents from [MC4](http://arxiv.org/abs/2010.11934).
- **Ulysses-Tesemõ**: a legal corpus in Brazilian Portuguese, composed of 2.2 million documents, totaling about 26GiB of text obtained from 96 different data sources. These sources encompass legal, legislative, academic papers, news, and related comments. The data was collected through web scraping of government websites.
- **ParlamentoPT**: a corpus for training language models in European Portuguese. The data was collected from the Portuguese government portal and consists of 2.6 million documents of transcriptions of debates in the Portuguese Parliament.
- **Iudicium Textum**: consists of rulings, votes, and reports from the Supreme Federal Court (STF) of Brazil, published between 2010 and 2018. The dataset contains 1GiB of data extracted from PDFs.
- **Acordãos TCU**:  an open dataset from the Tribunal de Contas da União (Brazilian Federal Court of Accounts), containing 600,000 documents obtained by web scraping government websites. The documents span from 1992 to 2019.
- **DataSTF**: a dataset of monocratic decisions from the Superior Court of Justice (STJ) in Brazil, containing 700,000 documents (5GiB of data).

### Dataset Description

- **Curated by:** [More Information Needed]
- **Funded by:** [More Information Needed]
- **Language(s) (NLP):** Brazilian Portuguese (pt-BR)
- **License:** [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/deed.en)

### Dataset Sources

- **Repository:** https://github.com/eduagarcia/roberta-legal-portuguese
- **Paper:** [More Information Needed]

## Dataset Structure

<!-- This section provides a description of the dataset fields, and additional information about the dataset structure such as criteria used to create the splits, relationships between data points, etc. -->

[More Information Needed]

## Data Collection and Processing

LegalPT is deduplicated using [MinHash algorithm](https://dl.acm.org/doi/abs/10.5555/647819.736184) and [Locality Sensitive Hashing](https://dspace.mit.edu/bitstream/handle/1721.1/134231/v008a014.pdf?sequence=2&isAllowed=y), following the approach of [Lee et al. (2022)](http://arxiv.org/abs/2107.06499).

We used 5-grams and a signature of size 256, considering two documents to be identical if their Jaccard Similarity exceeded 0.7.

Duplicate rate found by the Minhash-LSH algorithm  for the LegalPT corpus:

| **Corpus**               |  **Documents** | **Docs. after deduplication** | **Duplicates (%)** |
|--------------------------|:--------------:|:-----------------------------:|:------------------:|
| Ulysses-Tesemõ           |    2,216,656   |           1,737,720           |        21.61       |
| MultiLegalPile (PT)      |                |                               |                    |
|    CJPG                  |   14,068,634   |           6,260,096           |        55.50       |
|    BRCAD-5               |    3,128,292   |            542,680            |        82.65       |
|    EUR-Lex (Caselaw)     |     104,312    |             78,893            |        24.37       |
|    EUR-Lex (Contracts)   |     11,581     |             8,511             |        26.51       |
|    EUR-Lex (Legislation) |     232,556    |             95,024            |        59.14       |
|    Legal MC4             |     191,174    |            187,637            |        1.85        |
| ParlamentoPT             |    2,670,846   |           2,109,931           |        21.00       |
| Iudicium Textum          |     198,387    |            153,373            |        22.69       |
| Acordãos TCU             |     634,711    |            462,031            |        27.21       |
| DataSTF                  |     737,769    |            310,119            |        57.97       |
| **Total (LegalPT)**      | **24,194,918** |         **11,946,015**        |      **50.63**     |

## Citation

<!-- If there is a paper or blog post introducing the dataset, the APA and Bibtex information for that should go in this section. -->