explosion / spacy-streamlit

👑 spaCy building blocks and visualizers for Streamlit apps
https://share.streamlit.io/ines/spacy-streamlit-demo/master/app.py
MIT License
794 stars 114 forks source link

NotImplementedError: [E894] The 'noun_chunks' syntax iterator is not implemented for language 'it'. #36

Closed mirfan899 closed 2 years ago

mirfan899 commented 2 years ago

I'm trying to use the italian model and getting this error why usine visualize_parser.

File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py", line 443, in _run_script
    exec(code, module.__dict__)
  File "/home/irfan/PycharmProjects/TES-Clone/main.py", line 385, in <module>
    visualize_parser(doc)
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy_streamlit/visualizer.py", line 156, in visualize_parser
    html = displacy.render(sent, options=options, style="dep")
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy/displacy/__init__.py", line 57, in render
    parsed = [converter(doc, options) for doc in docs] if not manual else docs  # type: ignore
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy/displacy/__init__.py", line 57, in <listcomp>
    parsed = [converter(doc, options) for doc in docs] if not manual else docs  # type: ignore
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy/displacy/__init__.py", line 131, in parse_deps
    for np in list(doc.noun_chunks):
  File "spacy/tokens/doc.pyx", line 852, in noun_chunks
NotImplementedError: [E894] The 'noun_chunks' syntax iterator is not implemented for language 'it'.

Here are the models and library info

en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0-py3-none-any.whl
it-core-news-sm @ https://github.com/explosion/spacy-models/releases/download/it_core_news_sm-3.2.0/it_core_news_sm-3.2.0-py3-none-any.whl
spacy==3.2.4
spacy-legacy==3.0.9
spacy-loggers==1.0.2
spacy-streamlit==1.0.3
polm commented 2 years ago

We forgot to put this in the release notes, but noun chunks for Italian were only added in the recently released v3.3 of spaCy. If you upgrade it should just work. Also note you should re-download models after upgrading.

mirfan899 commented 2 years ago

Okay, thanks.