Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 def load_lexicon(self, filepath ):
     print >> sys.stderr, "Loading external lexicon...",
     self.lex_dict = unserialize( filepath )
     print >> sys.stderr, "done."
     return
Ejemplo n.º 3
0
 def load_tag_dictionary(self, filepath ):
     print >> sys.stderr, "Loading tag dictionary...",
     self.tag_dict = unserialize( filepath )
     print >> sys.stderr, "done."
     return