mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
* Fix heads problem in read_conll
This commit is contained in:
parent
0eec1d12af
commit
f69fe6a635
|
@ -13,7 +13,6 @@ def parse(sent_text, strip_bad_periods=False):
|
|||
id_map = {}
|
||||
for i, line in enumerate(sent_text.split('\n')):
|
||||
word, tag, head, dep = _parse_line(line)
|
||||
id_map[i] = len(words)
|
||||
if strip_bad_periods and words and _is_bad_period(words[-1], word):
|
||||
continue
|
||||
|
||||
|
@ -24,8 +23,6 @@ def parse(sent_text, strip_bad_periods=False):
|
|||
'head': int(head) - 1,
|
||||
'dep': dep})
|
||||
words.append(word)
|
||||
for entry in annot:
|
||||
entry['head'] = id_map.get(entry['head'], entry['head'])
|
||||
return words, annot
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user