Datasets:
Commit
•
4df098e
1
Parent(s):
e8f12cd
Update sts-sohu2021.py
Browse files- 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 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
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
|