Amanpreet Singh
commited on
Commit
•
a6dcae9
1
Parent(s):
df53f7b
Use complete snippets as suggested by BLURB paper
Browse files- bioasq_task_b.py +16 -12
bioasq_task_b.py
CHANGED
@@ -643,15 +643,19 @@ class BioasqTaskBDataset(datasets.GeneratorBasedBuilder):
|
|
643 |
continue
|
644 |
if self.config.type_subset is not None and self.config.type_subset != record["type"]:
|
645 |
continue
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
|
|
|
|
|
|
|
|
|
643 |
continue
|
644 |
if self.config.type_subset is not None and self.config.type_subset != record["type"]:
|
645 |
continue
|
646 |
+
snippets = record['snippets']
|
647 |
+
snippets_text = [snippet['text'].replace(
|
648 |
+
'\n', ' ') for snippet in snippets]
|
649 |
+
passage = " ".join(snippets_text)
|
650 |
+
|
651 |
+
yield uid, {
|
652 |
+
"id": record["id"],
|
653 |
+
"document_id": record["id"],
|
654 |
+
"question_id": record["id"],
|
655 |
+
"question": record["body"],
|
656 |
+
"type": record["type"],
|
657 |
+
"choices": [],
|
658 |
+
"context": passage,
|
659 |
+
"answer": self._get_exact_answer(record),
|
660 |
+
}
|
661 |
+
uid += 1
|