mirror of https://github.com/explosion/spaCy.git
doc: Add missing *-operator to nlp.disable_pipes()
I'm using SpaCy version 2.0.3. If I don't use the *-operator in the example, Python throws an error message. With the operator it works fine. Also according to the documentation of the function `nlp.disable_pipes()`, it expects one or more strings as arguments and not one argument being a list of strings.
This commit is contained in:
parent
b078e276e6
commit
662601f01c
|
@ -112,7 +112,7 @@ p
|
||||||
nlp = spacy.load('en')
|
nlp = spacy.load('en')
|
||||||
train_data = [("Uber blew through $1 million", {'entities': [(0, 4, 'ORG')]})]
|
train_data = [("Uber blew through $1 million", {'entities': [(0, 4, 'ORG')]})]
|
||||||
|
|
||||||
with nlp.disable_pipes([pipe for pipe in nlp.pipe_names if pipe != 'ner']):
|
with nlp.disable_pipes(*[pipe for pipe in nlp.pipe_names if pipe != 'ner']):
|
||||||
optimizer = nlp.begin_training()
|
optimizer = nlp.begin_training()
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
random.shuffle(train_data)
|
random.shuffle(train_data)
|
||||||
|
|
Loading…
Reference in New Issue