mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Update spacy.explain docs
This commit is contained in:
parent
96b4214303
commit
9bf78d5fb3
|
@ -3,6 +3,16 @@ from __future__ import unicode_literals
|
|||
|
||||
|
||||
def explain(term):
|
||||
"""Get a description for a given POS tag, dependency label or entity type.
|
||||
|
||||
term (unicode): The term to explain.
|
||||
RETURNS (unicode): The explanation, or `None` if not found in the glossary.
|
||||
|
||||
EXAMPLE:
|
||||
>>> spacy.explain(u'NORP')
|
||||
>>> doc = nlp(u'Hello world')
|
||||
>>> print([w.text, w.tag_, spacy.explain(w.tag_) for w in doc])
|
||||
"""
|
||||
if term in GLOSSARY:
|
||||
return GLOSSARY[term]
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ p
|
|||
| #[+src(gh("spacy", "spacy/glossary.py")) #[code glossary.py]].
|
||||
|
||||
+aside-code("Example").
|
||||
spacy.explain('NORP')
|
||||
spacy.explain(u'NORP')
|
||||
# Nationalities or religious or political groups
|
||||
|
||||
doc = nlp(u'Hello world')
|
||||
|
|
Loading…
Reference in New Issue
Block a user