Zaid commited on
Commit
b3989d4
1 Parent(s): 4b26513

Update quac_expanded.py

Browse files
Files changed (1) hide show
  1. quac_expanded.py +3 -3
quac_expanded.py CHANGED
@@ -130,17 +130,17 @@ class Quac(datasets.GeneratorBasedBuilder):
130
  section_title = section.get("section_title", "").strip()
131
 
132
  for dialogue in section["paragraphs"]:
133
- context = dialogue["context"].strip()
134
  dialogue_id = dialogue["id"]
135
 
136
  for turn in dialogue["qas"]:
137
  answer = {
138
- "texts": [t["text"].strip() for t in turn["answers"]],
139
  "answer_starts": [t["answer_start"] for t in turn["answers"]],
140
  }
141
 
142
  orig_answer = {
143
- "text": turn["orig_answer"]["text"],
144
  "answer_start": turn["orig_answer"]["answer_start"],
145
  }
146
 
 
130
  section_title = section.get("section_title", "").strip()
131
 
132
  for dialogue in section["paragraphs"]:
133
+ context = dialogue["context"].replace("CANNOTANSWER","").strip()
134
  dialogue_id = dialogue["id"]
135
 
136
  for turn in dialogue["qas"]:
137
  answer = {
138
+ "texts": [t["text"].replace("CANNOTANSWER","unknown").strip() for t in turn["answers"]],
139
  "answer_starts": [t["answer_start"] for t in turn["answers"]],
140
  }
141
 
142
  orig_answer = {
143
+ "text": turn["orig_answer"]["text"].replace("CANNOTANSWER","unknown"),
144
  "answer_start": turn["orig_answer"]["answer_start"],
145
  }
146