Sampson2022
commited on
Commit
•
dcd7e33
1
Parent(s):
b4095b0
Update demo2.py
Browse files
demo2.py
CHANGED
@@ -95,11 +95,11 @@ class Demo2(datasets.GeneratorBasedBuilder):
|
|
95 |
]
|
96 |
|
97 |
def _generate_examples(self, filepath):
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
|
|
95 |
]
|
96 |
|
97 |
def _generate_examples(self, filepath):
|
98 |
+
logger.info("generating examples from = %s", filepath)
|
99 |
+
with open(filepath, encoding="utf-8") as f:
|
100 |
+
demo2 = csv.DictReader(f)
|
101 |
+
for key, row in enumerate(demo2):
|
102 |
+
yield key, {
|
103 |
+
"text": row['text'],
|
104 |
+
"label": row['label'],
|
105 |
+
}
|