mirror of https://github.com/explosion/spaCy.git
don't require read_json_file to expect particular annotations
This commit is contained in:
parent
c2f76a4024
commit
b6b96b233c
|
@ -153,7 +153,7 @@ def read_json_file(loc, docs_filter=None):
|
||||||
ids.append(i)
|
ids.append(i)
|
||||||
tags.append(token.get('tag','-'))
|
tags.append(token.get('tag','-'))
|
||||||
heads.append(token.get('head',0) + i)
|
heads.append(token.get('head',0) + i)
|
||||||
labels.append(token.get('dep','ROOT'))
|
labels.append(token.get('dep',''))
|
||||||
# Ensure ROOT label is case-insensitive
|
# Ensure ROOT label is case-insensitive
|
||||||
if labels[-1].lower() == 'root':
|
if labels[-1].lower() == 'root':
|
||||||
labels[-1] = 'ROOT'
|
labels[-1] = 'ROOT'
|
||||||
|
|
Loading…
Reference in New Issue