Datasets:
remove unused text fields
Browse files- xstory_cloze.py +0 -8
xstory_cloze.py
CHANGED
@@ -84,12 +84,9 @@ class XStoryCloze(datasets.GeneratorBasedBuilder):
|
|
84 |
"input_sentence_2": datasets.Value("string"),
|
85 |
"input_sentence_3": datasets.Value("string"),
|
86 |
"input_sentence_4": datasets.Value("string"),
|
87 |
-
"context": datasets.Value("string"),
|
88 |
"sentence_quiz1": datasets.Value("string"),
|
89 |
"sentence_quiz2": datasets.Value("string"),
|
90 |
"answer_right_ending": datasets.Value("int32"),
|
91 |
-
"text_right_ending": datasets.Value("string"),
|
92 |
-
"text_wrong_ending": datasets.Value("string"),
|
93 |
}
|
94 |
),
|
95 |
homepage="https://cs.rochester.edu/nlp/rocstories/",
|
@@ -121,18 +118,13 @@ class XStoryCloze(datasets.GeneratorBasedBuilder):
|
|
121 |
_ = next(csv_reader)
|
122 |
for id_, row in enumerate(csv_reader):
|
123 |
if row and len(row) == 8:
|
124 |
-
text_right = row[5] if int(row[7]) == 1 else row[6]
|
125 |
-
text_wrong = row[6] if int(row[7]) == 1 else row[5]
|
126 |
yield id_, {
|
127 |
"story_id": row[0],
|
128 |
"input_sentence_1": row[1],
|
129 |
"input_sentence_2": row[2],
|
130 |
"input_sentence_3": row[3],
|
131 |
"input_sentence_4": row[4],
|
132 |
-
"context": f"{row[1]} {row[2]} {row[3]} {row[4]}",
|
133 |
"sentence_quiz1": row[5],
|
134 |
"sentence_quiz2": row[6],
|
135 |
"answer_right_ending": int(row[7]),
|
136 |
-
"text_right_ending": f"{row[1]} {row[2]} {row[3]} {row[4]} {text_right}",
|
137 |
-
"text_wrong_ending": f"{row[1]} {row[2]} {row[3]} {row[4]} {text_wrong}",
|
138 |
}
|
|
|
84 |
"input_sentence_2": datasets.Value("string"),
|
85 |
"input_sentence_3": datasets.Value("string"),
|
86 |
"input_sentence_4": datasets.Value("string"),
|
|
|
87 |
"sentence_quiz1": datasets.Value("string"),
|
88 |
"sentence_quiz2": datasets.Value("string"),
|
89 |
"answer_right_ending": datasets.Value("int32"),
|
|
|
|
|
90 |
}
|
91 |
),
|
92 |
homepage="https://cs.rochester.edu/nlp/rocstories/",
|
|
|
118 |
_ = next(csv_reader)
|
119 |
for id_, row in enumerate(csv_reader):
|
120 |
if row and len(row) == 8:
|
|
|
|
|
121 |
yield id_, {
|
122 |
"story_id": row[0],
|
123 |
"input_sentence_1": row[1],
|
124 |
"input_sentence_2": row[2],
|
125 |
"input_sentence_3": row[3],
|
126 |
"input_sentence_4": row[4],
|
|
|
127 |
"sentence_quiz1": row[5],
|
128 |
"sentence_quiz2": row[6],
|
129 |
"answer_right_ending": int(row[7]),
|
|
|
|
|
130 |
}
|