diff --git a/spacy/training/example.pyx b/spacy/training/example.pyx index bbe59e9f4..dc1c74e8a 100644 --- a/spacy/training/example.pyx +++ b/spacy/training/example.pyx @@ -356,7 +356,9 @@ def _add_entities_to_doc(doc, ner_data): return elif ner_data == []: doc.ents = [] - elif isinstance(ner_data[0], tuple): + elif not isinstance(ner_data, (list, tuple)): + raise ValueError(Errors.E973) + elif isinstance(ner_data[0], (list, tuple)): return _add_entities_to_doc( doc, offsets_to_biluo_tags(doc, ner_data)