qanastek commited on
Commit
6f46fd2
1 Parent(s): fe57806

Update E3C.py

Browse files
Files changed (1) hide show
  1. E3C.py +8 -14
E3C.py CHANGED
@@ -242,22 +242,16 @@ class E3C(datasets.GeneratorBasedBuilder):
242
  temporal_information_labels[idx_token] = f"I-{entity_type}"
243
 
244
  if self.config.name.find("clinical") != -1:
245
-
246
- all_res.append({
247
- "id": key,
248
- "text": sentence[-1],
249
- "tokens": list(map(lambda token: token[2], filtered_tokens)),
250
- "ner_clinical_tags": clinical_labels,
251
- })
252
-
253
  elif self.config.name.find("temporal") != -1:
 
254
 
255
- all_res.append({
256
- "id": key,
257
- "text": sentence[-1],
258
- "tokens": list(map(lambda token: token[2], filtered_tokens)),
259
- "ner_temporal_tags": temporal_information_labels,
260
- })
261
 
262
  key += 1
263
 
 
242
  temporal_information_labels[idx_token] = f"I-{entity_type}"
243
 
244
  if self.config.name.find("clinical") != -1:
245
+ _labels = clinical_labels
 
 
 
 
 
 
 
246
  elif self.config.name.find("temporal") != -1:
247
+ _labels = temporal_information_labels
248
 
249
+ all_res.append({
250
+ "id": key,
251
+ "text": sentence[-1],
252
+ "tokens": list(map(lambda token: token[2], filtered_tokens)),
253
+ "ner_tags": _labels,
254
+ })
255
 
256
  key += 1
257