albertvillanova HF staff commited on
Commit
8067985
1 Parent(s): fba1044

Support streaming nli_tr dataset (#4970)

Browse files

* Remove legacy codecs.open

* Remove unused import

Commit from https://github.com/huggingface/datasets/commit/e2600b0bb727a27ad7f3947c3d9054330fac05b2

Files changed (1) hide show
  1. nli_tr.py +1 -2
nli_tr.py CHANGED
@@ -15,7 +15,6 @@
15
  """NLI-TR: The Turkish translation of SNLI and MultiNLI datasets using Amazon Translate."""
16
 
17
 
18
- import codecs
19
  import json
20
  import os
21
 
@@ -152,7 +151,7 @@ class NliTr(datasets.GeneratorBasedBuilder):
152
  def _generate_examples(self, filepath, split):
153
  """Yields examples."""
154
 
155
- with codecs.open(filepath, encoding="utf-8") as f:
156
  for idx, row in enumerate(f):
157
  data = json.loads(row)
158
  example = {"idx": idx, "premise": data["sentence1"], "hypothesis": data["sentence2"]}
 
15
  """NLI-TR: The Turkish translation of SNLI and MultiNLI datasets using Amazon Translate."""
16
 
17
 
 
18
  import json
19
  import os
20
 
 
151
  def _generate_examples(self, filepath, split):
152
  """Yields examples."""
153
 
154
+ with open(filepath, encoding="utf-8") as f:
155
  for idx, row in enumerate(f):
156
  data = json.loads(row)
157
  example = {"idx": idx, "premise": data["sentence1"], "hypothesis": data["sentence2"]}