albertvillanova HF staff commited on
Commit
1b7eb6a
1 Parent(s): f025bc3

Host data files (#3)

Browse files

- Host data files (7ec7ce7e729bbda330a72ffe9d8e189314918b21)
- Update loading script (6110dd4115ece376c5aa842c42904785990ba1b2)
- Update dataset card (0da59a4d3dc11ffef79598e65c2eacf1a30e74ba)
- Delete legacy metadata JSON file (d99aa99aec91e8dae2738018ec53603a5b0638da)

README.md CHANGED
@@ -74,14 +74,14 @@ dataset_info:
74
 
75
  ## Dataset Description
76
 
77
- - **Homepage:** []()
78
- - **Repository:** [https://github.com/BruceWen120/medal]()
79
- - **Paper:** [https://www.aclweb.org/anthology/2020.clinicalnlp-1.15/]()
80
- - **Dataset (Kaggle):** [https://www.kaggle.com/xhlulu/medal-emnlp]()
81
- - **Dataset (Zenodo):** [https://zenodo.org/record/4265632]()
82
- - **Pretrained model:** [https://huggingface.co/xhlu/electra-medal]()
83
- - **Leaderboard:** []()
84
- - **Point of Contact:** []()
85
 
86
  ### Dataset Summary
87
 
74
 
75
  ## Dataset Description
76
 
77
+ - **Homepage:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
78
+ - **Repository:** https://github.com/BruceWen120/medal
79
+ - **Paper:** https://www.aclweb.org/anthology/2020.clinicalnlp-1.15/
80
+ - **Dataset (Kaggle):** https://www.kaggle.com/xhlulu/medal-emnlp
81
+ - **Dataset (Zenodo):** https://zenodo.org/record/4265632
82
+ - **Pretrained model:** https://huggingface.co/xhlu/electra-medal
83
+ - **Leaderboard:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
84
+ - **Point of Contact:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
85
 
86
  ### Dataset Summary
87
 
data/full_data.csv.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af62700124185523a390f6099bf9e9de411913bd15588d980031b82fa2e4af36
3
+ size 5228583309
data/pretrain_subset.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8907785cfc21267f0f96e5b2206fdaf9582dd32fe0fe92b675dbfc939f4ce802
3
+ size 2068022776
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"default": {"description": "A large medical text dataset (14Go) curated to 4Go for abbreviation disambiguation, designed for natural language understanding pre-training in the medical domain. For example, DHF can be disambiguated to dihydrofolate, diastolic heart failure, dengue hemorragic fever or dihydroxyfumarate\n", "citation": "@inproceedings{wen-etal-2020-medal,\n title = \"{M}e{DAL}: Medical Abbreviation Disambiguation Dataset for Natural Language Understanding Pretraining\",\n author = \"Wen, Zhi and\n Lu, Xing Han and\n Reddy, Siva\",\n booktitle = \"Proceedings of the 3rd Clinical Natural Language Processing Workshop\",\n month = nov,\n year = \"2020\",\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.clinicalnlp-1.15\",\n pages = \"130--135\",\n abstract = \"One of the biggest challenges that prohibit the use of many current NLP methods in clinical settings is the availability of public datasets. In this work, we present MeDAL, a large medical text dataset curated for abbreviation disambiguation, designed for natural language understanding pre-training in the medical domain. We pre-trained several models of common architectures on this dataset and empirically showed that such pre-training leads to improved performance and convergence speed when fine-tuning on downstream medical tasks.\",\n}", "homepage": "https://github.com/BruceWen120/medal", "license": "", "features": {"abstract_id": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "location": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "label": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "medal", "config_name": "default", "version": {"version_str": "4.0.0", "description": null, "major": 4, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3573399948, "num_examples": 3000000, "dataset_name": "medal"}, "test": {"name": "test", "num_bytes": 1190766821, "num_examples": 1000000, "dataset_name": "medal"}, "validation": {"name": "validation", "num_bytes": 1191410723, "num_examples": 1000000, "dataset_name": "medal"}, "full": {"name": "full", "num_bytes": 15536883723, "num_examples": 14393619, "dataset_name": "medal"}}, "download_checksums": {"https://zenodo.org/record/4482922/files/train.csv": {"num_bytes": 3541556520, "checksum": "c5fef2feebd1ecd35b4fe7a0aec266b631c0ac511d4d6b685835328b1ffbf32d"}, "https://zenodo.org/record/4482922/files/test.csv": {"num_bytes": 1180152075, "checksum": "ad391a63449c2bbbdbdf8d1827da4c053607a8586f4162174ba4ccf13efd8f86"}, "https://zenodo.org/record/4482922/files/valid.csv": {"num_bytes": 1180795804, "checksum": "08a0a6c2ee40747744ec15675ab5dc1e2b04491ca951b14c15d8d7bf9d33694d"}, "https://zenodo.org/record/4482922/files/full_data.csv": {"num_bytes": 15158424679, "checksum": "70f1ad891bdf98a42395a8907b48284457ae36d17fcc5a0a9c65c0b6b45ecf8d"}}, "download_size": 21060929078, "post_processing_size": null, "dataset_size": 21492461215, "size_in_bytes": 42553390293}}
 
medal.py CHANGED
@@ -18,13 +18,11 @@
18
 
19
 
20
  import csv
 
21
 
22
  import datasets
23
 
24
 
25
- logger = datasets.logging.get_logger(__name__)
26
-
27
-
28
  _CITATION = """\
29
  @inproceedings{wen-etal-2020-medal,
30
  title = "{M}e{DAL}: Medical Abbreviation Disambiguation Dataset for Natural Language Understanding Pretraining",
@@ -45,12 +43,15 @@ _DESCRIPTION = """\
45
  A large medical text dataset (14Go) curated to 4Go for abbreviation disambiguation, designed for natural language understanding pre-training in the medical domain. For example, DHF can be disambiguated to dihydrofolate, diastolic heart failure, dengue hemorragic fever or dihydroxyfumarate
46
  """
47
 
48
- _URL = "https://zenodo.org/record/4482922/files/"
49
  _URLS = {
50
- "train": _URL + "train.csv",
51
- "test": _URL + "test.csv",
52
- "valid": _URL + "valid.csv",
53
- "full": _URL + "full_data.csv",
 
 
 
 
54
  }
55
 
56
 
@@ -86,35 +87,28 @@ class Medal(datasets.GeneratorBasedBuilder):
86
  """Returns SplitGenerators."""
87
  # dl_manager is a datasets.download.DownloadManager that can be used to
88
  # download and extract URLs
89
- urls_to_dl = _URLS
90
- try:
91
- dl_dir = dl_manager.download_and_extract(urls_to_dl)
92
- except Exception:
93
- logger.warning(
94
- "This dataset is downloaded through Zenodo which is flaky. If this download failed try a few times before reporting an issue"
95
- )
96
- raise
97
 
98
  return [
99
  datasets.SplitGenerator(
100
  name=datasets.Split.TRAIN,
101
  # These kwargs will be passed to _generate_examples
102
- gen_kwargs={"filepath": dl_dir["train"], "split": "train"},
103
  ),
104
  datasets.SplitGenerator(
105
  name=datasets.Split.TEST,
106
  # These kwargs will be passed to _generate_examples
107
- gen_kwargs={"filepath": dl_dir["test"], "split": "test"},
108
  ),
109
  datasets.SplitGenerator(
110
  name=datasets.Split.VALIDATION,
111
  # These kwargs will be passed to _generate_examples
112
- gen_kwargs={"filepath": dl_dir["valid"], "split": "val"},
113
  ),
114
  datasets.SplitGenerator(
115
  name="full",
116
  # These kwargs will be passed to _generate_examples
117
- gen_kwargs={"filepath": dl_dir["full"], "split": "full"},
118
  ),
119
  ]
120
 
18
 
19
 
20
  import csv
21
+ import os.path
22
 
23
  import datasets
24
 
25
 
 
 
 
26
  _CITATION = """\
27
  @inproceedings{wen-etal-2020-medal,
28
  title = "{M}e{DAL}: Medical Abbreviation Disambiguation Dataset for Natural Language Understanding Pretraining",
43
  A large medical text dataset (14Go) curated to 4Go for abbreviation disambiguation, designed for natural language understanding pre-training in the medical domain. For example, DHF can be disambiguated to dihydrofolate, diastolic heart failure, dengue hemorragic fever or dihydroxyfumarate
44
  """
45
 
 
46
  _URLS = {
47
+ "pretrain": "data/pretrain_subset.zip",
48
+ "full": "data/full_data.csv.zip"
49
+ }
50
+ _FILENAMES = {
51
+ "train": "train.csv",
52
+ "test": "test.csv",
53
+ "valid": "valid.csv",
54
+ "full": "full_data.csv",
55
  }
56
 
57
 
87
  """Returns SplitGenerators."""
88
  # dl_manager is a datasets.download.DownloadManager that can be used to
89
  # download and extract URLs
90
+ dl_dir = dl_manager.download_and_extract(_URLS)
 
 
 
 
 
 
 
91
 
92
  return [
93
  datasets.SplitGenerator(
94
  name=datasets.Split.TRAIN,
95
  # These kwargs will be passed to _generate_examples
96
+ gen_kwargs={"filepath": os.path.join(dl_dir["pretrain"], _FILENAMES["train"]), "split": "train"},
97
  ),
98
  datasets.SplitGenerator(
99
  name=datasets.Split.TEST,
100
  # These kwargs will be passed to _generate_examples
101
+ gen_kwargs={"filepath": os.path.join(dl_dir["pretrain"], _FILENAMES["test"]), "split": "test"},
102
  ),
103
  datasets.SplitGenerator(
104
  name=datasets.Split.VALIDATION,
105
  # These kwargs will be passed to _generate_examples
106
+ gen_kwargs={"filepath": os.path.join(dl_dir["pretrain"], _FILENAMES["valid"]), "split": "val"},
107
  ),
108
  datasets.SplitGenerator(
109
  name="full",
110
  # These kwargs will be passed to _generate_examples
111
+ gen_kwargs={"filepath": os.path.join(dl_dir["full"], _FILENAMES["full"]), "split": "full"},
112
  ),
113
  ]
114