From 52b5912dbf4a17ea2be1b725ff27c410c8b9b94e Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 2 Oct 2019 12:05:59 +0200 Subject: [PATCH] Tidy up [ci skip] --- examples/streamlit_spacy.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/streamlit_spacy.py b/examples/streamlit_spacy.py index fd27ec0ec..1afa1cd32 100644 --- a/examples/streamlit_spacy.py +++ b/examples/streamlit_spacy.py @@ -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", " ")