def init_kg(self): if self.kg_model is None: self.kg_model = perceptron.Perceptron( add_curr_dir('model/kg.model'))
def init_ner(self): if self.ner_model is None: self.ner_model = perceptron.Perceptron( add_curr_dir('model/ner.model'))
def load_model(self, model_path): self.seg_model = perceptron.Perceptron(model_path)
def init_pos(self): if self.pos_model is None: self.pos_model = perceptron.Perceptron( add_curr_dir('model/pos.model'))
def init_cws(self): if self.seg_model is None: self.seg_model = perceptron.Perceptron( add_curr_dir('model/cws.model'))