system HF staff commited on
Commit
c799b78
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.0

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +185 -0
  3. brwac.py +143 -0
  4. dataset_infos.json +1 -0
  5. dummy/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,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - pt
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - n>1M
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - sequence-modeling
18
+ task_ids:
19
+ - language-modeling
20
+ ---
21
+
22
+ # Dataset Card for BrWaC
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-fields)
32
+ - [Data Splits](#data-splits)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage:** [BrWaC homepage](https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC)
50
+ - **Repository:** [BrWaC repository](https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC)
51
+ - **Paper:** [The brWaC Corpus: A New Open Resource for Brazilian Portuguese](https://www.aclweb.org/anthology/L18-1686/)
52
+ - **Point of Contact:** [Jorge A. Wagner Filho](mailto:jawfilho@inf.ufrgs.br)
53
+
54
+ ### Dataset Summary
55
+
56
+ The BrWaC (Brazilian Portuguese Web as Corpus) is a large corpus constructed following the Wacky framework,
57
+ which was made public for research purposes. The current corpus version, released in January 2017, is composed by
58
+ 3.53 million documents, 2.68 billion tokens and 5.79 million types. Please note that this resource is available
59
+ solely for academic research purposes, and you agreed not to use it for any commercial applications.
60
+ Manually download at https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC
61
+
62
+ ### Supported Tasks and Leaderboards
63
+
64
+ [More Information Needed]
65
+
66
+ ### Languages
67
+
68
+ Portuguese
69
+
70
+ ## Dataset Structure
71
+
72
+ ### Data Instances
73
+
74
+ An example from the BrWaC dataset looks as follows:
75
+
76
+ ```
77
+ {
78
+ "doc_id": "netg-1afc73",
79
+ "paragraphs": {
80
+ "sentences": [
81
+ [
82
+ "Conteúdo recente"
83
+ ],
84
+ [
85
+ "ESPUMA MARROM CHAMADA \"NINGUÉM MERECE\""
86
+ ],
87
+ [
88
+ "31 de Agosto de 2015, 7:07 , por paulo soavinski - | No one following this article yet."
89
+ ],
90
+ [
91
+ "Visualizado 202 vezes"
92
+ ],
93
+ [
94
+ "JORNAL ELETRÔNICO DA ILHA DO MEL"
95
+ ],
96
+ [
97
+ "Uma espuma marrom escuro tem aparecido com frequência na Praia de Fora.",
98
+ "Na faixa de areia ela aparece disseminada e não chama muito a atenção.",
99
+ "No Buraco do Aipo, com muitas pedras, ela aparece concentrada.",
100
+ "É fácil saber que esta espuma estranha está lá, quando venta.",
101
+ "Pequenos algodões de espuma começam a flutuar no espaço, pertinho da Praia do Saquinho.",
102
+ "Quem pode ajudar na coleta deste material, envio a laboratório renomado e pagamento de análises, favor entrar em contato com o site."
103
+ ]
104
+ ]
105
+ },
106
+ "title": "ESPUMA MARROM CHAMADA ‟NINGUÉM MERECE‟ - paulo soavinski",
107
+ "uri": "http://blogoosfero.cc/ilhadomel/pousadasilhadomel.com.br/espuma-marrom-chamada-ninguem-merece"
108
+ }
109
+ ```
110
+
111
+ ### Data Fields
112
+
113
+ - `doc_id`: The document ID
114
+ - `title`: The document title
115
+ - `uri`: URI where the document was extracted from
116
+ - `paragraphs`: A list of document paragraphs (with a list of sentences in it as a list of strings)
117
+
118
+ ### Data Splits
119
+
120
+ The data is only split into train set with size of 3530796 samples.
121
+
122
+ ## Dataset Creation
123
+
124
+ ### Curation Rationale
125
+
126
+ [More Information Needed]
127
+
128
+ ### Source Data
129
+
130
+ #### Initial Data Collection and Normalization
131
+
132
+ [More Information Needed]
133
+
134
+ #### Who are the source language producers?
135
+
136
+ [More Information Needed]
137
+
138
+ ### Annotations
139
+
140
+ #### Annotation process
141
+
142
+ [More Information Needed]
143
+
144
+ #### Who are the annotators?
145
+
146
+ [More Information Needed]
147
+
148
+ ### Personal and Sensitive Information
149
+
150
+ [More Information Needed]
151
+
152
+ ## Considerations for Using the Data
153
+
154
+ ### Social Impact of Dataset
155
+
156
+ [More Information Needed]
157
+
158
+ ### Discussion of Biases
159
+
160
+ [More Information Needed]
161
+
162
+ ### Other Known Limitations
163
+
164
+ [More Information Needed]
165
+
166
+ ## Additional Information
167
+
168
+ ### Dataset Curators
169
+
170
+ [More Information Needed]
171
+
172
+ ### Licensing Information
173
+
174
+ [More Information Needed]
175
+
176
+ ### Citation Information
177
+
178
+ ```
179
+ @inproceedings{wagner2018brwac,
180
+ title={The brwac corpus: A new open resource for brazilian portuguese},
181
+ author={Wagner Filho, Jorge A and Wilkens, Rodrigo and Idiart, Marco and Villavicencio, Aline},
182
+ booktitle={Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},
183
+ year={2018}
184
+ }
185
+ ```
brwac.py ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """BrWaC dataset"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import os
20
+ import re
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """
26
+ @inproceedings{wagner2018brwac,
27
+ title={The brwac corpus: A new open resource for brazilian portuguese},
28
+ author={Wagner Filho, Jorge A and Wilkens, Rodrigo and Idiart, Marco and Villavicencio, Aline},
29
+ booktitle={Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},
30
+ year={2018}
31
+ }
32
+ """
33
+
34
+ _DESCRIPTION = """
35
+ The BrWaC (Brazilian Portuguese Web as Corpus) is a large corpus constructed following the Wacky framework,
36
+ which was made public for research purposes. The current corpus version, released in January 2017, is composed by
37
+ 3.53 million documents, 2.68 billion tokens and 5.79 million types. Please note that this resource is available
38
+ solely for academic research purposes, and you agreed not to use it for any commercial applications.
39
+ Manually download at https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC
40
+ """
41
+
42
+ _HOMEPAGE = "https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC"
43
+
44
+ _LICENSE = ""
45
+
46
+
47
+ class Brwac(datasets.GeneratorBasedBuilder):
48
+ """BrWaC dataset"""
49
+
50
+ VERSION = datasets.Version("1.0.0")
51
+
52
+ @property
53
+ def manual_download_instructions(self):
54
+ return """
55
+ You need to
56
+ 1. Manually download `brwac.vert.gz` from https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC
57
+ 2. Extract the brwac.vert.gz in; this will result in the file brwac.vert in a folder <path/to/folder>
58
+ The <path/to/folder> can e.g. be `~/Downloads`.
59
+ BrWaC can then be loaded using the following command `datasets.load_dataset("brwac", data_dir="<path/to/folder>")`.
60
+ """
61
+
62
+ def _info(self):
63
+ features = datasets.Features(
64
+ {
65
+ "doc_id": datasets.Value("string"),
66
+ "title": datasets.Value("string"),
67
+ "uri": datasets.Value("string"),
68
+ "paragraphs": datasets.Sequence({"sentences": datasets.Sequence(datasets.Value("string"))}),
69
+ }
70
+ )
71
+ return datasets.DatasetInfo(
72
+ description=_DESCRIPTION,
73
+ features=features,
74
+ supervised_keys=None,
75
+ homepage=_HOMEPAGE,
76
+ license=_LICENSE,
77
+ citation=_CITATION,
78
+ )
79
+
80
+ def _split_generators(self, dl_manager):
81
+ """Returns SplitGenerators."""
82
+ data_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
83
+
84
+ # check if manual folder exists
85
+ if not os.path.exists(data_dir):
86
+ raise FileNotFoundError(
87
+ f"{data_dir} does not exist. Make sure you insert a manual dir via `datasetts.load_dataset('brwac', data_dir=...)`. Manual download instructions: {self.manual_download_instructions})"
88
+ )
89
+
90
+ return [
91
+ datasets.SplitGenerator(
92
+ name=datasets.Split.TRAIN,
93
+ gen_kwargs={
94
+ "filepath": os.path.join(data_dir, "brwac.vert"),
95
+ "split": "train",
96
+ },
97
+ )
98
+ ]
99
+
100
+ def _generate_examples(self, filepath, split):
101
+ """ Yields examples. """
102
+
103
+ with open(filepath, encoding="utf-8") as f:
104
+
105
+ add_space = 1
106
+ doc_id, title, uri = None, None, None
107
+ current_sentence, current_paragraph_sentences, paragraphs = "", [], []
108
+ id_ = 0
109
+ for line in f:
110
+
111
+ line = line.strip()
112
+
113
+ if line not in ["<p>", "<s>"]: # skip these tags
114
+
115
+ if line.startswith("<doc"): # doc begin
116
+ doc_id = re.findall('docid="(.*?)"', line)[0]
117
+ title = re.findall('title="(.*?)"', line)[0]
118
+ uri = re.findall('uri="(.*?)"', line)[0]
119
+
120
+ elif line == "<g/>": # don't add space with <g/> occurrence
121
+ add_space = 0
122
+
123
+ elif line == "</s>": # end sentence
124
+ current_paragraph_sentences.append(current_sentence)
125
+ current_sentence = ""
126
+
127
+ elif line == "</p>": # end paragraph
128
+ paragraphs.append({"sentences": current_paragraph_sentences})
129
+ current_paragraph_sentences = []
130
+
131
+ elif len(current_sentence) == 0:
132
+ current_sentence = line
133
+
134
+ else:
135
+ current_sentence = (add_space * " ").join([current_sentence, line])
136
+ add_space = 1
137
+
138
+ if line.strip() == "</doc>": # doc end
139
+ yield id_, {"doc_id": doc_id, "title": title, "uri": uri, "paragraphs": paragraphs}
140
+ id_ += 1
141
+ add_space = 1
142
+ doc_id, title, uri = None, None, None
143
+ current_sentence, current_paragraph_sentences, paragraphs = "", [], []
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "\nThe BrWaC (Brazilian Portuguese Web as Corpus) is a large corpus constructed following the Wacky framework,\nwhich was made public for research purposes. The current corpus version, released in January 2017, is composed by\n3.53 million documents, 2.68 billion tokens and 5.79 million types. Please note that this resource is available\nsolely for academic research purposes, and you agreed not to use it for any commercial applications.\nManually download at https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC\n", "citation": "\n@inproceedings{wagner2018brwac,\n title={The brwac corpus: A new open resource for brazilian portuguese},\n author={Wagner Filho, Jorge A and Wilkens, Rodrigo and Idiart, Marco and Villavicencio, Aline},\n booktitle={Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},\n year={2018}\n}\n", "homepage": "https://www.inf.ufrgs.br/pln/wiki/index.php?title=BrWaC", "license": "", "features": {"doc_id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "uri": {"dtype": "string", "id": null, "_type": "Value"}, "paragraphs": {"feature": {"sentences": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "brwac", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 18828421452, "num_examples": 3530796, "dataset_name": "brwac"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 18828421452, "size_in_bytes": 18828421452}}
dummy/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b45b734270395f4fd9e5acc82c849294efd6f63267ff01cd98d0f94674106f6
3
+ size 3106