PtBrVId / README.md
hugosousa's picture
Update README.md
7d5545c verified
metadata
dataset_info:
  - config_name: journalistic
    features:
      - name: text
        dtype: string
      - name: label
        dtype: int64
    splits:
      - name: train
        num_bytes: 1174099478
        num_examples: 1744753
    download_size: 790547389
    dataset_size: 1174099478
  - config_name: legal
    features:
      - name: text
        dtype: string
      - name: label
        dtype: int64
    splits:
      - name: train
        num_bytes: 146574307
        num_examples: 466434
    download_size: 89418636
    dataset_size: 146574307
  - config_name: literature
    features:
      - name: text
        dtype: string
      - name: label
        dtype: int64
    splits:
      - name: train
        num_bytes: 30417858
        num_examples: 90526
    download_size: 21226294
    dataset_size: 30417858
  - config_name: politics
    features:
      - name: text
        dtype: string
      - name: label
        dtype: int64
    splits:
      - name: train
        num_bytes: 7970329
        num_examples: 5810
    download_size: 4605661
    dataset_size: 7970329
  - config_name: social_media
    features:
      - name: text
        dtype: string
      - name: label
        dtype: int64
    splits:
      - name: train
        num_bytes: 265857455
        num_examples: 2020928
    download_size: 188356429
    dataset_size: 265857455
  - config_name: web
    features:
      - name: text
        dtype: string
      - name: label
        dtype: int64
    splits:
      - name: train
        num_bytes: 278541298
        num_examples: 140887
    download_size: 165251198
    dataset_size: 278541298
configs:
  - config_name: journalistic
    data_files:
      - split: train
        path: journalistic/train-*
  - config_name: legal
    data_files:
      - split: train
        path: legal/train-*
  - config_name: literature
    data_files:
      - split: train
        path: literature/train-*
  - config_name: politics
    data_files:
      - split: train
        path: politics/train-*
  - config_name: social_media
    data_files:
      - split: train
        path: social_media/train-*
  - config_name: web
    data_files:
      - split: train
        path: web/train-*

PtBrVId

The developed corpus is a composition of pre-existing datasets initially created for other NLP tasks that provide permissive licenses. The first release of the corpus is available on Huggingface.

Data Sources

The corpus consists of the following datasets:

Domain Variety Dataset Original Task # Docs License Silver Labeled
Literature PT-PT Arquivo Pessoa - ~4k CC βœ”
Gutenberg Project - 6 CC βœ”
LT-Corpus - 56 ELRA END USER ✘
PT-BR Brazilian Literature Author Identification 81 CC ✘
LT-Corpus - 8 ELRA END USER ✘
Politics PT-PT Koehn (2005) Europarl Machine Translation ~10k CC ✘
PT-BR Brazilian Senate Speeches - ~5k CC βœ”
Journalistic PT-PT CETEM Público - 1M CC ✘
PT-BR CETEM Folha - 272k CC ✘
Social Media PT-PT Ramalho (2021) Fake News Detection 2M MIT βœ”
PT-BR Vargas (2022) Hate Speech Detection 5k CC-BY-NC-4.0 ✘
Cunha (2021) Fake News Detection 2k GPL-3.0 license βœ”
Web BOTH Ortiz-Suarez (2020) - 10k CC βœ”

Table 1: Data Sources

Note: The dataset "Brazilian Senate Speeches" was created by the authors of this paper, using web crawling of the Brazilian Senate website and is available in the Huggingface repository.

Annotation Schema & Data Preprocessing Pipeline

We leveraged our knowledge of the Portuguese language to identify data sources that guaranteed mono-variety documents. However, this first release lacks any kind of supervision, so we cannot guarantee that all documents are mono-variety. In the future, we plan to release a second version of the corpus with a more robust annotation schema, combining automatic and manual annotation.

To improve the quality of the corpus, we applied a preprocessing pipeline to all documents. The pipeline consists of the following steps:

  1. Remove all NaN values.
  2. Remove all empty documents.
  3. Remove all duplicated documents.
  4. Apply the clean_text library to remove non-relevant information for language identification from the documents.
  5. Remove all documents with a length significantly more than two standard deviations from the mean length of the documents in the corpus.

The pipeline is illustrated in Figure 1.

Image Description

Figure 1: Data Pre-Processing Pipeline

Class Distribution

The class distribution of the corpus is presented in Table 2. The corpus is highly imbalanced, with the majority of the documents being from the journalistic domain. In the future, we plan to release a second version of the corpus with a more balanced distribution across the six domains. Depending on the imbalance of the textual domain, we used different strategies to perform train-validation-test splits. For the heavily imbalanced domains, we ensured a minimum of 100 documents for validation and 400 for testing. In the other domains, we applied a stratified split.

Domain # PT-PT # PT-BR Stratified
Politics 6500 4894 βœ“
Web 7960 21592 βœ“
Literature 18282 2772 βœ“
Law 392839 5766 βœ•
Journalistic 1494494 354180 βœ“
Social Media 2013951 6222 βœ•

Table 2: Class Balance across the six textual domains in both varieties of Portuguese.

Future Releases & How to Contribute

We plan to release a second version of this corpus considering more textual domains and extending the scope to other Portuguese varieties. If you want to contribute to this corpus, please contact us.