system HF staff commited on
Commit
1743b7a
·
1 Parent(s): 68c5599

Update files from the datasets library (from 1.4.0)

Browse files

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

Files changed (1) hide show
  1. doc2dial.py +6 -4
doc2dial.py CHANGED
@@ -19,12 +19,14 @@
19
  from __future__ import absolute_import, division, print_function
20
 
21
  import json
22
- import logging
23
  import os
24
 
25
  import datasets
26
 
27
 
 
 
 
28
  _CITATION = """\
29
  @inproceedings{feng-etal-2020-doc2dial,
30
  title = "doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset",
@@ -225,7 +227,7 @@ class Doc2dial(datasets.GeneratorBasedBuilder):
225
  def _generate_examples(self, filepath):
226
  """This function returns the examples in the raw (text) form."""
227
  if self.config.name == "dialogue_domain":
228
- logging.info("generating examples from = %s", filepath)
229
  with open(filepath, encoding="utf-8") as f:
230
  data = json.load(f)
231
  for domain in data["dial_data"]:
@@ -243,7 +245,7 @@ class Doc2dial(datasets.GeneratorBasedBuilder):
243
 
244
  elif self.config.name == "document_domain":
245
 
246
- logging.info("generating examples from = %s", filepath)
247
  with open(filepath, encoding="utf-8") as f:
248
  data = json.load(f)
249
  for domain in data["doc_data"]:
@@ -281,7 +283,7 @@ class Doc2dial(datasets.GeneratorBasedBuilder):
281
  """Load dialog data in the reading comprehension task setup, where context is the grounding document,
282
  input query is dialog history in reversed order, and output to predict is the next agent turn."""
283
 
284
- logging.info("generating examples from = %s", filepath)
285
  doc_data = self._load_doc_data_rc(filepath)
286
  with open(filepath, encoding="utf-8") as f:
287
  dial_data = json.load(f)["dial_data"]
 
19
  from __future__ import absolute_import, division, print_function
20
 
21
  import json
 
22
  import os
23
 
24
  import datasets
25
 
26
 
27
+ logger = datasets.logging.get_logger(__name__)
28
+
29
+
30
  _CITATION = """\
31
  @inproceedings{feng-etal-2020-doc2dial,
32
  title = "doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset",
 
227
  def _generate_examples(self, filepath):
228
  """This function returns the examples in the raw (text) form."""
229
  if self.config.name == "dialogue_domain":
230
+ logger.info("generating examples from = %s", filepath)
231
  with open(filepath, encoding="utf-8") as f:
232
  data = json.load(f)
233
  for domain in data["dial_data"]:
 
245
 
246
  elif self.config.name == "document_domain":
247
 
248
+ logger.info("generating examples from = %s", filepath)
249
  with open(filepath, encoding="utf-8") as f:
250
  data = json.load(f)
251
  for domain in data["doc_data"]:
 
283
  """Load dialog data in the reading comprehension task setup, where context is the grounding document,
284
  input query is dialog history in reversed order, and output to predict is the next agent turn."""
285
 
286
+ logger.info("generating examples from = %s", filepath)
287
  doc_data = self._load_doc_data_rc(filepath)
288
  with open(filepath, encoding="utf-8") as f:
289
  dial_data = json.load(f)["dial_data"]