From 688a3286689493d602db156edb0b768dc921eb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Harinck?= Date: Wed, 15 Apr 2020 16:47:29 +0200 Subject: [PATCH] docs(website): fix issue on example in spacy-lookup --- website/meta/universe.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/meta/universe.json b/website/meta/universe.json index 23d052bb9..70aace8c0 100644 --- a/website/meta/universe.json +++ b/website/meta/universe.json @@ -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": {