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": {