asahi417 commited on
Commit
f1f8eec
1 Parent(s): 1ddf0e8
Files changed (1) hide show
  1. tweet_topic_multilingual.py +2 -3
tweet_topic_multilingual.py CHANGED
@@ -54,10 +54,9 @@ class TweetTopicMultilingual(datasets.GeneratorBasedBuilder):
54
  _key = 0
55
  logger.info("generating examples from = %s", filepath)
56
  with open(filepath, encoding="utf-8") as f:
57
- _list = f.read().split('\n')
58
  for i in _list:
59
- data = json.loads(i)
60
- yield _key, data
61
  _key += 1
62
 
63
  def _info(self):
 
54
  _key = 0
55
  logger.info("generating examples from = %s", filepath)
56
  with open(filepath, encoding="utf-8") as f:
57
+ _list = [json.loads(i) for i in f.read().split('\n') if i]
58
  for i in _list:
59
+ yield _key, i
 
60
  _key += 1
61
 
62
  def _info(self):