def load_vocab(self, filename): with open(filename, "rb") as f: vocab = pickle.load(f) self._load_vocab(vocab) return self