From fd2d48556c1e77f4492693e4a69dc8f4a34cfe34 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 5 Oct 2020 13:43:32 +0200 Subject: [PATCH] fix E902 and E903 numbering --- spacy/errors.py | 4 ++-- spacy/training/converters/conll_ner_to_docs.py | 2 +- spacy/training/converters/iob_to_docs.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/errors.py b/spacy/errors.py index 20edf45b5..9d9a716d2 100644 --- a/spacy/errors.py +++ b/spacy/errors.py @@ -456,10 +456,10 @@ class Errors: "issue tracker: http://github.com/explosion/spaCy/issues") # TODO: fix numbering after merging develop into master - E092 = ("The sentence-per-line IOB/IOB2 file is not formatted correctly. " + E902 = ("The sentence-per-line IOB/IOB2 file is not formatted correctly. " "Try checking whitespace and delimiters. See " "https://nightly.spacy.io/api/cli#convert") - E093 = ("The token-per-line NER file is not formatted correctly. Try checking " + E903 = ("The token-per-line NER file is not formatted correctly. Try checking " "whitespace and delimiters. See https://nightly.spacy.io/api/cli#convert") E904 = ("Cannot initialize StaticVectors layer: nO dimension unset. This " "dimension refers to the output width, after the linear projection " diff --git a/spacy/training/converters/conll_ner_to_docs.py b/spacy/training/converters/conll_ner_to_docs.py index 28f0f87c3..c01686aee 100644 --- a/spacy/training/converters/conll_ner_to_docs.py +++ b/spacy/training/converters/conll_ner_to_docs.py @@ -103,7 +103,7 @@ def conll_ner_to_docs( lines = [line.strip() for line in conll_sent.split("\n") if line.strip()] cols = list(zip(*[line.split() for line in lines])) if len(cols) < 2: - raise ValueError(Errors.E093) + raise ValueError(Errors.E903) length = len(cols[0]) words.extend(cols[0]) sent_starts.extend([True] + [False] * (length - 1)) diff --git a/spacy/training/converters/iob_to_docs.py b/spacy/training/converters/iob_to_docs.py index 73ad8953d..a2185fef7 100644 --- a/spacy/training/converters/iob_to_docs.py +++ b/spacy/training/converters/iob_to_docs.py @@ -46,7 +46,7 @@ def read_iob(raw_sents, vocab, n_sents): sent_words, sent_iob = zip(*sent_tokens) sent_tags = ["-"] * len(sent_words) else: - raise ValueError(Errors.E092) + raise ValueError(Errors.E902) words.extend(sent_words) tags.extend(sent_tags) iob.extend(sent_iob)