mirror of https://github.com/explosion/spaCy.git
Allow 'fine_grained' option in displaCy (see #1703)
Shows token.tag_ instead of token.pos_. Disabled by default, to not cause rendering issues for models with long fine-grained tags (e.g. merged morphological features).
This commit is contained in:
parent
d8dd484dc0
commit
020a7e5d52
|
@ -97,6 +97,9 @@ def parse_deps(orig_doc, options={}):
|
||||||
word.lemma_, word.ent_type_))
|
word.lemma_, word.ent_type_))
|
||||||
for span_props in spans:
|
for span_props in spans:
|
||||||
doc.merge(*span_props)
|
doc.merge(*span_props)
|
||||||
|
if options.get('fine_grained'):
|
||||||
|
words = [{'text': w.text, 'tag': w.tag_} for w in doc]
|
||||||
|
else:
|
||||||
words = [{'text': w.text, 'tag': w.pos_} for w in doc]
|
words = [{'text': w.text, 'tag': w.pos_} for w in doc]
|
||||||
arcs = []
|
arcs = []
|
||||||
for word in doc:
|
for word in doc:
|
||||||
|
|
Loading…
Reference in New Issue