def load(self, dirpath ): print >> sys.stderr, "Loading model from %s" %dirpath self.classes = unserialize( os.path.join(dirpath, 'classes.json') ) self.feature2int = unserialize( os.path.join(dirpath, 'feature_map.json') ) self.weights = np.load( os.path.join(dirpath, 'weights.npy') ) self.bias_weights = np.load( os.path.join(dirpath, 'bias_weights.npy') ) print >> sys.stderr, "done." return
def load_lexicon(self, filepath ): print >> sys.stderr, "Loading external lexicon...", self.lex_dict = unserialize( filepath ) print >> sys.stderr, "done." return
def load_tag_dictionary(self, filepath ): print >> sys.stderr, "Loading tag dictionary...", self.tag_dict = unserialize( filepath ) print >> sys.stderr, "done." return