Datasets:
Commit
•
b17f423
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +188 -0
- assin.py +176 -0
- dataset_infos.json +1 -0
- dummy/full/1.0.0/dummy_data.zip +3 -0
- dummy/ptbr/1.0.0/dummy_data.zip +3 -0
- dummy/ptpt/1.0.0/dummy_data.zip +3 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- pt
|
8 |
+
licenses:
|
9 |
+
- unknown
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- text-classification
|
18 |
+
- text-scoring
|
19 |
+
task_ids:
|
20 |
+
- natural-language-inference
|
21 |
+
- semantic-similarity-scoring
|
22 |
+
---
|
23 |
+
|
24 |
+
# Dataset Card for ASSIN
|
25 |
+
|
26 |
+
## Table of Contents
|
27 |
+
- [Dataset Description](#dataset-description)
|
28 |
+
- [Dataset Summary](#dataset-summary)
|
29 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
30 |
+
- [Languages](#languages)
|
31 |
+
- [Dataset Structure](#dataset-structure)
|
32 |
+
- [Data Instances](#data-instances)
|
33 |
+
- [Data Fields](#data-fields)
|
34 |
+
- [Data Splits](#data-splits)
|
35 |
+
- [Dataset Creation](#dataset-creation)
|
36 |
+
- [Curation Rationale](#curation-rationale)
|
37 |
+
- [Source Data](#source-data)
|
38 |
+
- [Annotations](#annotations)
|
39 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
40 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
41 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
42 |
+
- [Discussion of Biases](#discussion-of-biases)
|
43 |
+
- [Other Known Limitations](#other-known-limitations)
|
44 |
+
- [Additional Information](#additional-information)
|
45 |
+
- [Dataset Curators](#dataset-curators)
|
46 |
+
- [Licensing Information](#licensing-information)
|
47 |
+
- [Citation Information](#citation-information)
|
48 |
+
|
49 |
+
## Dataset Description
|
50 |
+
|
51 |
+
- **Homepage:** [ASSIN homepage](http://nilc.icmc.usp.br/assin/)
|
52 |
+
- **Repository:** [ASSIN repository](http://nilc.icmc.usp.br/assin/)
|
53 |
+
- **Paper:** [ASSIN: Evaluation of Semantic Similarity and Textual Inference](http://propor2016.di.fc.ul.pt/wp-content/uploads/2015/10/assin-overview.pdf)
|
54 |
+
- **Point of Contact:** [Erick Rocha Fonseca](mailto:erickrf@icmc.usp.br)
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
The ASSIN (Avaliação de Similaridade Semântica e INferência textual) corpus is a corpus annotated with pairs of sentences written in
|
59 |
+
Portuguese that is suitable for the exploration of textual entailment and paraphrasing classifiers. The corpus contains pairs of sentences
|
60 |
+
extracted from news articles written in European Portuguese (EP) and Brazilian Portuguese (BP), obtained from Google News Portugal
|
61 |
+
and Brazil, respectively. To create the corpus, the authors started by collecting a set of news articles describing the
|
62 |
+
same event (one news article from Google News Portugal and another from Google News Brazil) from Google News.
|
63 |
+
Then, they employed Latent Dirichlet Allocation (LDA) models to retrieve pairs of similar sentences between sets of news
|
64 |
+
articles that were grouped together around the same topic. For that, two LDA models were trained (for EP and for BP)
|
65 |
+
on external and large-scale collections of unannotated news articles from Portuguese and Brazilian news providers, respectively.
|
66 |
+
Then, the authors defined a lower and upper threshold for the sentence similarity score of the retrieved pairs of sentences,
|
67 |
+
taking into account that high similarity scores correspond to sentences that contain almost the same content (paraphrase candidates),
|
68 |
+
and low similarity scores correspond to sentences that are very different in content from each other (no-relation candidates).
|
69 |
+
From the collection of pairs of sentences obtained at this stage, the authors performed some manual grammatical corrections
|
70 |
+
and discarded some of the pairs wrongly retrieved. Furthermore, from a preliminary analysis made to the retrieved sentence pairs
|
71 |
+
the authors noticed that the number of contradictions retrieved during the previous stage was very low. Additionally, they also
|
72 |
+
noticed that event though paraphrases are not very frequent, they occur with some frequency in news articles. Consequently,
|
73 |
+
in contrast with the majority of the currently available corpora for other languages, which consider as labels “neutral”, “entailment”
|
74 |
+
and “contradiction” for the task of RTE, the authors of the ASSIN corpus decided to use as labels “none”, “entailment” and “paraphrase”.
|
75 |
+
Finally, the manual annotation of pairs of sentences was performed by human annotators. At least four annotators were randomly
|
76 |
+
selected to annotate each pair of sentences, which is done in two steps: (i) assigning a semantic similarity label (a score between 1 and 5,
|
77 |
+
from unrelated to very similar); and (ii) providing an entailment label (one sentence entails the other, sentences are paraphrases,
|
78 |
+
or no relation). Sentence pairs where at least three annotators do not agree on the entailment label were considered controversial
|
79 |
+
and thus discarded from the gold standard annotations. The full dataset has 10,000 sentence pairs, half of which in Brazilian Portuguese (ptbr)
|
80 |
+
and half in European Portuguese (ptpt). Either language variant has 2,500 pairs for training, 500 for validation and 2,000 for testing.
|
81 |
+
|
82 |
+
### Supported Tasks and Leaderboards
|
83 |
+
|
84 |
+
[More Information Needed]
|
85 |
+
|
86 |
+
### Languages
|
87 |
+
|
88 |
+
The language supported is Portuguese.
|
89 |
+
|
90 |
+
## Dataset Structure
|
91 |
+
|
92 |
+
### Data Instances
|
93 |
+
|
94 |
+
An example from the ASSIN dataset looks as follows:
|
95 |
+
|
96 |
+
```
|
97 |
+
{
|
98 |
+
"entailment_judgment": 0,
|
99 |
+
"hypothesis": "André Gomes entra em campo quatro meses depois de uma lesão na perna esquerda o ter afastado dos relvados.",
|
100 |
+
"premise": "Relembre-se que o atleta estava afastado dos relvados desde maio, altura em que contraiu uma lesão na perna esquerda.",
|
101 |
+
"relatedness_score": 3.5,
|
102 |
+
"sentence_pair_id": 1
|
103 |
+
}
|
104 |
+
```
|
105 |
+
|
106 |
+
### Data Fields
|
107 |
+
|
108 |
+
- `sentence_pair_id`: a `int64` feature.
|
109 |
+
- `premise`: a `string` feature.
|
110 |
+
- `hypothesis`: a `string` feature.
|
111 |
+
- `relatedness_score`: a `float32` feature.
|
112 |
+
- `entailment_judgment`: a classification label, with possible values including `NONE`, `ENTAILMENT`, `PARAPHRASE`.
|
113 |
+
|
114 |
+
### Data Splits
|
115 |
+
|
116 |
+
The data is split into train, validation and test set. The split sizes are as follow:
|
117 |
+
|
118 |
+
| | Train | Val | Test |
|
119 |
+
| ----- | ------ | ----- | ---- |
|
120 |
+
| full | 5000 | 1000 | 4000 |
|
121 |
+
| ptbr | 2500 | 500 | 2000 |
|
122 |
+
| ptpt | 2500 | 500 | 2000 |
|
123 |
+
|
124 |
+
## Dataset Creation
|
125 |
+
|
126 |
+
### Curation Rationale
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
### Source Data
|
131 |
+
|
132 |
+
#### Initial Data Collection and Normalization
|
133 |
+
|
134 |
+
[More Information Needed]
|
135 |
+
|
136 |
+
#### Who are the source language producers?
|
137 |
+
|
138 |
+
[More Information Needed]
|
139 |
+
|
140 |
+
### Annotations
|
141 |
+
|
142 |
+
#### Annotation process
|
143 |
+
|
144 |
+
[More Information Needed]
|
145 |
+
|
146 |
+
#### Who are the annotators?
|
147 |
+
|
148 |
+
[More Information Needed]
|
149 |
+
|
150 |
+
### Personal and Sensitive Information
|
151 |
+
|
152 |
+
[More Information Needed]
|
153 |
+
|
154 |
+
## Considerations for Using the Data
|
155 |
+
|
156 |
+
### Social Impact of Dataset
|
157 |
+
|
158 |
+
[More Information Needed]
|
159 |
+
|
160 |
+
### Discussion of Biases
|
161 |
+
|
162 |
+
[More Information Needed]
|
163 |
+
|
164 |
+
### Other Known Limitations
|
165 |
+
|
166 |
+
[More Information Needed]
|
167 |
+
|
168 |
+
## Additional Information
|
169 |
+
|
170 |
+
### Dataset Curators
|
171 |
+
|
172 |
+
[More Information Needed]
|
173 |
+
|
174 |
+
### Licensing Information
|
175 |
+
|
176 |
+
[More Information Needed]
|
177 |
+
|
178 |
+
### Citation Information
|
179 |
+
|
180 |
+
```
|
181 |
+
@inproceedings{fonseca2016assin,
|
182 |
+
title={ASSIN: Avaliacao de similaridade semantica e inferencia textual},
|
183 |
+
author={Fonseca, E and Santos, L and Criscuolo, Marcelo and Aluisio, S},
|
184 |
+
booktitle={Computational Processing of the Portuguese Language-12th International Conference, Tomar, Portugal},
|
185 |
+
pages={13--15},
|
186 |
+
year={2016}
|
187 |
+
}
|
188 |
+
```
|
assin.py
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""ASSIN dataset."""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import os
|
20 |
+
import xml.etree.ElementTree as ET
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
_CITATION = """
|
26 |
+
@inproceedings{fonseca2016assin,
|
27 |
+
title={ASSIN: Avaliacao de similaridade semantica e inferencia textual},
|
28 |
+
author={Fonseca, E and Santos, L and Criscuolo, Marcelo and Aluisio, S},
|
29 |
+
booktitle={Computational Processing of the Portuguese Language-12th International Conference, Tomar, Portugal},
|
30 |
+
pages={13--15},
|
31 |
+
year={2016}
|
32 |
+
}
|
33 |
+
"""
|
34 |
+
|
35 |
+
_DESCRIPTION = """
|
36 |
+
The ASSIN (Avaliação de Similaridade Semântica e INferência textual) corpus is a corpus annotated with pairs of sentences written in
|
37 |
+
Portuguese that is suitable for the exploration of textual entailment and paraphrasing classifiers. The corpus contains pairs of sentences
|
38 |
+
extracted from news articles written in European Portuguese (EP) and Brazilian Portuguese (BP), obtained from Google News Portugal
|
39 |
+
and Brazil, respectively. To create the corpus, the authors started by collecting a set of news articles describing the
|
40 |
+
same event (one news article from Google News Portugal and another from Google News Brazil) from Google News.
|
41 |
+
Then, they employed Latent Dirichlet Allocation (LDA) models to retrieve pairs of similar sentences between sets of news
|
42 |
+
articles that were grouped together around the same topic. For that, two LDA models were trained (for EP and for BP)
|
43 |
+
on external and large-scale collections of unannotated news articles from Portuguese and Brazilian news providers, respectively.
|
44 |
+
Then, the authors defined a lower and upper threshold for the sentence similarity score of the retrieved pairs of sentences,
|
45 |
+
taking into account that high similarity scores correspond to sentences that contain almost the same content (paraphrase candidates),
|
46 |
+
and low similarity scores correspond to sentences that are very different in content from each other (no-relation candidates).
|
47 |
+
From the collection of pairs of sentences obtained at this stage, the authors performed some manual grammatical corrections
|
48 |
+
and discarded some of the pairs wrongly retrieved. Furthermore, from a preliminary analysis made to the retrieved sentence pairs
|
49 |
+
the authors noticed that the number of contradictions retrieved during the previous stage was very low. Additionally, they also
|
50 |
+
noticed that event though paraphrases are not very frequent, they occur with some frequency in news articles. Consequently,
|
51 |
+
in contrast with the majority of the currently available corpora for other languages, which consider as labels “neutral”, “entailment”
|
52 |
+
and “contradiction” for the task of RTE, the authors of the ASSIN corpus decided to use as labels “none”, “entailment” and “paraphrase”.
|
53 |
+
Finally, the manual annotation of pairs of sentences was performed by human annotators. At least four annotators were randomly
|
54 |
+
selected to annotate each pair of sentences, which is done in two steps: (i) assigning a semantic similarity label (a score between 1 and 5,
|
55 |
+
from unrelated to very similar); and (ii) providing an entailment label (one sentence entails the other, sentences are paraphrases,
|
56 |
+
or no relation). Sentence pairs where at least three annotators do not agree on the entailment label were considered controversial
|
57 |
+
and thus discarded from the gold standard annotations. The full dataset has 10,000 sentence pairs, half of which in Brazilian Portuguese
|
58 |
+
and half in European Portuguese. Either language variant has 2,500 pairs for training, 500 for validation and 2,000 for testing.
|
59 |
+
"""
|
60 |
+
|
61 |
+
_HOMEPAGE = "http://nilc.icmc.usp.br/assin/"
|
62 |
+
|
63 |
+
_LICENSE = ""
|
64 |
+
|
65 |
+
_URL = "http://nilc.icmc.usp.br/assin/assin.tar.gz"
|
66 |
+
|
67 |
+
|
68 |
+
class Assin(datasets.GeneratorBasedBuilder):
|
69 |
+
"""ASSIN dataset."""
|
70 |
+
|
71 |
+
VERSION = datasets.Version("1.0.0")
|
72 |
+
|
73 |
+
BUILDER_CONFIGS = [
|
74 |
+
datasets.BuilderConfig(
|
75 |
+
name="full",
|
76 |
+
version=VERSION,
|
77 |
+
description="If you want to use all the ASSIN data (Brazilian Portuguese and European Portuguese)",
|
78 |
+
),
|
79 |
+
datasets.BuilderConfig(
|
80 |
+
name="ptpt",
|
81 |
+
version=VERSION,
|
82 |
+
description="If you want to use only the ASSIN European Portuguese subset",
|
83 |
+
),
|
84 |
+
datasets.BuilderConfig(
|
85 |
+
name="ptbr",
|
86 |
+
version=VERSION,
|
87 |
+
description="If you want to use only the ASSIN Brazilian Portuguese subset",
|
88 |
+
),
|
89 |
+
]
|
90 |
+
|
91 |
+
DEFAULT_CONFIG_NAME = "full"
|
92 |
+
|
93 |
+
def _info(self):
|
94 |
+
features = datasets.Features(
|
95 |
+
{
|
96 |
+
"sentence_pair_id": datasets.Value("int64"),
|
97 |
+
"premise": datasets.Value("string"),
|
98 |
+
"hypothesis": datasets.Value("string"),
|
99 |
+
"relatedness_score": datasets.Value("float32"),
|
100 |
+
"entailment_judgment": datasets.features.ClassLabel(names=["NONE", "ENTAILMENT", "PARAPHRASE"]),
|
101 |
+
}
|
102 |
+
)
|
103 |
+
return datasets.DatasetInfo(
|
104 |
+
description=_DESCRIPTION,
|
105 |
+
features=features,
|
106 |
+
supervised_keys=None,
|
107 |
+
homepage=_HOMEPAGE,
|
108 |
+
license=_LICENSE,
|
109 |
+
citation=_CITATION,
|
110 |
+
)
|
111 |
+
|
112 |
+
def _split_generators(self, dl_manager):
|
113 |
+
"""Returns SplitGenerators."""
|
114 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
115 |
+
|
116 |
+
train_paths = []
|
117 |
+
dev_paths = []
|
118 |
+
test_paths = []
|
119 |
+
|
120 |
+
if self.config.name == "full" or self.config.name == "ptpt":
|
121 |
+
train_paths.append(os.path.join(data_dir, "assin-ptpt-train.xml"))
|
122 |
+
dev_paths.append(os.path.join(data_dir, "assin-ptpt-dev.xml"))
|
123 |
+
test_paths.append(os.path.join(data_dir, "assin-ptpt-test.xml"))
|
124 |
+
|
125 |
+
if self.config.name == "full" or self.config.name == "ptbr":
|
126 |
+
train_paths.append(os.path.join(data_dir, "assin-ptbr-train.xml"))
|
127 |
+
dev_paths.append(os.path.join(data_dir, "assin-ptbr-dev.xml"))
|
128 |
+
test_paths.append(os.path.join(data_dir, "assin-ptbr-test.xml"))
|
129 |
+
|
130 |
+
return [
|
131 |
+
datasets.SplitGenerator(
|
132 |
+
name=datasets.Split.TRAIN,
|
133 |
+
gen_kwargs={
|
134 |
+
"filepaths": train_paths,
|
135 |
+
"split": "train",
|
136 |
+
},
|
137 |
+
),
|
138 |
+
datasets.SplitGenerator(
|
139 |
+
name=datasets.Split.TEST,
|
140 |
+
gen_kwargs={
|
141 |
+
"filepaths": test_paths,
|
142 |
+
"split": "test",
|
143 |
+
},
|
144 |
+
),
|
145 |
+
datasets.SplitGenerator(
|
146 |
+
name=datasets.Split.VALIDATION,
|
147 |
+
gen_kwargs={
|
148 |
+
"filepaths": dev_paths,
|
149 |
+
"split": "dev",
|
150 |
+
},
|
151 |
+
),
|
152 |
+
]
|
153 |
+
|
154 |
+
def _generate_examples(self, filepaths, split):
|
155 |
+
""" Yields examples. """
|
156 |
+
|
157 |
+
id_ = 0
|
158 |
+
|
159 |
+
for filepath in filepaths:
|
160 |
+
|
161 |
+
with open(filepath, "rb") as f:
|
162 |
+
|
163 |
+
tree = ET.parse(f)
|
164 |
+
root = tree.getroot()
|
165 |
+
|
166 |
+
for pair in root:
|
167 |
+
|
168 |
+
yield id_, {
|
169 |
+
"sentence_pair_id": int(pair.attrib.get("id")),
|
170 |
+
"premise": pair.find(".//t").text,
|
171 |
+
"hypothesis": pair.find(".//h").text,
|
172 |
+
"relatedness_score": float(pair.attrib.get("similarity")),
|
173 |
+
"entailment_judgment": pair.attrib.get("entailment").upper(),
|
174 |
+
}
|
175 |
+
|
176 |
+
id_ += 1
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"full": {"description": "\nThe ASSIN (Avalia\u00e7\u00e3o de Similaridade Sem\u00e2ntica e INfer\u00eancia textual) corpus is a corpus annotated with pairs of sentences written in \nPortuguese that is suitable for the exploration of textual entailment and paraphrasing classifiers. The corpus contains pairs of sentences \nextracted from news articles written in European Portuguese (EP) and Brazilian Portuguese (BP), obtained from Google News Portugal \nand Brazil, respectively. To create the corpus, the authors started by collecting a set of news articles describing the \nsame event (one news article from Google News Portugal and another from Google News Brazil) from Google News. \nThen, they employed Latent Dirichlet Allocation (LDA) models to retrieve pairs of similar sentences between sets of news \narticles that were grouped together around the same topic. For that, two LDA models were trained (for EP and for BP) \non external and large-scale collections of unannotated news articles from Portuguese and Brazilian news providers, respectively. \nThen, the authors defined a lower and upper threshold for the sentence similarity score of the retrieved pairs of sentences, \ntaking into account that high similarity scores correspond to sentences that contain almost the same content (paraphrase candidates), \nand low similarity scores correspond to sentences that are very different in content from each other (no-relation candidates).\nFrom the collection of pairs of sentences obtained at this stage, the authors performed some manual grammatical corrections \nand discarded some of the pairs wrongly retrieved. Furthermore, from a preliminary analysis made to the retrieved sentence pairs \nthe authors noticed that the number of contradictions retrieved during the previous stage was very low. Additionally, they also \nnoticed that event though paraphrases are not very frequent, they occur with some frequency in news articles. Consequently, \nin contrast with the majority of the currently available corpora for other languages, which consider as labels \u201cneutral\u201d, \u201centailment\u201d \nand \u201ccontradiction\u201d for the task of RTE, the authors of the ASSIN corpus decided to use as labels \u201cnone\u201d, \u201centailment\u201d and \u201cparaphrase\u201d.\nFinally, the manual annotation of pairs of sentences was performed by human annotators. At least four annotators were randomly \nselected to annotate each pair of sentences, which is done in two steps: (i) assigning a semantic similarity label (a score between 1 and 5, \nfrom unrelated to very similar); and (ii) providing an entailment label (one sentence entails the other, sentences are paraphrases, \nor no relation). Sentence pairs where at least three annotators do not agree on the entailment label were considered controversial \nand thus discarded from the gold standard annotations. The full dataset has 10,000 sentence pairs, half of which in Brazilian Portuguese \nand half in European Portuguese. Either language variant has 2,500 pairs for training, 500 for validation and 2,000 for testing.\n", "citation": "\n@inproceedings{fonseca2016assin,\n title={ASSIN: Avaliacao de similaridade semantica e inferencia textual},\n author={Fonseca, E and Santos, L and Criscuolo, Marcelo and Aluisio, S},\n booktitle={Computational Processing of the Portuguese Language-12th International Conference, Tomar, Portugal},\n pages={13--15},\n year={2016}\n}\n", "homepage": "http://nilc.icmc.usp.br/assin/", "license": "", "features": {"sentence_pair_id": {"dtype": "int64", "id": null, "_type": "Value"}, "premise": {"dtype": "string", "id": null, "_type": "Value"}, "hypothesis": {"dtype": "string", "id": null, "_type": "Value"}, "relatedness_score": {"dtype": "float32", "id": null, "_type": "Value"}, "entailment_judgment": {"num_classes": 3, "names": ["NONE", "ENTAILMENT", "PARAPHRASE"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "assin", "config_name": "full", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 986507, "num_examples": 5000, "dataset_name": "assin"}, "test": {"name": "test", "num_bytes": 767312, "num_examples": 4000, "dataset_name": "assin"}, "validation": {"name": "validation", "num_bytes": 196829, "num_examples": 1000, "dataset_name": "assin"}}, "download_checksums": {"http://nilc.icmc.usp.br/assin/assin.tar.gz": {"num_bytes": 749735, "checksum": "ee758424477bcaa414bad95a7e7042c180826ab2119ddf7ced52f241462eca8f"}}, "download_size": 749735, "post_processing_size": null, "dataset_size": 1950648, "size_in_bytes": 2700383}, "ptpt": {"description": "\nThe ASSIN (Avalia\u00e7\u00e3o de Similaridade Sem\u00e2ntica e INfer\u00eancia textual) corpus is a corpus annotated with pairs of sentences written in \nPortuguese that is suitable for the exploration of textual entailment and paraphrasing classifiers. The corpus contains pairs of sentences \nextracted from news articles written in European Portuguese (EP) and Brazilian Portuguese (BP), obtained from Google News Portugal \nand Brazil, respectively. To create the corpus, the authors started by collecting a set of news articles describing the \nsame event (one news article from Google News Portugal and another from Google News Brazil) from Google News. \nThen, they employed Latent Dirichlet Allocation (LDA) models to retrieve pairs of similar sentences between sets of news \narticles that were grouped together around the same topic. For that, two LDA models were trained (for EP and for BP) \non external and large-scale collections of unannotated news articles from Portuguese and Brazilian news providers, respectively. \nThen, the authors defined a lower and upper threshold for the sentence similarity score of the retrieved pairs of sentences, \ntaking into account that high similarity scores correspond to sentences that contain almost the same content (paraphrase candidates), \nand low similarity scores correspond to sentences that are very different in content from each other (no-relation candidates).\nFrom the collection of pairs of sentences obtained at this stage, the authors performed some manual grammatical corrections \nand discarded some of the pairs wrongly retrieved. Furthermore, from a preliminary analysis made to the retrieved sentence pairs \nthe authors noticed that the number of contradictions retrieved during the previous stage was very low. Additionally, they also \nnoticed that event though paraphrases are not very frequent, they occur with some frequency in news articles. Consequently, \nin contrast with the majority of the currently available corpora for other languages, which consider as labels \u201cneutral\u201d, \u201centailment\u201d \nand \u201ccontradiction\u201d for the task of RTE, the authors of the ASSIN corpus decided to use as labels \u201cnone\u201d, \u201centailment\u201d and \u201cparaphrase\u201d.\nFinally, the manual annotation of pairs of sentences was performed by human annotators. At least four annotators were randomly \nselected to annotate each pair of sentences, which is done in two steps: (i) assigning a semantic similarity label (a score between 1 and 5, \nfrom unrelated to very similar); and (ii) providing an entailment label (one sentence entails the other, sentences are paraphrases, \nor no relation). Sentence pairs where at least three annotators do not agree on the entailment label were considered controversial \nand thus discarded from the gold standard annotations. The full dataset has 10,000 sentence pairs, half of which in Brazilian Portuguese \nand half in European Portuguese. Either language variant has 2,500 pairs for training, 500 for validation and 2,000 for testing.\n", "citation": "\n@inproceedings{fonseca2016assin,\n title={ASSIN: Avaliacao de similaridade semantica e inferencia textual},\n author={Fonseca, E and Santos, L and Criscuolo, Marcelo and Aluisio, S},\n booktitle={Computational Processing of the Portuguese Language-12th International Conference, Tomar, Portugal},\n pages={13--15},\n year={2016}\n}\n", "homepage": "http://nilc.icmc.usp.br/assin/", "license": "", "features": {"sentence_pair_id": {"dtype": "int64", "id": null, "_type": "Value"}, "premise": {"dtype": "string", "id": null, "_type": "Value"}, "hypothesis": {"dtype": "string", "id": null, "_type": "Value"}, "relatedness_score": {"dtype": "float32", "id": null, "_type": "Value"}, "entailment_judgment": {"num_classes": 3, "names": ["NONE", "ENTAILMENT", "PARAPHRASE"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "assin", "config_name": "ptpt", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 523002, "num_examples": 2500, "dataset_name": "assin"}, "test": {"name": "test", "num_bytes": 392888, "num_examples": 2000, "dataset_name": "assin"}, "validation": {"name": "validation", "num_bytes": 105626, "num_examples": 500, "dataset_name": "assin"}}, "download_checksums": {"http://nilc.icmc.usp.br/assin/assin.tar.gz": {"num_bytes": 749735, "checksum": "ee758424477bcaa414bad95a7e7042c180826ab2119ddf7ced52f241462eca8f"}}, "download_size": 749735, "post_processing_size": null, "dataset_size": 1021516, "size_in_bytes": 1771251}, "ptbr": {"description": "\nThe ASSIN (Avalia\u00e7\u00e3o de Similaridade Sem\u00e2ntica e INfer\u00eancia textual) corpus is a corpus annotated with pairs of sentences written in \nPortuguese that is suitable for the exploration of textual entailment and paraphrasing classifiers. The corpus contains pairs of sentences \nextracted from news articles written in European Portuguese (EP) and Brazilian Portuguese (BP), obtained from Google News Portugal \nand Brazil, respectively. To create the corpus, the authors started by collecting a set of news articles describing the \nsame event (one news article from Google News Portugal and another from Google News Brazil) from Google News. \nThen, they employed Latent Dirichlet Allocation (LDA) models to retrieve pairs of similar sentences between sets of news \narticles that were grouped together around the same topic. For that, two LDA models were trained (for EP and for BP) \non external and large-scale collections of unannotated news articles from Portuguese and Brazilian news providers, respectively. \nThen, the authors defined a lower and upper threshold for the sentence similarity score of the retrieved pairs of sentences, \ntaking into account that high similarity scores correspond to sentences that contain almost the same content (paraphrase candidates), \nand low similarity scores correspond to sentences that are very different in content from each other (no-relation candidates).\nFrom the collection of pairs of sentences obtained at this stage, the authors performed some manual grammatical corrections \nand discarded some of the pairs wrongly retrieved. Furthermore, from a preliminary analysis made to the retrieved sentence pairs \nthe authors noticed that the number of contradictions retrieved during the previous stage was very low. Additionally, they also \nnoticed that event though paraphrases are not very frequent, they occur with some frequency in news articles. Consequently, \nin contrast with the majority of the currently available corpora for other languages, which consider as labels \u201cneutral\u201d, \u201centailment\u201d \nand \u201ccontradiction\u201d for the task of RTE, the authors of the ASSIN corpus decided to use as labels \u201cnone\u201d, \u201centailment\u201d and \u201cparaphrase\u201d.\nFinally, the manual annotation of pairs of sentences was performed by human annotators. At least four annotators were randomly \nselected to annotate each pair of sentences, which is done in two steps: (i) assigning a semantic similarity label (a score between 1 and 5, \nfrom unrelated to very similar); and (ii) providing an entailment label (one sentence entails the other, sentences are paraphrases, \nor no relation). Sentence pairs where at least three annotators do not agree on the entailment label were considered controversial \nand thus discarded from the gold standard annotations. The full dataset has 10,000 sentence pairs, half of which in Brazilian Portuguese \nand half in European Portuguese. Either language variant has 2,500 pairs for training, 500 for validation and 2,000 for testing.\n", "citation": "\n@inproceedings{fonseca2016assin,\n title={ASSIN: Avaliacao de similaridade semantica e inferencia textual},\n author={Fonseca, E and Santos, L and Criscuolo, Marcelo and Aluisio, S},\n booktitle={Computational Processing of the Portuguese Language-12th International Conference, Tomar, Portugal},\n pages={13--15},\n year={2016}\n}\n", "homepage": "http://nilc.icmc.usp.br/assin/", "license": "", "features": {"sentence_pair_id": {"dtype": "int64", "id": null, "_type": "Value"}, "premise": {"dtype": "string", "id": null, "_type": "Value"}, "hypothesis": {"dtype": "string", "id": null, "_type": "Value"}, "relatedness_score": {"dtype": "float32", "id": null, "_type": "Value"}, "entailment_judgment": {"num_classes": 3, "names": ["NONE", "ENTAILMENT", "PARAPHRASE"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "assin", "config_name": "ptbr", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 463513, "num_examples": 2500, "dataset_name": "assin"}, "test": {"name": "test", "num_bytes": 374432, "num_examples": 2000, "dataset_name": "assin"}, "validation": {"name": "validation", "num_bytes": 91211, "num_examples": 500, "dataset_name": "assin"}}, "download_checksums": {"http://nilc.icmc.usp.br/assin/assin.tar.gz": {"num_bytes": 749735, "checksum": "ee758424477bcaa414bad95a7e7042c180826ab2119ddf7ced52f241462eca8f"}}, "download_size": 749735, "post_processing_size": null, "dataset_size": 929156, "size_in_bytes": 1678891}}
|
dummy/full/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7f3235f745aee219e14ee81a7cc0b14b6e936fd50dc9f8edc3bee00f1eefc71f
|
3 |
+
size 4760
|
dummy/ptbr/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7f3235f745aee219e14ee81a7cc0b14b6e936fd50dc9f8edc3bee00f1eefc71f
|
3 |
+
size 4760
|
dummy/ptpt/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7f3235f745aee219e14ee81a7cc0b14b6e936fd50dc9f8edc3bee00f1eefc71f
|
3 |
+
size 4760
|