Datasets:
Update Persian-conversational-dataset.py
Browse files
Persian-conversational-dataset.py
CHANGED
@@ -64,7 +64,7 @@ class persianConversation(datasets.GeneratorBasedBuilder):
|
|
64 |
name=datasets.Split.TRAIN,
|
65 |
# These kwargs will be passed to _generate_examples
|
66 |
gen_kwargs={
|
67 |
-
"files": downloaded_files[1:
|
68 |
"split_file": "train",
|
69 |
},
|
70 |
),
|
@@ -82,10 +82,9 @@ class persianConversation(datasets.GeneratorBasedBuilder):
|
|
82 |
"""Yields examples."""
|
83 |
logger.info("| > generate examples for "+split_file)
|
84 |
logger.info(files)
|
85 |
-
for path
|
86 |
-
|
87 |
-
|
88 |
-
data=json.load(fmm)
|
89 |
for id_, row in enumerate(data):
|
90 |
title=row[0]
|
91 |
question=row[1]
|
@@ -98,6 +97,4 @@ class persianConversation(datasets.GeneratorBasedBuilder):
|
|
98 |
"question": question,
|
99 |
"answers": answers,
|
100 |
"keywords": keywords,
|
101 |
-
}
|
102 |
-
|
103 |
-
break
|
|
|
64 |
name=datasets.Split.TRAIN,
|
65 |
# These kwargs will be passed to _generate_examples
|
66 |
gen_kwargs={
|
67 |
+
"files": downloaded_files[1:],
|
68 |
"split_file": "train",
|
69 |
},
|
70 |
),
|
|
|
82 |
"""Yields examples."""
|
83 |
logger.info("| > generate examples for "+split_file)
|
84 |
logger.info(files)
|
85 |
+
for path in files:
|
86 |
+
with open(path, 'r', encoding='utf-8') as fmm:
|
87 |
+
data=json.load(fmm)
|
|
|
88 |
for id_, row in enumerate(data):
|
89 |
title=row[0]
|
90 |
question=row[1]
|
|
|
97 |
"question": question,
|
98 |
"answers": answers,
|
99 |
"keywords": keywords,
|
100 |
+
}
|
|
|
|