def save(self, filename):
info_dict = {
"tokens":self.tokens,
"strings":self.strings,
"s2t":dict(self.s2t),
"i2t":dict(self.i2t),
"unk":self.unk,
"START_TOK":self.START_TOK,
"END_TOK":self.END_TOK
}
with open(filename, "w") as f: pickle.dump(info_dict, f)
评论列表
文章目录