qanastek commited on
Commit
cd71611
1 Parent(s): 25fec72

Update E3C.py

Browse files
Files changed (1) hide show
  1. E3C.py +18 -8
E3C.py CHANGED
@@ -278,14 +278,24 @@ class E3C(datasets.GeneratorBasedBuilder):
278
  else:
279
  temporal_information_labels[idx_token] = f"I-{entity_type}"
280
 
281
- all_res.append({
282
- "id": key,
283
- "text": sentence[-1],
284
- "tokens": list(map(lambda token: token[2], filtered_tokens)),
285
- "ner_clinical_tags": clinical_labels,
286
- "ner_temporal_tags": temporal_information_labels,
287
- })
288
-
 
 
 
 
 
 
 
 
 
 
289
  key += 1
290
 
291
  print("Length: ", len(all_res))
 
278
  else:
279
  temporal_information_labels[idx_token] = f"I-{entity_type}"
280
 
281
+ if self.config.name.find("clinical") != -1:
282
+
283
+ all_res.append({
284
+ "id": key,
285
+ "text": sentence[-1],
286
+ "tokens": list(map(lambda token: token[2], filtered_tokens)),
287
+ "ner_clinical_tags": clinical_labels,
288
+ })
289
+
290
+ elif self.config.name.find("temporal") != -1:
291
+
292
+ all_res.append({
293
+ "id": key,
294
+ "text": sentence[-1],
295
+ "tokens": list(map(lambda token: token[2], filtered_tokens)),
296
+ "ner_temporal_tags": temporal_information_labels,
297
+ })
298
+
299
  key += 1
300
 
301
  print("Length: ", len(all_res))