Update E3C.py
Browse files
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 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 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))
|