singh-aditya
commited on
Commit
•
aaeeb0f
1
Parent(s):
0fd267e
Create MACCROBAT_biomedical_ner.py
Browse files- MACCROBAT_biomedical_ner.py +115 -0
MACCROBAT_biomedical_ner.py
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
from datasets import Sequence, ClassLabel, Value
|
3 |
+
|
4 |
+
|
5 |
+
class MACCROBAT_biomedical_ner(datasets.GeneratorBasedBuilder):
|
6 |
+
def _info(self):
|
7 |
+
return datasets.DatasetInfo(
|
8 |
+
description="",
|
9 |
+
features=datasets.Features(
|
10 |
+
{
|
11 |
+
"full_text": Value(dtype="string"),
|
12 |
+
"ner_info": [
|
13 |
+
{
|
14 |
+
"text": Value(dtype="string"),
|
15 |
+
"label": Value(dtype="string"),
|
16 |
+
"start": Value(dtype="int64"),
|
17 |
+
"end": Value(dtype="int64"),
|
18 |
+
}
|
19 |
+
],
|
20 |
+
"tokens": Sequence(Value(dtype="string")),
|
21 |
+
"ner_labels": Sequence(
|
22 |
+
ClassLabel(
|
23 |
+
names=[
|
24 |
+
"O",
|
25 |
+
"B-ACTIVITY",
|
26 |
+
"I-ACTIVITY",
|
27 |
+
"I-ADMINISTRATION",
|
28 |
+
"B-ADMINISTRATION",
|
29 |
+
"B-AGE",
|
30 |
+
"I-AGE",
|
31 |
+
"I-AREA",
|
32 |
+
"B-AREA",
|
33 |
+
"B-BIOLOGICAL_ATTRIBUTE",
|
34 |
+
"I-BIOLOGICAL_ATTRIBUTE",
|
35 |
+
"I-BIOLOGICAL_STRUCTURE",
|
36 |
+
"B-BIOLOGICAL_STRUCTURE",
|
37 |
+
"B-CLINICAL_EVENT",
|
38 |
+
"I-CLINICAL_EVENT",
|
39 |
+
"B-COLOR",
|
40 |
+
"I-COLOR",
|
41 |
+
"I-COREFERENCE",
|
42 |
+
"B-COREFERENCE",
|
43 |
+
"B-DATE",
|
44 |
+
"I-DATE",
|
45 |
+
"I-DETAILED_DESCRIPTION",
|
46 |
+
"B-DETAILED_DESCRIPTION",
|
47 |
+
"I-DIAGNOSTIC_PROCEDURE",
|
48 |
+
"B-DIAGNOSTIC_PROCEDURE",
|
49 |
+
"I-DISEASE_DISORDER",
|
50 |
+
"B-DISEASE_DISORDER",
|
51 |
+
"B-DISTANCE",
|
52 |
+
"I-DISTANCE",
|
53 |
+
"B-DOSAGE",
|
54 |
+
"I-DOSAGE",
|
55 |
+
"I-DURATION",
|
56 |
+
"B-DURATION",
|
57 |
+
"I-FAMILY_HISTORY",
|
58 |
+
"B-FAMILY_HISTORY",
|
59 |
+
"B-FREQUENCY",
|
60 |
+
"I-FREQUENCY",
|
61 |
+
"I-HEIGHT",
|
62 |
+
"B-HEIGHT",
|
63 |
+
"B-HISTORY",
|
64 |
+
"I-HISTORY",
|
65 |
+
"I-LAB_VALUE",
|
66 |
+
"B-LAB_VALUE",
|
67 |
+
"I-MASS",
|
68 |
+
"B-MASS",
|
69 |
+
"I-MEDICATION",
|
70 |
+
"B-MEDICATION",
|
71 |
+
"I-NONBIOLOGICAL_LOCATION",
|
72 |
+
"B-NONBIOLOGICAL_LOCATION",
|
73 |
+
"I-OCCUPATION",
|
74 |
+
"B-OCCUPATION",
|
75 |
+
"B-OTHER_ENTITY",
|
76 |
+
"I-OTHER_ENTITY",
|
77 |
+
"B-OTHER_EVENT",
|
78 |
+
"I-OTHER_EVENT",
|
79 |
+
"I-OUTCOME",
|
80 |
+
"B-OUTCOME",
|
81 |
+
"I-PERSONAL_BACKGROUND",
|
82 |
+
"B-PERSONAL_BACKGROUND",
|
83 |
+
"B-QUALITATIVE_CONCEPT",
|
84 |
+
"I-QUALITATIVE_CONCEPT",
|
85 |
+
"I-QUANTITATIVE_CONCEPT",
|
86 |
+
"B-QUANTITATIVE_CONCEPT",
|
87 |
+
"B-SEVERITY",
|
88 |
+
"I-SEVERITY",
|
89 |
+
"B-SEX",
|
90 |
+
"I-SEX",
|
91 |
+
"B-SHAPE",
|
92 |
+
"I-SHAPE",
|
93 |
+
"B-SIGN_SYMPTOM",
|
94 |
+
"I-SIGN_SYMPTOM",
|
95 |
+
"B-SUBJECT",
|
96 |
+
"I-SUBJECT",
|
97 |
+
"B-TEXTURE",
|
98 |
+
"I-TEXTURE",
|
99 |
+
"B-THERAPEUTIC_PROCEDURE",
|
100 |
+
"I-THERAPEUTIC_PROCEDURE",
|
101 |
+
"I-TIME",
|
102 |
+
"B-TIME",
|
103 |
+
"B-VOLUME",
|
104 |
+
"I-VOLUME",
|
105 |
+
"I-WEIGHT",
|
106 |
+
"B-WEIGHT",
|
107 |
+
]
|
108 |
+
)
|
109 |
+
),
|
110 |
+
}
|
111 |
+
),
|
112 |
+
supervised_keys=None,
|
113 |
+
homepage="",
|
114 |
+
citation="",
|
115 |
+
)
|