spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Spacy Basic Usage Error

Open jknair opened this issue 10 years ago • 5 comments

Using Spacy v1.1.2 the following code errors out

import spacy
en_nlp = spacy.load('en', parser=True)
en_doc = en_nlp(u'Hello, world. Here are two sentences.')

with an error

  File "/usr/local/lib/python2.7/site-packages/spacy/language.py", line 313, in __call__
    proc(doc)
TypeError: 'bool' object is not callable

jknair avatar Oct 25 '16 11:10 jknair

parser=True is already the default, you don't need to specify it. When you specify a value, it's used as the parser, but True is not a function (not callable).

pquentin avatar Oct 25 '16 11:10 pquentin

I am guessing this has changed after an update. Cool thanks

jknair avatar Oct 25 '16 12:10 jknair

This is so weird.

neufang avatar Apr 24 '17 13:04 neufang

spacy definitely needs better documentation for initiating the English class, looking at the source code (Language.__init__) the overrides kwargs implementation doesn't help at all. It is not clear if default values are flags or objects of certain type. The big problem with SpaCy's API is that it is hiding everything from the end-user (aka you just load this object, it does everything for you!) An expert NLP user would definitely wanna see easy interface to disable/enable taggers, parsers, vectors, entity etc... There is no example in the documentation about initiating the English class, except English() examples. This also makes it nearly impossible to inherit from the English class.

rmanak avatar Oct 04 '17 20:10 rmanak

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar May 08 '18 15:05 lock[bot]