Tidy up [ci skip]

This commit is contained in:
Ines Montani 2019-10-02 12:05:59 +02:00
parent d82241218a
commit 52b5912dbf

View File

@ -78,9 +78,8 @@ if "parser" in nlp.pipe_names:
if "ner" in nlp.pipe_names:
st.header("Named Entities")
st.sidebar.header("Named Entities")
labels = st.sidebar.multiselect(
"Entity labels", nlp.get_pipe("ner").labels, nlp.get_pipe("ner").labels
)
label_set = nlp.get_pipe("ner").labels
labels = st.sidebar.multiselect("Entity labels", label_set, label_set)
html = displacy.render(doc, style="ent", options={"ents": labels})
# Newlines seem to mess with the rendering
html = html.replace("\n", " ")