Guest User

Untitled

a guest
Jul 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. import spacy
  2.  
  3. text = "The Spacy noun chunker doesn't work as expected and illustrated in various examples accross the web."
  4. nlp_en = spacy.load('en_core_web_sm')
  5. doc = nlp_en(text)
  6. ncs = [nc for nc in doc.noun_chunks]
  7.  
  8. ---------------------------------------------------------------------------
  9. ValueError Traceback (most recent call last)
  10. <ipython-input-230-bebdb397f19f> in <module>()
  11. 4 nlp_en = spacy.load('en_core_web_sm')
  12. 5 doc = nlp_en(text)
  13. ----> 6 ncs = [nc for nc in doc.noun_chunks]
  14.  
  15. <ipython-input-230-bebdb397f19f> in <listcomp>(.0)
  16. 4 nlp_en = spacy.load('en_core_web_sm')
  17. 5 doc = nlp_en(text)
  18. ----> 6 ncs = [nc for nc in doc.noun_chunks]
  19.  
  20. doc.pyx in __get__()
  21.  
  22. ValueError: noun_chunks requires the dependency parse, which requires a statistical model to be installed and loaded. For more info, see the documentation:
  23. https://spacy.io/usage/models
  24.  
  25. text = "De Spacy noun chunker werkt niet en al zeker niet zoals overal staat in voorbeelden op het internet."
  26. nlp_nl = spacy.load('nl_core_news_sm')
  27. doc = nlp_nl(text)
  28. ncs = [nc for nc in doc.noun_chunks]
  29.  
  30. ---------------------------------------------------------------------------
  31. TypeError Traceback (most recent call last)
  32. <ipython-input-231-995e8109d484> in <module>()
  33. 4 nlp_en = spacy.load('nl_core_news_sm')
  34. 5 doc = nlp_en(text)
  35. ----> 6 ncs = [nc for nc in doc.noun_chunks]
  36.  
  37. <ipython-input-231-995e8109d484> in <listcomp>(.0)
  38. 4 nlp_en = spacy.load('nl_core_news_sm')
  39. 5 doc = nlp_en(text)
  40. ----> 6 ncs = [nc for nc in doc.noun_chunks]
  41.  
  42. doc.pyx in __get__()
  43.  
  44. TypeError: 'NoneType' object is not callable
Add Comment
Please, Sign In to add comment