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:
mpuels 2017-12-06 15:26:43 +01:00 committed by GitHub
parent b078e276e6
commit 662601f01c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)