Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -87,19 +87,21 @@ if Run_Button == True:
|
|
87 |
spacy_display["text"] = input_text
|
88 |
spacy_display["title"] = None
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
for entity in output:
|
91 |
if aggregation != "none":
|
92 |
spacy_display["ents"].append({"start": entity["start"], "end": entity["end"], "label": entity_map[entity["entity_group"]]})
|
93 |
else:
|
94 |
spacy_display["ents"].append({"start": entity["start"], "end": entity["end"], "label": entity_map[entity["entity"]]})
|
95 |
|
96 |
-
|
97 |
-
'LABEL_1': 'B-Intervention',
|
98 |
-
'LABEL_2': 'I-Intervention',
|
99 |
-
'LABEL_3': 'B-Outcome',
|
100 |
-
'LABEL_4': 'I-Outcome',
|
101 |
-
'LABEL_5': 'B-Values',
|
102 |
-
'LABEL_6': 'I-Value'}
|
103 |
|
104 |
colors = {'B-Intervention': '#85DCDF',
|
105 |
'I-Intervention': '#85DCDF',
|
|
|
87 |
spacy_display["text"] = input_text
|
88 |
spacy_display["title"] = None
|
89 |
|
90 |
+
entity_map = {'LABEL_0': 'O',
|
91 |
+
'LABEL_1': 'B-Intervention',
|
92 |
+
'LABEL_2': 'I-Intervention',
|
93 |
+
'LABEL_3': 'B-Outcome',
|
94 |
+
'LABEL_4': 'I-Outcome',
|
95 |
+
'LABEL_5': 'B-Values',
|
96 |
+
'LABEL_6': 'I-Value'}
|
97 |
+
|
98 |
for entity in output:
|
99 |
if aggregation != "none":
|
100 |
spacy_display["ents"].append({"start": entity["start"], "end": entity["end"], "label": entity_map[entity["entity_group"]]})
|
101 |
else:
|
102 |
spacy_display["ents"].append({"start": entity["start"], "end": entity["end"], "label": entity_map[entity["entity"]]})
|
103 |
|
104 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
colors = {'B-Intervention': '#85DCDF',
|
107 |
'I-Intervention': '#85DCDF',
|