예제 #1
0
 def __init__(self, save_dir):
     self.path = utils.get_vocab_path(save_dir)
     self.max_size = 100
     self.vocab = {}
     if os.path.exists(self.path):
         self.vocab = json.load(open(self.path))
예제 #2
0
 def __init__(self, model_dir, max_size):
     self.path = utils.get_vocab_path(model_dir)
     self.max_size = max_size
     self.vocab = {}
     if os.path.exists(self.path):
         self.vocab = json.load(open(self.path))