shanya commited on
Commit
b0c84a5
1 Parent(s): 1b9b014

Fix yield for crd3 (#4240)

Browse files

* yielding example per chunk id

* changing data type for turns

* removing unused variable

* Update crd3.py

Co-authored-by: Shanya Sharma - s0s0cr3 <Shanya.Sharma@walmartlabs.com>

Commit from https://github.com/huggingface/datasets/commit/23efe55f5547c640f9efdcb2bc678fb7b76e663e

Files changed (2) hide show
  1. crd3.py +22 -21
  2. dataset_infos.json +1 -1
crd3.py CHANGED
@@ -74,13 +74,13 @@ class CRD3(datasets.GeneratorBasedBuilder):
74
  "turn_start": datasets.Value("int32"),
75
  "turn_end": datasets.Value("int32"),
76
  "alignment_score": datasets.Value("float32"),
77
- "turn_num": datasets.Value("int32"),
78
- "turns": datasets.features.Sequence(
79
  {
80
- "names": datasets.Value("string"),
81
- "utterances": datasets.Value("string"),
 
82
  }
83
- ),
84
  }
85
  ),
86
  homepage="https://github.com/RevanthRameshkumar/CRD3",
@@ -135,19 +135,20 @@ class CRD3(datasets.GeneratorBasedBuilder):
135
  turn_start = row["ALIGNMENT"]["TURN START"]
136
  turn_end = row["ALIGNMENT"]["TURN END"]
137
  score = row["ALIGNMENT"]["ALIGNMENT SCORE"]
138
- for id2, turn in enumerate(row["TURNS"]):
139
- turn_names = turn["NAMES"]
140
- turn_utterances = turn["UTTERANCES"]
141
- turn_num = turn["NUMBER"]
142
- yield str(id0) + "_" + str(id1) + "_" + str(id2), {
143
- "chunk": chunk,
144
- "chunk_id": chunk_id,
145
- "turn_start": turn_start,
146
- "turn_end": turn_end,
147
- "alignment_score": score,
148
- "turn_num": turn_num,
149
- "turns": {
150
- "names": turn_names,
151
- "utterances": turn_utterances,
152
- },
153
- }
 
 
74
  "turn_start": datasets.Value("int32"),
75
  "turn_end": datasets.Value("int32"),
76
  "alignment_score": datasets.Value("float32"),
77
+ "turns": [
 
78
  {
79
+ "names": datasets.features.Sequence(datasets.Value("string")),
80
+ "utterances": datasets.features.Sequence(datasets.Value("string")),
81
+ "number": datasets.Value("int32"),
82
  }
83
+ ],
84
  }
85
  ),
86
  homepage="https://github.com/RevanthRameshkumar/CRD3",
 
135
  turn_start = row["ALIGNMENT"]["TURN START"]
136
  turn_end = row["ALIGNMENT"]["TURN END"]
137
  score = row["ALIGNMENT"]["ALIGNMENT SCORE"]
