From 5a075ea3fcb01582ad6433aaf5ce242eed782d2b Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 5 Apr 2015 22:30:58 +0200 Subject: [PATCH] * Ensure NER moves are available for single-word tokens --- spacy/syntax/ner.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/syntax/ner.pyx b/spacy/syntax/ner.pyx index 9b0014ab3..c2597bc7e 100644 --- a/spacy/syntax/ner.pyx +++ b/spacy/syntax/ner.pyx @@ -76,8 +76,9 @@ cdef class BiluoPushDown(TransitionSystem): for (raw_text, toks, (ids, words, tags, heads, labels, biluo)) in gold_tuples: for i, ner_tag in enumerate(biluo): if ner_tag != 'O' and ner_tag != '-': - move_str, label = ner_tag.split('-') - move_labels[moves.index(move_str)][label] = True + _, label = ner_tag.split('-') + for move_str in ('B', 'I', 'L', 'U'): + move_labels[moves.index(move_str)][label] = True return move_labels def move_name(self, int move, int label):