Upload 2 files
Browse files
README.md
CHANGED
|
@@ -8,58 +8,64 @@ dataset_info:
|
|
| 8 |
- name: tokens_offsets
|
| 9 |
sequence:
|
| 10 |
sequence: int32
|
| 11 |
-
- name:
|
| 12 |
sequence:
|
| 13 |
class_label:
|
| 14 |
names:
|
| 15 |
'0': O
|
| 16 |
'1': B-CLINENTITY
|
| 17 |
-
'2':
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
'
|
| 23 |
-
'
|
| 24 |
-
'
|
| 25 |
-
'
|
| 26 |
-
'
|
| 27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
config_name: e3c
|
| 29 |
splits:
|
| 30 |
- name: en.layer1
|
| 31 |
-
num_bytes:
|
| 32 |
num_examples: 1520
|
| 33 |
- name: en.layer2
|
| 34 |
-
num_bytes:
|
| 35 |
num_examples: 2873
|
| 36 |
- name: es.layer1
|
| 37 |
-
num_bytes:
|
| 38 |
num_examples: 1134
|
| 39 |
- name: es.layer2
|
| 40 |
-
num_bytes:
|
| 41 |
num_examples: 2347
|
| 42 |
- name: eu.layer1
|
| 43 |
-
num_bytes:
|
| 44 |
num_examples: 3126
|
| 45 |
- name: eu.layer2
|
| 46 |
-
num_bytes:
|
| 47 |
num_examples: 1594
|
| 48 |
- name: fr.layer1
|
| 49 |
-
num_bytes:
|
| 50 |
num_examples: 1109
|
| 51 |
- name: fr.layer2
|
| 52 |
-
num_bytes:
|
| 53 |
num_examples: 2389
|
| 54 |
- name: it.layer1
|
| 55 |
-
num_bytes:
|
| 56 |
num_examples: 1146
|
| 57 |
- name: it.layer2
|
| 58 |
-
num_bytes:
|
| 59 |
num_examples: 2436
|
| 60 |
download_size: 230213492
|
| 61 |
-
dataset_size:
|
| 62 |
---
|
|
|
|
| 63 |
# Dataset Card for E3C
|
| 64 |
|
| 65 |
## Dataset Description
|
|
|
|
| 8 |
- name: tokens_offsets
|
| 9 |
sequence:
|
| 10 |
sequence: int32
|
| 11 |
+
- name: clinical_entity_tags
|
| 12 |
sequence:
|
| 13 |
class_label:
|
| 14 |
names:
|
| 15 |
'0': O
|
| 16 |
'1': B-CLINENTITY
|
| 17 |
+
'2': I-CLINENTITY
|
| 18 |
+
- name: temporal_information_tags
|
| 19 |
+
sequence:
|
| 20 |
+
class_label:
|
| 21 |
+
names:
|
| 22 |
+
'0': O
|
| 23 |
+
'1': B-EVENT
|
| 24 |
+
'2': B-ACTOR
|
| 25 |
+
'3': B-BODYPART
|
| 26 |
+
'4': B-TIMEX3
|
| 27 |
+
'5': B-RML
|
| 28 |
+
'6': I-EVENT
|
| 29 |
+
'7': I-ACTOR
|
| 30 |
+
'8': I-BODYPART
|
| 31 |
+
'9': I-TIMEX3
|
| 32 |
+
'10': I-RML
|
| 33 |
config_name: e3c
|
| 34 |
splits:
|
| 35 |
- name: en.layer1
|
| 36 |
+
num_bytes: 1280534
|
| 37 |
num_examples: 1520
|
| 38 |
- name: en.layer2
|
| 39 |
+
num_bytes: 2566638
|
| 40 |
num_examples: 2873
|
| 41 |
- name: es.layer1
|
| 42 |
+
num_bytes: 1262006
|
| 43 |
num_examples: 1134
|
| 44 |
- name: es.layer2
|
| 45 |
+
num_bytes: 2524461
|
| 46 |
num_examples: 2347
|
| 47 |
- name: eu.layer1
|
| 48 |
+
num_bytes: 1537670
|
| 49 |
num_examples: 3126
|
| 50 |
- name: eu.layer2
|
| 51 |
+
num_bytes: 853766
|
| 52 |
num_examples: 1594
|
| 53 |
- name: fr.layer1
|
| 54 |
+
num_bytes: 1275362
|
| 55 |
num_examples: 1109
|
| 56 |
- name: fr.layer2
|
| 57 |
+
num_bytes: 2581993
|
| 58 |
num_examples: 2389
|
| 59 |
- name: it.layer1
|
| 60 |
+
num_bytes: 1299388
|
| 61 |
num_examples: 1146
|
| 62 |
- name: it.layer2
|
| 63 |
+
num_bytes: 2697483
|
| 64 |
num_examples: 2436
|
| 65 |
download_size: 230213492
|
| 66 |
+
dataset_size: 17879301
|
| 67 |
---
|
| 68 |
+
|
| 69 |
# Dataset Card for E3C
|
| 70 |
|
| 71 |
## Dataset Description
|
e3c.py
CHANGED
|
@@ -57,17 +57,24 @@ class E3C(datasets.GeneratorBasedBuilder):
|
|
| 57 |
"text": datasets.Value("string"),
|
| 58 |
"tokens": datasets.Sequence(datasets.Value("string")),
|
| 59 |
"tokens_offsets": datasets.Sequence(datasets.Sequence(datasets.Value("int32"))),
|
| 60 |
-
"
|
| 61 |
datasets.features.ClassLabel(
|
| 62 |
names=[
|
| 63 |
"O",
|
| 64 |
"B-CLINENTITY",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
"B-EVENT",
|
| 66 |
"B-ACTOR",
|
| 67 |
"B-BODYPART",
|
| 68 |
"B-TIMEX3",
|
| 69 |
"B-RML",
|
| 70 |
-
"I-CLINENTITY",
|
| 71 |
"I-EVENT",
|
| 72 |
"I-ACTOR",
|
| 73 |
"I-BODYPART",
|
|
@@ -286,7 +293,8 @@ class E3C(datasets.GeneratorBasedBuilder):
|
|
| 286 |
tokens_offsets = [
|
| 287 |
[token[0] - sentence[0], token[1] - sentence[0]] for token in filtered_tokens
|
| 288 |
]
|
| 289 |
-
|
|
|
|
| 290 |
for entity_type in [
|
| 291 |
"CLINENTITY",
|
| 292 |
"EVENT",
|
|
@@ -308,14 +316,21 @@ class E3C(datasets.GeneratorBasedBuilder):
|
|
| 308 |
if token[0] >= entities[0] and token[1] <= entities[1]
|
| 309 |
]
|
| 310 |
for idx_token in annotated_tokens:
|
| 311 |
-
if
|
| 312 |
-
|
|
|
|
|
|
|
|
|
|
| 313 |
else:
|
| 314 |
-
|
|
|
|
|
|
|
|
|
|
| 315 |
yield guid, {
|
| 316 |
"text": sentence[-1],
|
| 317 |
"tokens": list(map(lambda tokens: tokens[2], filtered_tokens)),
|
| 318 |
-
"
|
|
|
|
| 319 |
"tokens_offsets": tokens_offsets,
|
| 320 |
}
|
| 321 |
-
guid += 1
|
|
|
|
| 57 |
"text": datasets.Value("string"),
|
| 58 |
"tokens": datasets.Sequence(datasets.Value("string")),
|
| 59 |
"tokens_offsets": datasets.Sequence(datasets.Sequence(datasets.Value("int32"))),
|
| 60 |
+
"clinical_entity_tags": datasets.Sequence(
|
| 61 |
datasets.features.ClassLabel(
|
| 62 |
names=[
|
| 63 |
"O",
|
| 64 |
"B-CLINENTITY",
|
| 65 |
+
"I-CLINENTITY",
|
| 66 |
+
],
|
| 67 |
+
),
|
| 68 |
+
),
|
| 69 |
+
"temporal_information_tags": datasets.Sequence(
|
| 70 |
+
datasets.features.ClassLabel(
|
| 71 |
+
names=[
|
| 72 |
+
"O",
|
| 73 |
"B-EVENT",
|
| 74 |
"B-ACTOR",
|
| 75 |
"B-BODYPART",
|
| 76 |
"B-TIMEX3",
|
| 77 |
"B-RML",
|
|
|
|
| 78 |
"I-EVENT",
|
| 79 |
"I-ACTOR",
|
| 80 |
"I-BODYPART",
|
|
|
|
| 293 |
tokens_offsets = [
|
| 294 |
[token[0] - sentence[0], token[1] - sentence[0]] for token in filtered_tokens
|
| 295 |
]
|
| 296 |
+
clinical_labels = ["O"] * len(filtered_tokens)
|
| 297 |
+
temporal_information_labels = ["O"] * len(filtered_tokens)
|
| 298 |
for entity_type in [
|
| 299 |
"CLINENTITY",
|
| 300 |
"EVENT",
|
|
|
|
| 316 |
if token[0] >= entities[0] and token[1] <= entities[1]
|
| 317 |
]
|
| 318 |
for idx_token in annotated_tokens:
|
| 319 |
+
if entity_type == "CLINENTITY":
|
| 320 |
+
if idx_token == annotated_tokens[0]:
|
| 321 |
+
clinical_labels[idx_token] = f"B-{entity_type}"
|
| 322 |
+
else:
|
| 323 |
+
clinical_labels[idx_token] = f"I-{entity_type}"
|
| 324 |
else:
|
| 325 |
+
if idx_token == annotated_tokens[0]:
|
| 326 |
+
temporal_information_labels[idx_token] = f"B-{entity_type}"
|
| 327 |
+
else:
|
| 328 |
+
temporal_information_labels[idx_token] = f"I-{entity_type}"
|
| 329 |
yield guid, {
|
| 330 |
"text": sentence[-1],
|
| 331 |
"tokens": list(map(lambda tokens: tokens[2], filtered_tokens)),
|
| 332 |
+
"clinical_entity_tags": clinical_labels,
|
| 333 |
+
"temporal_information_tags": temporal_information_labels,
|
| 334 |
"tokens_offsets": tokens_offsets,
|
| 335 |
}
|
| 336 |
+
guid += 1
|