From f69fe6a635ee8bdd4560f79238c6580180676346 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 27 May 2015 01:14:54 +0200 Subject: [PATCH] * Fix heads problem in read_conll --- spacy/munge/read_conll.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/spacy/munge/read_conll.py b/spacy/munge/read_conll.py index e18fb7557..ed6037a4d 100644 --- a/spacy/munge/read_conll.py +++ b/spacy/munge/read_conll.py @@ -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