mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
commit
6e1f1c4b9e
|
@ -151,9 +151,9 @@ def read_json_file(loc, docs_filter=None):
|
|||
for i, token in enumerate(sent['tokens']):
|
||||
words.append(token['orth'])
|
||||
ids.append(i)
|
||||
tags.append(token['tag'])
|
||||
heads.append(token['head'] + i)
|
||||
labels.append(token['dep'])
|
||||
tags.append(token.get('tag','-'))
|
||||
heads.append(token.get('head',0) + i)
|
||||
labels.append(token.get('dep',''))
|
||||
# Ensure ROOT label is case-insensitive
|
||||
if labels[-1].lower() == 'root':
|
||||
labels[-1] = 'ROOT'
|
||||
|
|
Loading…
Reference in New Issue
Block a user