Datasets:

Modalities:
Tabular
Text
Formats:
parquet
Languages:
Portuguese
ArXiv:
Tags:
legal
Libraries:
Datasets
Dask
LegalPT / README.md
eduagarcia's picture
mlp_pt_eurlex-legislation uploaded
0e85b68 verified
|
raw
history blame
12.8 kB
metadata
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
  - config_name: mlp_pt_BRCAD-5
    features:
      - name: id
        dtype: int64
      - 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
    splits:
      - name: train
        num_bytes: 20311710293
        num_examples: 3128292
    download_size: 9735599974
    dataset_size: 20311710293
  - config_name: mlp_pt_CJPG
    features:
      - name: id
        dtype: int64
      - 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
    splits:
      - name: train
        num_bytes: 63201157801
        num_examples: 14068634
    download_size: 30473107046
    dataset_size: 63201157801
  - config_name: mlp_pt_eurlex-caselaw
    features:
      - name: id
        dtype: int64
      - 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
    splits:
      - name: train
        num_bytes: 1499601545
        num_examples: 104312
    download_size: 627235870
    dataset_size: 1499601545
  - config_name: mlp_pt_eurlex-contracts
    features:
      - name: id
        dtype: int64
      - 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
    splits:
      - name: train
        num_bytes: 467200973
        num_examples: 11581
    download_size: 112805426
    dataset_size: 467200973
  - config_name: mlp_pt_eurlex-legislation
    features:
      - name: id
        dtype: int64
      - 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
    splits:
      - name: train
        num_bytes: 5669271303
        num_examples: 232556
    download_size: 1384571339
    dataset_size: 5669271303
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-*
  - config_name: mlp_pt_BRCAD-5
    data_files:
      - split: train
        path: mlp_pt_BRCAD-5/train-*
  - config_name: mlp_pt_CJPG
    data_files:
      - split: train
        path: mlp_pt_CJPG/train-*
  - config_name: mlp_pt_eurlex-caselaw
    data_files:
      - split: train
        path: mlp_pt_eurlex-caselaw/train-*
  - config_name: mlp_pt_eurlex-contracts
    data_files:
      - split: train
        path: mlp_pt_eurlex-contracts/train-*
  - config_name: mlp_pt_eurlex-legislation
    data_files:
      - split: train
        path: mlp_pt_eurlex-legislation/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õ, MultiLegalPile (PT), ParlamentoPT, Iudicium Textum, Acordãos TCU, and DataSTF.

  • 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), the Portuguese subset of legal documents from the European Union, known as EUR-Lex, and a filter for legal documents from MC4.
  • 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

Dataset Sources

Dataset Structure

[More Information Needed]

Data Collection and Processing

LegalPT is deduplicated using MinHash algorithm and Locality Sensitive Hashing, following the approach of Lee et al. (2022).

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