dataset_info:
- config_name: journalistic
features:
- name: text
dtype: string
- name: label
dtype: int64
splits:
- name: test
num_bytes: 28294
num_examples: 36
- name: valid
num_bytes: 676505.3087577409
num_examples: 1000
- name: train
num_bytes: 1192735900.4926126
num_examples: 1776291
download_size: 6230844557
dataset_size: 1193440699.8013704
- config_name: legal
features:
- name: text
dtype: string
- name: label
dtype: int64
splits:
- name: test
num_bytes: 10385
num_examples: 37
- name: train
num_bytes: 1124338737.8820171
num_examples: 4068980
- name: valid
num_bytes: 276319.55376581283
num_examples: 1000
download_size: 2029336818
dataset_size: 1124625442.435783
- config_name: literature
features:
- name: text
dtype: string
- name: label
dtype: int64
splits:
- name: test
num_bytes: 12767
num_examples: 36
- name: train
num_bytes: 30455231.959382813
num_examples: 78315
- name: valid
num_bytes: 388881.2099774349
num_examples: 1000
download_size: 136991326
dataset_size: 30856880.169360247
- config_name: politics
features:
- name: text
dtype: string
- name: label
dtype: int64
splits:
- name: test
num_bytes: 64499
num_examples: 48
- name: train
num_bytes: 56779240.84597156
num_examples: 31406
- name: valid
num_bytes: 1807910.61726968
num_examples: 1000
download_size: 100396628
dataset_size: 58651650.46324124
- config_name: social_media
features:
- name: text
dtype: string
- name: label
dtype: int64
splits:
- name: test
num_bytes: 6146
num_examples: 28
- name: train
num_bytes: 301649578.2733254
num_examples: 2538360
- name: valid
num_bytes: 118836.40550328771
num_examples: 1000
download_size: 1112482919
dataset_size: 301774560.67882866
- config_name: web
features:
- name: text
dtype: string
- name: label
dtype: int64
splits:
- name: test
num_bytes: 64024
num_examples: 34
- name: train
num_bytes: 478895826.0863611
num_examples: 87508
- name: valid
num_bytes: 5472594.803747784
num_examples: 1000
download_size: 1073024003
dataset_size: 484432444.8901089
configs:
- config_name: journalistic
data_files:
- split: train
path: journalistic/train-*
- split: valid
path: journalistic/valid-*
- split: test
path: journalistic/test-*
- config_name: legal
data_files:
- split: train
path: legal/train-*
- split: valid
path: legal/valid-*
- split: test
path: legal/test-*
- config_name: literature
data_files:
- split: train
path: literature/train-*
- split: valid
path: literature/valid-*
- split: test
path: literature/test-*
- config_name: politics
data_files:
- split: train
path: politics/train-*
- split: valid
path: politics/valid-*
- split: test
path: politics/test-*
- config_name: social_media
data_files:
- split: train
path: social_media/train-*
- split: valid
path: social_media/valid-*
- split: test
path: social_media/test-*
- config_name: web
data_files:
- split: train
path: web/train-*
- split: valid
path: web/valid-*
- split: test
path: web/test-*
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:
- Remove all NaN values.
- Remove all empty documents.
- Remove all duplicated documents.
- Apply the clean_text library to remove non-relevant information for language identification from the documents.
- 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.
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.