Datasets:
Update Persian-conversational-dataset.py
Browse files
Persian-conversational-dataset.py
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
"""TODO(empathetic_dialogues): Add a description here."""
|
4 |
|
5 |
|
6 |
-
import csv
|
|
|
7 |
|
8 |
import datasets
|
9 |
from datasets.tasks import QuestionAnsweringExtractive
|
@@ -20,8 +21,8 @@ _URL = "https://huggingface.co/datasets/Kamtera/Persian-conversational-dataset/b
|
|
20 |
_URLS = [
|
21 |
"dadrah_dataset.json",
|
22 |
"dadrah_dataset1-1000_10000.json",
|
23 |
-
|
24 |
-
|
25 |
]
|
26 |
|
27 |
class persianConversation(datasets.GeneratorBasedBuilder):
|
@@ -80,6 +81,7 @@ class persianConversation(datasets.GeneratorBasedBuilder):
|
|
80 |
|
81 |
def _generate_examples(self, files, split_file):
|
82 |
"""Yields examples."""
|
|
|
83 |
logger.info("| > generate examples for "+split_file)
|
84 |
logger.info(files)
|
85 |
for path in files:
|
@@ -90,8 +92,6 @@ class persianConversation(datasets.GeneratorBasedBuilder):
|
|
90 |
question=row[1]
|
91 |
answers=row[2]
|
92 |
keywords=row[3]
|
93 |
-
if id_==20:
|
94 |
-
break;
|
95 |
yield id_, {
|
96 |
"title": title,
|
97 |
"question": question,
|
|
|
3 |
"""TODO(empathetic_dialogues): Add a description here."""
|
4 |
|
5 |
|
6 |
+
import csv
|
7 |
+
import json
|
8 |
|
9 |
import datasets
|
10 |
from datasets.tasks import QuestionAnsweringExtractive
|
|
|
21 |
_URLS = [
|
22 |
"dadrah_dataset.json",
|
23 |
"dadrah_dataset1-1000_10000.json",
|
24 |
+
"dadrah_dataset1-10000_100000.json",
|
25 |
+
"dadrah_dataset1-100000_276342.json",
|
26 |
]
|
27 |
|
28 |
class persianConversation(datasets.GeneratorBasedBuilder):
|
|
|
81 |
|
82 |
def _generate_examples(self, files, split_file):
|
83 |
"""Yields examples."""
|
84 |
+
import json
|
85 |
logger.info("| > generate examples for "+split_file)
|
86 |
logger.info(files)
|
87 |
for path in files:
|
|
|
92 |
question=row[1]
|
93 |
answers=row[2]
|
94 |
keywords=row[3]
|
|
|
|
|
95 |
yield id_, {
|
96 |
"title": title,
|
97 |
"question": question,
|