Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import spacy
- text = "The Spacy noun chunker doesn't work as expected and illustrated in various examples accross the web."
- nlp_en = spacy.load('en_core_web_sm')
- doc = nlp_en(text)
- ncs = [nc for nc in doc.noun_chunks]
- ---------------------------------------------------------------------------
- ValueError Traceback (most recent call last)
- <ipython-input-230-bebdb397f19f> in <module>()
- 4 nlp_en = spacy.load('en_core_web_sm')
- 5 doc = nlp_en(text)
- ----> 6 ncs = [nc for nc in doc.noun_chunks]
- <ipython-input-230-bebdb397f19f> in <listcomp>(.0)
- 4 nlp_en = spacy.load('en_core_web_sm')
- 5 doc = nlp_en(text)
- ----> 6 ncs = [nc for nc in doc.noun_chunks]
- doc.pyx in __get__()
- ValueError: noun_chunks requires the dependency parse, which requires a statistical model to be installed and loaded. For more info, see the documentation:
- https://spacy.io/usage/models
- text = "De Spacy noun chunker werkt niet en al zeker niet zoals overal staat in voorbeelden op het internet."
- nlp_nl = spacy.load('nl_core_news_sm')
- doc = nlp_nl(text)
- ncs = [nc for nc in doc.noun_chunks]
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- <ipython-input-231-995e8109d484> in <module>()
- 4 nlp_en = spacy.load('nl_core_news_sm')
- 5 doc = nlp_en(text)
- ----> 6 ncs = [nc for nc in doc.noun_chunks]
- <ipython-input-231-995e8109d484> in <listcomp>(.0)
- 4 nlp_en = spacy.load('nl_core_news_sm')
- 5 doc = nlp_en(text)
- ----> 6 ncs = [nc for nc in doc.noun_chunks]
- doc.pyx in __get__()
- TypeError: 'NoneType' object is not callable
Add Comment
Please, Sign In to add comment