use of com.joliciel.talismane.machineLearning.ClassificationModelTrainer in project talismane by joliciel-informatique.
the class SentenceDetectorTrainer method train.
public ClassificationModel train() throws TalismaneException, IOException {
ModelTrainerFactory factory = new ModelTrainerFactory();
ClassificationModelTrainer trainer = factory.constructTrainer(sentenceConfig.getConfig("train.machine-learning"));
ClassificationModel model = trainer.trainModel(eventStream, descriptors);
model.setExternalResources(TalismaneSession.get(sessionId).getExternalResourceFinder().getExternalResources());
File modelDir = modelFile.getParentFile();
if (modelDir != null)
modelDir.mkdirs();
model.persist(modelFile);
return model;
}
use of com.joliciel.talismane.machineLearning.ClassificationModelTrainer in project talismane by joliciel-informatique.
the class PosTaggerTrainer method train.
public ClassificationModel train() throws TalismaneException, IOException {
ModelTrainerFactory factory = new ModelTrainerFactory();
ClassificationModelTrainer trainer = factory.constructTrainer(posTaggerConfig.getConfig("train.machine-learning"));
ClassificationModel model = trainer.trainModel(eventStream, descriptors);
model.setExternalResources(TalismaneSession.get(sessionId).getExternalResourceFinder().getExternalResources());
File modelDir = modelFile.getParentFile();
if (modelDir != null)
modelDir.mkdirs();
model.persist(modelFile);
return model;
}
use of com.joliciel.talismane.machineLearning.ClassificationModelTrainer in project talismane by joliciel-informatique.
the class PatternTokeniserTrainer method train.
public ClassificationModel train() throws TalismaneException, IOException {
ModelTrainerFactory factory = new ModelTrainerFactory();
ClassificationModelTrainer trainer = factory.constructTrainer(tokeniserConfig.getConfig("train.machine-learning"));
ClassificationModel model = trainer.trainModel(eventStream, descriptors);
model.setExternalResources(TalismaneSession.get(sessionId).getExternalResourceFinder().getExternalResources());
File modelDir = modelFile.getParentFile();
if (modelDir != null)
modelDir.mkdirs();
model.persist(modelFile);
return model;
}
use of com.joliciel.talismane.machineLearning.ClassificationModelTrainer in project talismane by joliciel-informatique.
the class ParserTrainer method train.
public ClassificationModel train() throws TalismaneException, IOException {
ModelTrainerFactory factory = new ModelTrainerFactory();
ClassificationModelTrainer trainer = factory.constructTrainer(parserConfig.getConfig("train.machine-learning"));
ClassificationModel model = trainer.trainModel(eventStream, descriptors);
model.setExternalResources(TalismaneSession.get(sessionId).getExternalResourceFinder().getExternalResources());
File modelDir = modelFile.getParentFile();
if (modelDir != null)
modelDir.mkdirs();
model.persist(modelFile);
return model;
}
use of com.joliciel.talismane.machineLearning.ClassificationModelTrainer in project talismane by joliciel-informatique.
the class LanguageDetectorTrainer method train.
public ClassificationModel train() throws TalismaneException, IOException {
ModelTrainerFactory factory = new ModelTrainerFactory();
ClassificationModelTrainer trainer = factory.constructTrainer(languageConfig.getConfig("train.machine-learning"));
ClassificationModel model = trainer.trainModel(eventStream, descriptors);
model.setExternalResources(session.getExternalResourceFinder().getExternalResources());
File modelDir = modelFile.getParentFile();
if (modelDir != null)
modelDir.mkdirs();
model.persist(modelFile);
return model;
}
Aggregations