docs(website): fix issue on example in spacy-lookup

This commit is contained in:
Sébastien Harinck 2020-04-15 16:47:29 +02:00
parent 42364dcd9f
commit 688a328668
1 changed files with 4 additions and 3 deletions

View File

@ -334,15 +334,16 @@
"from spacy_lookup import Entity",
"",
"nlp = spacy.load('en')",
"entity = Entity(keywords_list=['python', 'java platform'])",
"entity = Entity(keywords_list=['python', 'product manager', 'java platform'])",
"nlp.add_pipe(entity, last=True)",
"",
"doc = nlp(u\"I am a product manager for a java and python.\")",
"assert doc._.has_entities == True",
"assert doc[2:5]._.has_entities == True",
"assert doc[0]._.is_entity == False",
"assert doc[3]._.entity_desc == 'product manager'",
"assert doc[3]._.is_entity == True",
"print(doc._.entities)"
"",
"print([(token.text, token._.canonical) for token in doc if token._.is_entity])"
],
"author": "Marc Puig",
"author_links": {