diff --git a/spacy/syntax/ner.pyx b/spacy/syntax/ner.pyx index c2597bc7e..0a40ed9a8 100644 --- a/spacy/syntax/ner.pyx +++ b/spacy/syntax/ner.pyx @@ -76,6 +76,8 @@ 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 != '-': + if ner_tag.count('-') != 1: + raise ValueError(ner_tag) _, label = ner_tag.split('-') for move_str in ('B', 'I', 'L', 'U'): move_labels[moves.index(move_str)][label] = True