Running the given example #10292
Unanswered
ProjectPool-ML
asked this question in
Help: Coding & Implementations
Replies: 1 comment 4 replies
-
Sorry, I don't understand this. Where did you get this example from? What are you trying to do? Please format your code legibly so we can read it. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Error with the example:
AttributeError Traceback (most recent call last)
in
5 visualizers = ["ner", "textcat"]
6 print(models)
----> 7 spacy_streamlit.visualize(models, default_text, visualizers)
8
~.conda\envs\venv-fromheathrow\lib\site-packages\spacy_streamlit\visualizer.py in visualize(models, default_text, default_model, visualizers, ner_labels, ner_attrs, similarity_texts, token_attrs, show_json_doc, show_meta, show_config, show_visualizer_select, show_pipeline_info, sidebar_title, sidebar_description, show_logo, color, key, get_default_text)
94
95 if "parser" in visualizers and "parser" in active_visualizers:
---> 96 visualize_parser(doc, key=key)
97 if "ner" in visualizers and "ner" in active_visualizers:
98 ner_labels = ner_labels or nlp.get_pipe("ner").labels
~.conda\envs\venv-fromheathrow\lib\site-packages\spacy_streamlit\visualizer.py in visualize_parser(doc, title, key)
151 html = displacy.render(sent, options=options, style="dep")
152 # Double newlines seem to mess with the rendering
--> 153 html = html.replace("\n\n", "\n")
154 if split_sents and len(docs) > 1:
155 st.markdown(f"> {sent.text}")
AttributeError: 'NoneType' object has no attribute 'replace'
Beta Was this translation helpful? Give feedback.
All reactions