diff --git a/spacy/errors.py b/spacy/errors.py index 9473f1cf7..74111e48d 100644 --- a/spacy/errors.py +++ b/spacy/errors.py @@ -952,7 +952,6 @@ class Errors(metaclass=ErrorsWithCodes): "with `displacy.serve(doc, port=port)`") E1050 = ("Port {port} is already in use. Please specify an available port with `displacy.serve(doc, port=port)` " "or use `auto_switch_port=True` to pick an available port automatically.") - E1051 = ("Expected `entity_id` to be of type {should_type}, but is of type {is_type}.") # v4 error strings E4000 = ("Expected a Doc as input, but got: '{type}'") @@ -962,6 +961,7 @@ class Errors(metaclass=ErrorsWithCodes): E4003 = ("Training examples for distillation must have the exact same tokens in the " "reference and predicted docs.") E4004 = ("Backprop is not supported when is_train is not set.") + E4005 = ("Expected `entity_id` to be of type {should_type}, but is of type {is_type}.") RENAMED_LANGUAGE_CODES = {"xx": "mul", "is": "isl"} diff --git a/spacy/kb/candidate.py b/spacy/kb/candidate.py index a481d88f5..9778b2880 100644 --- a/spacy/kb/candidate.py +++ b/spacy/kb/candidate.py @@ -101,7 +101,7 @@ class InMemoryCandidate(Candidate): self._entity_freq = entity_freq if not isinstance(self._entity_id, int): raise ValueError( - Errors.E1051.format(should_type="int", is_type=str(type(entity_id))) + Errors.E4005.format(should_type="int", is_type=str(type(entity_id))) ) self._entity_id_str = self._hash_to_str(self._entity_id)