Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets
License:
mvarma commited on
Commit
4a86d64
1 Parent(s): fbe6a44

Update medwiki.py

Browse files
Files changed (1) hide show
  1. medwiki.py +10 -5
medwiki.py CHANGED
@@ -37,8 +37,7 @@ _HOMEPAGE = ""
37
 
38
  _LICENSE = ""
39
 
40
- _URLs = ["https://huggingface.co/datasets/mvarma/medwiki/blob/main/medwiki_full.zip", \
41
- "https://huggingface.co/datasets/mvarma/medwiki/blob/main/medwiki_hq.zip"]
42
 
43
 
44
  class MedWiki(datasets.GeneratorBasedBuilder):
@@ -82,25 +81,31 @@ class MedWiki(datasets.GeneratorBasedBuilder):
82
  """Returns SplitGenerators."""
83
  my_urls = _URLs[self.config.name]
84
  data_dir = dl_manager.download_and_extract(my_urls)
 
 
 
 
 
 
85
  return [
86
  datasets.SplitGenerator(
87
  name=datasets.Split.TRAIN,
88
  gen_kwargs={
89
- "filepath": os.path.join(data_dir, "train.jsonl"),
90
  "split": "train",
91
  },
92
  ),
93
  datasets.SplitGenerator(
94
  name=datasets.Split.TEST,
95
  gen_kwargs={
96
- "filepath": os.path.join(data_dir, "test.jsonl"),
97
  "split": "test"
98
  },
99
  ),
100
  datasets.SplitGenerator(
101
  name=datasets.Split.VALIDATION,
102
  gen_kwargs={
103
- "filepath": os.path.join(data_dir, "dev.jsonl"),
104
  "split": "dev",
105
  },
106
  ),
 
37
 
38
  _LICENSE = ""
39
 
40
+ _URLs = {"medwiki_full": "medwiki_full.zip", "medwiki_hq": "medwiki_hq.zip"}
 
41
 
42
 
43
  class MedWiki(datasets.GeneratorBasedBuilder):
 
81
  """Returns SplitGenerators."""
82
  my_urls = _URLs[self.config.name]
83
  data_dir = dl_manager.download_and_extract(my_urls)
84
+
85
+ #Adjust filenames for medwiki_hq subset
86
+ ext = ""
87
+ if self.config.name == "medwiki_hq": ext = "_hq"
88
+
89
+ #Load splits
90
  return [
91
  datasets.SplitGenerator(
92
  name=datasets.Split.TRAIN,
93
  gen_kwargs={
94
+ "filepath": os.path.join(data_dir, f"train{ext}.jsonl"),
95
  "split": "train",
96
  },
97
  ),
98
  datasets.SplitGenerator(
99
  name=datasets.Split.TEST,
100
  gen_kwargs={
101
+ "filepath": os.path.join(data_dir, f"test{ext}.jsonl"),
102
  "split": "test"
103
  },
104
  ),
105
  datasets.SplitGenerator(
106
  name=datasets.Split.VALIDATION,
107
  gen_kwargs={
108
+ "filepath": os.path.join(data_dir, f"dev{ext}.jsonl"),
109
  "split": "dev",
110
  },
111
  ),