imvladikon commited on
Commit
76caff6
1 Parent(s): f01a46e

Update hebrew_news.py

Browse files
Files changed (1) hide show
  1. hebrew_news.py +3 -3
hebrew_news.py CHANGED
@@ -68,9 +68,9 @@ class HebrewNews(datasets.GeneratorBasedBuilder):
68
 
69
  def _generate_examples(self, archive_iter):
70
  for filepath, f in archive_iter:
71
- csv_file = io.TextIOWrapper(f, encoding="utf-8")
72
- fieldnames = ["articleBody", "description", "headline", "title"]
73
- reader = csv.DictReader(csv_file, delimiter=",", fieldnames=fieldnames)
74
  next(reader)
75
  for idx, row in enumerate(reader):
76
  yield idx, {
 
68
 
69
  def _generate_examples(self, archive_iter):
70
  for filepath, f in archive_iter:
71
+ file_iter = (line.decode("utf-8") for line in f)
72
+ fieldnames = ["articleBody", "description", "headline", "title"]
73
+ reader = csv.DictReader(file_iter, delimiter=",", fieldnames=fieldnames)
74
  next(reader)
75
  for idx, row in enumerate(reader):
76
  yield idx, {