From ddaba93fd09fb5593d8000720d5a1e2a5d03e771 Mon Sep 17 00:00:00 2001 From: John Bauer Date: Thu, 28 Nov 2024 15:21:53 -0800 Subject: [PATCH] Add a helpful error message / documentation for a missing build_vocab --- stanza/models/common/vocab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stanza/models/common/vocab.py b/stanza/models/common/vocab.py index 66c42fc861..4f77542d15 100644 --- a/stanza/models/common/vocab.py +++ b/stanza/models/common/vocab.py @@ -29,7 +29,7 @@ def __init__(self, data=None, lang="", idx=0, cutoff=0, lower=False): self.state_attrs = ['lang', 'idx', 'cutoff', 'lower', '_unit2id', '_id2unit'] def build_vocab(self): - raise NotImplementedError() + raise NotImplementedError("This BaseVocab does not have build_vocab implemented. This method should create _id2unit and _unit2id") def state_dict(self): """ Returns a dictionary containing all states that are necessary to recover