Datasets:

Modalities:
Text
Languages:
English
ArXiv:
Libraries:
Datasets
License:
neel-alex commited on
Commit
7e7f461
1 Parent(s): edbfbc6

Adding medical subdomain classification

Browse files
data/MedicalDomain/test.csv ADDED
The diff for this file is too large to render. See raw diff
 
data/MedicalDomain/train.csv ADDED
The diff for this file is too large to render. See raw diff
 
raft.py CHANGED
@@ -55,6 +55,10 @@ _URLs = {
55
  'AIInitiatives': {
56
  'train': "./data/AIInitiatives/train.csv",
57
  'test': "./data/AIInitiatives/test.csv"
 
 
 
 
58
  }
59
  } # TODO: Generate these automatically.
60
 
@@ -83,10 +87,13 @@ class Raft(datasets.GeneratorBasedBuilder):
83
  "safety or technical safety."),
84
  datasets.BuilderConfig(name="AIInitiatives-multilabel", version=VERSION,
85
  description="For each initiative, decide which (if any) of Ethics, "
86
- "Governance, and Social Good apply to the initiative's AI goals")
 
 
 
87
  ]
88
 
89
- DEFAULT_CONFIG_NAME = "TAISafety/binary" # It's not mandatory to have a default configuration. Just use one if it make sense.
90
 
91
  def _info(self):
92
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
@@ -117,6 +124,13 @@ class Raft(datasets.GeneratorBasedBuilder):
117
  "answer_socialgood": datasets.Value("string"),
118
  }
119
  )
 
 
 
 
 
 
 
120
  return datasets.DatasetInfo(
121
  # This is the description that will appear on the datasets page.
122
  description=_DESCRIPTION,
@@ -185,7 +199,7 @@ class Raft(datasets.GeneratorBasedBuilder):
185
  stage, date, country, notes, answer_ethics, \
186
  answer_governance, answer_socialgood = row
187
  if split == "test":
188
- answer = ""
189
  yield id_, {"name": name,
190
  "organization": organization,
191
  "description": description,
@@ -199,3 +213,10 @@ class Raft(datasets.GeneratorBasedBuilder):
199
  "answer_ethics": answer_ethics,
200
  "answer_governance": answer_governance,
201
  "answer_socialgood": answer_socialgood}
 
 
 
 
 
 
 
 
55
  'AIInitiatives': {
56
  'train': "./data/AIInitiatives/train.csv",
57
  'test': "./data/AIInitiatives/test.csv"
58
+ },
59
+ 'MedicalDomain': {
60
+ 'train': "./data/MedicalDomain/train.csv",
61
+ 'test': "./data/MedicalDomain/test.csv"
62
  }
63
  } # TODO: Generate these automatically.
64
 
 
87
  "safety or technical safety."),
88
  datasets.BuilderConfig(name="AIInitiatives-multilabel", version=VERSION,
89
  description="For each initiative, decide which (if any) of Ethics, "
90
+ "Governance, and Social Good apply to the initiative's AI goals"),
91
+ datasets.BuilderConfig(name="MedicalDomain-multiclass", version=VERSION,
92
+ description="Which medical subdomain does a given physician's clinical notes "
93
+ "belong to?"),
94
  ]
95
 
96
+ DEFAULT_CONFIG_NAME = "TAISafety-binary" # It's not mandatory to have a default configuration. Just use one if it make sense.
97
 
98
  def _info(self):
99
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
 
124
  "answer_socialgood": datasets.Value("string"),
125
  }
126
  )
127
+ elif self.config.name.startswith("MedicalDomain"):
128
+ features = datasets.Features(
129
+ {
130
+ "text": datasets.Value("string"),
131
+ "answer": datasets.Value("string"),
132
+ }
133
+ )
134
  return datasets.DatasetInfo(
135
  # This is the description that will appear on the datasets page.
136
  description=_DESCRIPTION,
 
199
  stage, date, country, notes, answer_ethics, \
200
  answer_governance, answer_socialgood = row
201
  if split == "test":
202
+ answer_ethics, answer_governance, answer_socialgood = "", "", ""
203
  yield id_, {"name": name,
204
  "organization": organization,
205
  "description": description,
 
213
  "answer_ethics": answer_ethics,
214
  "answer_governance": answer_governance,
215
  "answer_socialgood": answer_socialgood}
216
+ if dataset == "MedicalDomain":
217
+ text, answer = row
218
+ if split == "test":
219
+ answer = ""
220
+ yield id_, {"text": text,
221
+ "answer": answer}
222
+