public void run(String format, String[] args) { super.run(format, args);
@Override public void run(String format, String[] args) { super.run(format, args);
public void run(String format, String[] args) { super.run(format, args); mlParams = CmdLineUtil.loadTrainingParameters(params.getParams(), false); if (mlParams == null) { mlParams = ModelUtil.createDefaultTrainingParameters(); } File modelOutFile = params.getModel(); CmdLineUtil.checkOutputFile("lemmatizer model", modelOutFile); LemmatizerModel model; try { LemmatizerFactory lemmatizerFactory = LemmatizerFactory .create(params.getFactory()); model = LemmatizerME.train(params.getLang(), sampleStream, mlParams, lemmatizerFactory); } catch (IOException e) { throw createTerminationIOException(e); } finally { try { sampleStream.close(); } catch (IOException e) { // sorry that this can fail } } CmdLineUtil.writeModel("lemmatizer", modelOutFile, model); } }
public void run(String format, String[] args) { super.run(format, args);
@Override public void run(String format, String[] args) { super.run(format, args); mlParams = CmdLineUtil.loadTrainingParameters(params.getParams(), false); if (mlParams == null) { mlParams = ModelUtil.createDefaultTrainingParameters(); } File modelOutFile = params.getModel(); CmdLineUtil.checkOutputFile("document categorizer model", modelOutFile); FeatureGenerator[] featureGenerators = createFeatureGenerators(params .getFeatureGenerators()); DoccatModel model; try { DoccatFactory factory = DoccatFactory.create(params.getFactory(), featureGenerators); model = DocumentCategorizerME.train(params.getLang(), sampleStream, mlParams, factory); } catch (IOException e) { throw createTerminationIOException(e); } finally { try { sampleStream.close(); } catch (IOException e) { // sorry that this can fail } } CmdLineUtil.writeModel("document categorizer", modelOutFile, model); }
public void run(String format, String[] args) { super.run(format, args);
@Override public void run(String format, String[] args) { super.run(format, args); try { CorefTrainer.train(params.getModel().toString(), sampleStream, true, true); } catch (IOException e) { throw new TerminateToolException(-1, "IO error while reading training data or indexing data: " + e.getMessage(), e); } }
@Override public void run(String format, String[] args) { super.run(format, args); try { CorefTrainer.train(params.getModel().toString(), sampleStream, true, true); } catch (IOException e) { throw new TerminateToolException(-1, "IO error while reading training data or indexing data: " + e.getMessage(), e); } }
public void run(String format, String[] args) { super.run(format, args);
public void run(String format, String[] args) { super.run(format, args);
public void run(String format, String[] args) { super.run(format, args);
@Override public void run(String format, String[] args) { super.run(format, args);
super.run(format, args); if (0 == args.length) { System.out.println(getHelp());
public void run(String format, String[] args) { super.run(format, args);
public void run(String format, String[] args) { super.run(format, args);
public void run(String format, String[] args) { super.run(format, args);
@Override public void run(String format, String[] args) { super.run(format, args);
@Override public void run(String format, String[] args) { super.run(format, args);
public void run(String format, String[] args) { super.run(format, args);
public void run(String format, String[] args) { super.run(format, args); mlParams = CmdLineUtil.loadTrainingParameters(params.getParams(), false); if (mlParams == null) { mlParams = ModelUtil.createDefaultTrainingParameters(); } File modelOutFile = params.getModel(); CmdLineUtil.checkOutputFile("lemmatizer model", modelOutFile); LemmatizerModel model; try { LemmatizerFactory lemmatizerFactory = LemmatizerFactory .create(params.getFactory()); model = LemmatizerME.train(params.getLang(), sampleStream, mlParams, lemmatizerFactory); } catch (IOException e) { throw createTerminationIOException(e); } finally { try { sampleStream.close(); } catch (IOException e) { // sorry that this can fail } } CmdLineUtil.writeModel("lemmatizer", modelOutFile, model); } }