Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -236,7 +236,7 @@ def get_span_annotations(response, doc, ner=False):
|
|
236 |
span.end,
|
237 |
el_link_wrapper.format(
|
238 |
span.label.replace(" ", "_"), span.label
|
239 |
-
) if span.label != "--NME--" and not ner else span.label,
|
240 |
# kb_id=span.label.replace(" ", "_")
|
241 |
)
|
242 |
)
|
@@ -269,7 +269,7 @@ def generate_graph(spans, response, colors, dict_ents, bgcolor="#111827", font_c
|
|
269 |
|
270 |
for ent in spans:
|
271 |
# if not NME use title:
|
272 |
-
if dict_ents[(ent.start, ent.end)][2] != "--NME--"
|
273 |
g.add_node(
|
274 |
dict_ents[(ent.start, ent.end)][2],
|
275 |
label=dict_ents[(ent.start, ent.end)][2],
|
|
|
236 |
span.end,
|
237 |
el_link_wrapper.format(
|
238 |
span.label.replace(" ", "_"), span.label
|
239 |
+
) if (span.label != "--NME--" and not ner) else span.label,
|
240 |
# kb_id=span.label.replace(" ", "_")
|
241 |
)
|
242 |
)
|
|
|
269 |
|
270 |
for ent in spans:
|
271 |
# if not NME use title:
|
272 |
+
if dict_ents[(ent.start, ent.end)][2] != "--NME--" and not ner:
|
273 |
g.add_node(
|
274 |
dict_ents[(ent.start, ent.end)][2],
|
275 |
label=dict_ents[(ent.start, ent.end)][2],
|