138
+ for turn in row["TURNS"]:
139
+ turn["names"] = turn["NAMES"]
140
+ turn["utterances"] = turn["UTTERANCES"]
141
+ turn["number"] = turn["NUMBER"]
142
+
143
+ del turn["NAMES"]
144
+ del turn["UTTERANCES"]
145
+ del turn["NUMBER"]
146
+
147
+ yield str(id0) + "_" + str(id1), {
148
+ "chunk": chunk,
149
+ "chunk_id": chunk_id,
150
+ "turn_start": turn_start,
151
+ "turn_end": turn_end,
152
+ "alignment_score": score,
153
+ "turns": row["TURNS"],
154
+ }
dataset_infos.json CHANGED
@@ -1 +1 @@
1
- {"default": {"description": "\nStorytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset.\nCritical Role is an unscripted, live-streamed show where a fixed group of people play Dungeons and Dragons, an open-ended role-playing game.\nThe dataset is collected from 159 Critical Role episodes transcribed to text dialogues, consisting of 398,682 turns. It also includes corresponding\nabstractive summaries collected from the Fandom wiki. The dataset is linguistically unique in that the narratives are generated entirely through player\ncollaboration and spoken interaction. For each dialogue, there are a large number of turns, multiple abstractive summaries with varying levels of detail,\nand semantic ties to the previous dialogues.\n", "citation": "\n@inproceedings{\ntitle = {Storytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset},\nauthor = {Rameshkumar, Revanth and Bailey, Peter},\nyear = {2020},\npublisher = {Association for Computational Linguistics},\nconference = {ACL}\n}\n ", "homepage": "https://github.com/RevanthRameshkumar/CRD3", "license": "", "features": {"chunk": {"dtype": "string", "id": null, "_type": "Value"}, "chunk_id": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_start": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_end": {"dtype": "int32", "id": null, "_type": "Value"}, "alignment_score": {"dtype": "float32", "id": null, "_type": "Value"}, "turn_num": {"dtype": "int32", "id": null, "_type": "Value"}, "turns": {"feature": {"names": {"dtype": "string", "id": null, "_type": "Value"}, "utterances": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "crd3", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1402558174, "num_examples": 2942362, "dataset_name": "crd3"}, "test": {"name": "test", "num_bytes": 1402558174, "num_examples": 2942362, "dataset_name": "crd3"}, "validation": {"name": "validation", "num_bytes": 1402558174, "num_examples": 2942362, "dataset_name": "crd3"}}, "download_checksums": {"https://github.com/RevanthRameshkumar/CRD3/archive/master.zip": {"num_bytes": 294222220, "checksum": "c77a937394f265735ba54b32a7a051f77a97d264c74b0535dee77ef9791815b5"}}, "download_size": 294222220, "post_processing_size": null, "dataset_size": 4207674522, "size_in_bytes": 4501896742}}
 
1
+ {"default": {"description": "\nStorytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset.\nCritical Role is an unscripted, live-streamed show where a fixed group of people play Dungeons and Dragons, an open-ended role-playing game.\nThe dataset is collected from 159 Critical Role episodes transcribed to text dialogues, consisting of 398,682 turns. It also includes corresponding\nabstractive summaries collected from the Fandom wiki. The dataset is linguistically unique in that the narratives are generated entirely through player\ncollaboration and spoken interaction. For each dialogue, there are a large number of turns, multiple abstractive summaries with varying levels of detail,\nand semantic ties to the previous dialogues.\n", "citation": "\n@inproceedings{\ntitle = {Storytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset},\nauthor = {Rameshkumar, Revanth and Bailey, Peter},\nyear = {2020},\npublisher = {Association for Computational Linguistics},\nconference = {ACL}\n}\n ", "homepage": "https://github.com/RevanthRameshkumar/CRD3", "license": "", "features": {"chunk": {"dtype": "string", "id": null, "_type": "Value"}, "chunk_id": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_start": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_end": {"dtype": "int32", "id": null, "_type": "Value"}, "alignment_score": {"dtype": "float32", "id": null, "_type": "Value"}, "turns": {"feature": {"names": {"dtype": "string", "id": null, "_type": "Value"}, "utterances": {"dtype": "string", "id": null, "_type": "Value"}, "number": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "crd3", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 318560673, "num_examples": 52796, "dataset_name": "crd3"}, "test": {"name": "test", "num_bytes": 318560673, "num_examples": 52796, "dataset_name": "crd3"}, "validation": {"name": "validation", "num_bytes": 318560673, "num_examples": 52796, "dataset_name": "crd3"}}, "download_checksums": {"https://github.com/RevanthRameshkumar/CRD3/archive/master.zip": {"num_bytes": 294222220, "checksum": "c77a937394f265735ba54b32a7a051f77a97d264c74b0535dee77ef9791815b5"}}, "download_size": 294222220, "post_processing_size": null, "dataset_size": 955682019, "size_in_bytes": 1249904239}}