shibing624 commited on
Commit
4df098e
1 Parent(s): e8f12cd

Update sts-sohu2021.py

Browse files
Files changed (1) hide show
  1. sts-sohu2021.py +8 -7
sts-sohu2021.py CHANGED
@@ -100,10 +100,11 @@ class Sohu(datasets.GeneratorBasedBuilder):
100
  for file in filepath:
101
  with open(file, encoding="utf-8") as f:
102
  for key, row in enumerate(f):
103
- data = json.loads(row.strip())
104
- yield id, {
105
- "sentence1": data["sentence1"],
106
- "sentence2": data["sentence2"],
107
- "label": int(data["label"])
108
- }
109
- id += 1
 
 
100
  for file in filepath:
101
  with open(file, encoding="utf-8") as f:
102
  for key, row in enumerate(f):
103
+ if row.strip():
104
+ data = json.loads(row.strip())
105
+ yield id, {
106
+ "sentence1": data["sentence1"],
107
+ "sentence2": data["sentence2"],
108
+ "label": int(data["label"])
109
+ }
110
+ id += 1