|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""Covid Dialog dataset in English and Chinese""" |
|
|
|
|
|
import copy |
|
import os |
|
import re |
|
import textwrap |
|
|
|
import datasets |
|
|
|
|
|
|
|
_CITATION = """\ |
|
@Inproceedings{MeQSum, |
|
author = {Asma {Ben Abacha} and Dina Demner-Fushman}, |
|
title = {On the Summarization of Consumer Health Questions}, |
|
booktitle = {Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, ACL 2019, |
|
Florence, Italy, July 28th - August 2}, |
|
year = {2019}, |
|
abstract = {Question understanding is one of the main challenges in question answering. In real world applications, |
|
users often submit natural language questions that are longer than needed and include peripheral information that |
|
increases the complexity of the question, leading to substantially more false positives in answer retrieval. In this |
|
paper, we study neural abstractive models for medical question summarization. We introduce the MeQSum corpus of |
|
1,000 summarized consumer health questions. We explore data augmentation methods and evaluate state-of-the-art |
|
neural abstractive models on this new task. In particular, we show that semantic augmentation from question datasets |
|
improves the overall performance, and that pointer-generator networks outperform sequence-to-sequence attentional |
|
models on this task, with a ROUGE-1 score of 44.16%. We also present a detailed error analysis and discuss |
|
directions for improvement that are specific to question summarization.}} |
|
""" |
|
|
|
|
|
_DESCRIPTION = textwrap.dedent( |
|
""" |
|
From "On the Summarization of Consumer Health Questions" (Abacha et al.), MeQSum is a corpus of 1,000 summarized |
|
consumer health questions. |
|
|
|
The following is an example from the dataset: |
|
|
|
Question: |
|
SUBJECT: inversion of long arm chromasome7 MESSAGE: My son has been diagnosed with inversion of long arm |
|
chromasome 7 and down syndrome . please could you give me information on the chromasome 7 please because |
|
our doctors have not yet mentioned it |
|
|
|
Summary: |
|
Where can I find information on chromosome 7? |
|
""" |
|
) |
|
|
|
|
|
_HOMEPAGE = "https://worksheets.codalab.org/rest/bundles/0xd98a53314314445b96b4d703bb2d8c8c/contents/blob/" |
|
|
|
_LICENSE = "" |
|
|
|
|
|
import datasets |
|
import os |
|
import json |
|
|
|
|
|
class MeQSum(datasets.GeneratorBasedBuilder): |
|
VERSION = datasets.Version("1.0.0") |
|
|
|
BUILDER_CONFIGS = [datasets.BuilderConfig(name="default", version=datasets.Version("1.0.0"), description=_DESCRIPTION)] |
|
|
|
def _info(self): |
|
features = datasets.Features( |
|
{ |
|
"query": datasets.Value("string"), |
|
"answer": datasets.Value("string"), |
|
} |
|
) |
|
return datasets.DatasetInfo( |
|
description=f"Covid Dialogue dataset, as preprocessed and shuffled in HELM", |
|
features=features, |
|
homepage=_HOMEPAGE, |
|
license=_LICENSE, |
|
citation=_CITATION, |
|
) |
|
|
|
def _split_generators(self, dl_manager): |
|
test_target = dl_manager.download("test.source") |
|
test_source = dl_manager.download("test.source") |
|
train_source = dl_manager.download("train.source") |
|
train_target = dl_manager.download("train.target") |
|
val_source = dl_manager.download("val.source") |
|
val_target = dl_manager.download("val.target") |
|
|
|
return [ |
|
datasets.SplitGenerator( |
|
name=datasets.Split.TRAIN, |
|
gen_kwargs={"target": train_target, "source": train_source}, |
|
), |
|
datasets.SplitGenerator( |
|
name=datasets.Split.VALIDATION, |
|
gen_kwargs={"target": val_target, "source": val_source}, |
|
), |
|
datasets.SplitGenerator( |
|
name=datasets.Split.TEST, |
|
gen_kwargs={"target": test_target, "source": test_source}, |
|
), |
|
] |
|
|
|
|
|
def _generate_examples(self, source, target): |
|
with open(source, encoding="utf-8") as f_source: |
|
with open(target, encoding="utf-8") as f_target: |
|
for idx, (s, t) in enumerate(zip(f_source, f_target)): |
|
yield idx, {"query": s, "answer": t} |
|
|