Update files from the datasets library (from 1.5.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.5.0
- dataset_infos.json +1 -1
- doc2dial.py +28 -27
dataset_infos.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"dialogue_domain": {"description": "Doc2dial is dataset of goal-oriented dialogues that are grounded in the associated documents. It includes over 4500 annotated conversations with an average of 14 turns that are grounded in over 450 documents from four domains. Compared to the prior document-grounded dialogue datasets this dataset covers a variety of dialogue scenes in information-seeking conversations.\n", "citation": "@inproceedings{feng-etal-2020-doc2dial,\n title = \"doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset\",\n author = \"Feng, Song and Wan, Hui and Gunasekara, Chulaka and Patel, Siva and Joshi, Sachindra and Lastras, Luis\",\n booktitle = \"Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)\",\n month = nov,\n year = \"2020\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.652\",\n}\n", "homepage": "https://doc2dial.github.io
|
|
|
1 |
+
{"dialogue_domain": {"description": "Doc2dial is dataset of goal-oriented dialogues that are grounded in the associated documents. It includes over 4500 annotated conversations with an average of 14 turns that are grounded in over 450 documents from four domains. Compared to the prior document-grounded dialogue datasets this dataset covers a variety of dialogue scenes in information-seeking conversations.\n", "citation": "@inproceedings{feng-etal-2020-doc2dial,\n title = \"doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset\",\n author = \"Feng, Song and Wan, Hui and Gunasekara, Chulaka and Patel, Siva and Joshi, Sachindra and Lastras, Luis\",\n booktitle = \"Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)\",\n month = nov,\n year = \"2020\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.652\",\n}\n", "homepage": "https://doc2dial.github.io", "license": "", "features": {"dial_id": {"dtype": "string", "id": null, "_type": "Value"}, "doc_id": {"dtype": "string", "id": null, "_type": "Value"}, "domain": {"dtype": "string", "id": null, "_type": "Value"}, "turns": [{"turn_id": {"dtype": "int32", "id": null, "_type": "Value"}, "role": {"dtype": "string", "id": null, "_type": "Value"}, "da": {"dtype": "string", "id": null, "_type": "Value"}, "references": [{"sp_id": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "string", "id": null, "_type": "Value"}}], "utterance": {"dtype": "string", "id": null, "_type": "Value"}}]}, "post_processed": null, "supervised_keys": null, "builder_name": "doc2dial", "config_name": "dialogue_domain", "version": {"version_str": "1.0.1", "description": null, "major": 1, "minor": 0, "patch": 1}, "splits": {"train": {"name": "train", "num_bytes": 6924209, "num_examples": 3474, "dataset_name": "doc2dial"}, "validation": {"name": "validation", "num_bytes": 1315815, "num_examples": 661, "dataset_name": "doc2dial"}}, "download_checksums": {"https://doc2dial.github.io/file/doc2dial_v1.0.1.zip": {"num_bytes": 5879543, "checksum": "c764d86628431fc1e54819d687a36f1d00b7ee95b8db2b3a7454149673ca4c17"}}, "download_size": 5879543, "post_processing_size": null, "dataset_size": 8240024, "size_in_bytes": 14119567}, "document_domain": {"description": "Doc2dial is dataset of goal-oriented dialogues that are grounded in the associated documents. It includes over 4500 annotated conversations with an average of 14 turns that are grounded in over 450 documents from four domains. Compared to the prior document-grounded dialogue datasets this dataset covers a variety of dialogue scenes in information-seeking conversations.\n", "citation": "@inproceedings{feng-etal-2020-doc2dial,\n title = \"doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset\",\n author = \"Feng, Song and Wan, Hui and Gunasekara, Chulaka and Patel, Siva and Joshi, Sachindra and Lastras, Luis\",\n booktitle = \"Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)\",\n month = nov,\n year = \"2020\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.652\",\n}\n", "homepage": "https://doc2dial.github.io", "license": "", "features": {"domain": {"dtype": "string", "id": null, "_type": "Value"}, "doc_id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "doc_text": {"dtype": "string", "id": null, "_type": "Value"}, "spans": [{"id_sp": {"dtype": "string", "id": null, "_type": "Value"}, "tag": {"dtype": "string", "id": null, "_type": "Value"}, "start_sp": {"dtype": "int32", "id": null, "_type": "Value"}, "end_sp": {"dtype": "int32", "id": null, "_type": "Value"}, "text_sp": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "parent_titles": {"dtype": "string", "id": null, "_type": "Value"}, "id_sec": {"dtype": "string", "id": null, "_type": "Value"}, "start_sec": {"dtype": "int32", "id": null, "_type": "Value"}, "text_sec": {"dtype": "string", "id": null, "_type": "Value"}, "end_sec": {"dtype": "int32", "id": null, "_type": "Value"}}], "doc_html_ts": {"dtype": "string", "id": null, "_type": "Value"}, "doc_html_raw": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "doc2dial", "config_name": "document_domain", "version": {"version_str": "1.0.1", "description": null, "major": 1, "minor": 0, "patch": 1}, "splits": {"train": {"name": "train", "num_bytes": 204874908, "num_examples": 3416, "dataset_name": "doc2dial"}}, "download_checksums": {"https://doc2dial.github.io/file/doc2dial_v1.0.1.zip": {"num_bytes": 5879543, "checksum": "c764d86628431fc1e54819d687a36f1d00b7ee95b8db2b3a7454149673ca4c17"}}, "download_size": 5879543, "post_processing_size": null, "dataset_size": 204874908, "size_in_bytes": 210754451}, "doc2dial_rc": {"description": "Doc2dial is dataset of goal-oriented dialogues that are grounded in the associated documents. It includes over 4500 annotated conversations with an average of 14 turns that are grounded in over 450 documents from four domains. Compared to the prior document-grounded dialogue datasets this dataset covers a variety of dialogue scenes in information-seeking conversations.\n", "citation": "@inproceedings{feng-etal-2020-doc2dial,\n title = \"doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset\",\n author = \"Feng, Song and Wan, Hui and Gunasekara, Chulaka and Patel, Siva and Joshi, Sachindra and Lastras, Luis\",\n booktitle = \"Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)\",\n month = nov,\n year = \"2020\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.652\",\n}\n", "homepage": "https://doc2dial.github.io", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "answer_start": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "domain": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "doc2dial", "config_name": "doc2dial_rc", "version": {"version_str": "1.0.1", "description": null, "major": 1, "minor": 0, "patch": 1}, "splits": {"validation": {"name": "validation", "num_bytes": 22705288, "num_examples": 3972, "dataset_name": "doc2dial"}, "train": {"name": "train", "num_bytes": 114778994, "num_examples": 20431, "dataset_name": "doc2dial"}}, "download_checksums": {"https://doc2dial.github.io/file/doc2dial_v1.0.1.zip": {"num_bytes": 5879543, "checksum": "c764d86628431fc1e54819d687a36f1d00b7ee95b8db2b3a7454149673ca4c17"}}, "download_size": 5879543, "post_processing_size": null, "dataset_size": 137484282, "size_in_bytes": 143363825}}
|
doc2dial.py
CHANGED
@@ -250,34 +250,33 @@ class Doc2dial(datasets.GeneratorBasedBuilder):
|
|
250 |
data = json.load(f)
|
251 |
for domain in data["doc_data"]:
|
252 |
for doc_id in data["doc_data"][domain]:
|
253 |
-
for dialogue in data["doc_data"][domain][doc_id]:
|
254 |
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
|
282 |
elif self.config.name == "doc2dial_rc":
|
283 |
"""Load dialog data in the reading comprehension task setup, where context is the grounding document,
|
@@ -301,6 +300,8 @@ class Doc2dial(datasets.GeneratorBasedBuilder):
|
|
301 |
turn_to_predict = dial["turns"][idx + 1]
|
302 |
else:
|
303 |
continue
|
|
|
|
|
304 |
question = " ".join(list(reversed(all_prev_utterances))).strip()
|
305 |
id_ = "{}_{}".format(dial["dial_id"], turn["turn_id"])
|
306 |
qa = {
|
|
|
250 |
data = json.load(f)
|
251 |
for domain in data["doc_data"]:
|
252 |
for doc_id in data["doc_data"][domain]:
|
|
|
253 |
|
254 |
+
yield doc_id, {
|
255 |
+
"domain": domain,
|
256 |
+
"doc_id": doc_id,
|
257 |
+
"title": data["doc_data"][domain][doc_id]["title"],
|
258 |
+
"doc_text": data["doc_data"][domain][doc_id]["doc_text"],
|
259 |
+
"spans": [
|
260 |
+
{
|
261 |
+
"id_sp": data["doc_data"][domain][doc_id]["spans"][i]["id_sp"],
|
262 |
+
"tag": data["doc_data"][domain][doc_id]["spans"][i]["tag"],
|
263 |
+
"start_sp": data["doc_data"][domain][doc_id]["spans"][i]["start_sp"],
|
264 |
+
"end_sp": data["doc_data"][domain][doc_id]["spans"][i]["end_sp"],
|
265 |
+
"text_sp": data["doc_data"][domain][doc_id]["spans"][i]["text_sp"],
|
266 |
+
"title": data["doc_data"][domain][doc_id]["spans"][i]["title"],
|
267 |
+
"parent_titles": str(
|
268 |
+
data["doc_data"][domain][doc_id]["spans"][i]["parent_titles"]
|
269 |
+
),
|
270 |
+
"id_sec": data["doc_data"][domain][doc_id]["spans"][i]["id_sec"],
|
271 |
+
"start_sec": data["doc_data"][domain][doc_id]["spans"][i]["start_sec"],
|
272 |
+
"text_sec": data["doc_data"][domain][doc_id]["spans"][i]["text_sec"],
|
273 |
+
"end_sec": data["doc_data"][domain][doc_id]["spans"][i]["end_sec"],
|
274 |
+
}
|
275 |
+
for i in data["doc_data"][domain][doc_id]["spans"]
|
276 |
+
],
|
277 |
+
"doc_html_ts": data["doc_data"][domain][doc_id]["doc_html_ts"],
|
278 |
+
"doc_html_raw": data["doc_data"][domain][doc_id]["doc_html_raw"],
|
279 |
+
}
|
280 |
|
281 |
elif self.config.name == "doc2dial_rc":
|
282 |
"""Load dialog data in the reading comprehension task setup, where context is the grounding document,
|
|
|
300 |
turn_to_predict = dial["turns"][idx + 1]
|
301 |
else:
|
302 |
continue
|
303 |
+
else:
|
304 |
+
continue
|
305 |
question = " ".join(list(reversed(all_prev_utterances))).strip()
|
306 |
id_ = "{}_{}".format(dial["dial_id"], turn["turn_id"])
|
307 |
qa = {
|