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

Update files from the datasets library (from 1.3.0)

Browse files

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

Files changed (3) hide show
  1. README.md +8 -3
  2. brwac.py +5 -5
  3. dataset_infos.json +1 -1
README.md CHANGED
@@ -43,6 +43,7 @@ task_ids:
43
  - [Dataset Curators](#dataset-curators)
44
  - [Licensing Information](#licensing-information)
45
  - [Citation Information](#citation-information)
 
46
 
47
  ## Dataset Description
48
 
@@ -76,8 +77,8 @@ An example from the BrWaC dataset looks as follows:
76
  ```
77
  {
78
  "doc_id": "netg-1afc73",
79
- "paragraphs": {
80
- "sentences": [
81
  [
82
  "Conteúdo recente"
83
  ],
@@ -113,7 +114,7 @@ An example from the BrWaC dataset looks as follows:
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
 
@@ -183,3 +184,7 @@ The data is only split into train set with size of 3530796 samples.
183
  year={2018}
184
  }
185
  ```
 
 
 
 
43
  - [Dataset Curators](#dataset-curators)
44
  - [Licensing Information](#licensing-information)
45
  - [Citation Information](#citation-information)
46
+ - [Contributions](#contributions)
47
 
48
  ## Dataset Description
49
 
77
  ```
78
  {
79
  "doc_id": "netg-1afc73",
80
+ "text": {
81
+ "paragraphs": [
82
  [
83
  "Conteúdo recente"
84
  ],
114
  - `doc_id`: The document ID
115
  - `title`: The document title
116
  - `uri`: URI where the document was extracted from
117
+ - `text`: A list of document paragraphs (with a list of sentences in it as a list of strings)
118
 
119
  ### Data Splits
120
 
184
  year={2018}
185
  }
186
  ```
187
+
188
+ ### Contributions
189
+
190
+ Thanks to [@jonatasgrosman](https://github.com/jonatasgrosman) for adding this dataset.
brwac.py CHANGED
@@ -65,7 +65,7 @@ class Brwac(datasets.GeneratorBasedBuilder):
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(
@@ -104,7 +104,7 @@ class Brwac(datasets.GeneratorBasedBuilder):
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
 
@@ -125,7 +125,7 @@ class Brwac(datasets.GeneratorBasedBuilder):
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:
@@ -136,8 +136,8 @@ class Brwac(datasets.GeneratorBasedBuilder):
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 = "", [], []
65
  "doc_id": datasets.Value("string"),
66
  "title": datasets.Value("string"),
67
  "uri": datasets.Value("string"),
68
+ "text": datasets.Sequence({"paragraphs": datasets.Sequence(datasets.Value("string"))}),
69
  }
70
  )
71
  return datasets.DatasetInfo(
104
 
105
  add_space = 1
106
  doc_id, title, uri = None, None, None
107
+ current_sentence, current_paragraph_sentences, text = "", [], []
108
  id_ = 0
109
  for line in f:
110
 
125
  current_sentence = ""
126
 
127
  elif line == "</p>": # end paragraph
128
+ text.append({"paragraphs": current_paragraph_sentences})
129
  current_paragraph_sentences = []
130
 
131
  elif len(current_sentence) == 0:
136
  add_space = 1
137
 
138
  if line.strip() == "</doc>": # doc end
139
+ yield id_, {"doc_id": doc_id, "title": title, "uri": uri, "text": text}
140
  id_ += 1
141
  add_space = 1
142
  doc_id, title, uri = None, None, None
143
+ current_sentence, current_paragraph_sentences, text = "", [], []
dataset_infos.json CHANGED
@@ -1 +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}}
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"}, "text": {"feature": {"paragraphs": {"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}}