-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.py
159 lines (154 loc) · 3.43 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
entity_to_acronyms = {
'Activity': 'ACT',
'Administration': 'ADM',
'Age': 'AGE',
'Area': 'ARA',
'Biological_attribute': 'BAT',
'Biological_structure': 'BST',
'Clinical_event': 'CLE',
'Color': 'COL',
'Coreference': 'COR',
'Date': 'DAT',
'Detailed_description': 'DET',
'Diagnostic_procedure': 'DIA',
'Disease_disorder': 'DIS',
'Distance': 'DIS',
'Dosage': 'DOS',
'Duration': 'DUR',
'Family_history': 'FAM',
'Frequency': 'FRE',
'Height': 'HEI',
'History': 'HIS',
'Lab_value': 'LAB',
'Mass': 'MAS',
'Medication': 'MED',
'Nonbiological_location': 'NBL',
'Occupation': 'OCC',
'Other_entity': 'OTH',
'Other_event': 'OTE',
'Outcome': 'OUT',
'Personal_background': 'PER',
'Qualitative_concept': 'QUC',
'Quantitative_concept': 'QUC',
'Severity': 'SEV',
'Sex': 'SEX',
'Shape': 'SHA',
'Sign_symptom': 'SIG',
'Subject': 'SUB',
'Texture': 'TEX',
'Therapeutic_procedure': 'THP',
'Time': 'TIM',
'Volume': 'VOL',
'Weight': 'WEI'
}
index_to_label = {1: 'B-ACT',
2: 'B-ADM',
3: 'B-AGE',
4: 'B-ARA',
5: 'B-BAT',
6: 'B-BST',
7: 'B-CLE',
8: 'B-COL',
9: 'B-COR',
10: 'B-DAT',
11: 'B-DET',
12: 'B-DIA',
13: 'B-DIS',
14: 'B-DOS',
15: 'B-DUR',
16: 'B-FAM',
17: 'B-FRE',
18: 'B-HEI',
19: 'B-HIS',
20: 'B-LAB',
21: 'B-MAS',
22: 'B-MED',
23: 'B-NBL',
24: 'B-OCC',
25: 'B-OTE',
26: 'B-OTH',
27: 'B-OUT',
28: 'B-PER',
29: 'B-QUC',
30: 'B-SEV',
31: 'B-SEX',
32: 'B-SHA',
33: 'B-SIG',
34: 'B-SUB',
35: 'B-TEX',
36: 'B-THP',
37: 'B-TIM',
38: 'B-VOL',
39: 'B-WEI',
40: 'I-ACT',
41: 'I-ADM',
42: 'I-AGE',
43: 'I-ARA',
44: 'I-BAT',
45: 'I-BST',
46: 'I-CLE',
47: 'I-COL',
48: 'I-COR',
49: 'I-DAT',
50: 'I-DET',
51: 'I-DIA',
52: 'I-DIS',
53: 'I-DOS',
54: 'I-DUR',
55: 'I-FAM',
56: 'I-FRE',
57: 'I-HEI',
58: 'I-HIS',
59: 'I-LAB',
60: 'I-MAS',
61: 'I-MED',
62: 'I-NBL',
63: 'I-OCC',
64: 'I-OTE',
65: 'I-OTH',
66: 'I-OUT',
67: 'I-PER',
68: 'I-QUC',
69: 'I-SEV',
70: 'I-SHA',
71: 'I-SIG',
72: 'I-SUB',
73: 'I-TEX',
74: 'I-THP',
75: 'I-TIM',
76: 'I-VOL',
77: 'I-WEI',
78: 'O',
0: '<PAD>'}
MAX_LENGTH = 100
acronyms_to_entities = {v: k for k, v in entity_to_acronyms.items()}
models = {
"model_1": {
"path": "../models/model_1.h5",
"title": "Bidirectional LSTM Model with single LSTM layer"
},
"model_2": {
"path": "../models/model_2.h5",
"title": "Bidirectional LSTM Model with two LSTM layers and one Hidden Dense Layer"
},
"model_3": {
"path": "../models/model_3.h5",
"title": "Bidirectional LSTM model with BioWordVecEmbedding Layers followed two LSTM layers and one Hidden Dense Layer"
},
"model_4": {
"path": "../models/model_4.h5",
"title": "Bidirectional LSTM Model with Time Distributed Dense Layers - Single LSTM layer and Two time distributed dense layers"
},
"model_5": {
"path": "../models/model_5.h5",
"title": "Bidirectional LSTM Model with two LSTM layers and one Hidden Dense Layer"
},
"model_6": {
"path": "../models/model_6.h5",
"title": "Bidirectional LSTM Time Distirbuted Dense Layers and Convolutional 1D layer"
},
"model_7": {
"path": "../models/model_7.h5",
"title": "Bidirectional LSTM CRF model with BioWordVecEmbedding Layers followed two LSTM layers, Time Distirbuted Dense Layers and Convolutional 1D layer"
}
}