/** * Trains a new model * * @param es * @param iterations * @param cut * @return the new model * @throws IOException */ @Deprecated public static AbstractModel trainMaxentModel(EventStream es, int iterations, int cut) throws IOException { return opennlp.maxent.GIS.trainModel(iterations, new TwoPassDataIndexer(es, cut)); }
public static AbstractModel trainPerceptronModel(EventStream es, int iterations, int cut, boolean useAverage) throws IOException { return new opennlp.perceptron.PerceptronTrainer().trainModel(iterations, new TwoPassDataIndexer(es, cut, false), cut, useAverage); }
GISModel model = GIS.trainModel(100, new TwoPassDataIndexer(es, 3));//<co id="atc.train.do"/> new DoccatModel("en", model).serialize(new FileOutputStream(outFile));
indexer = new TwoPassDataIndexer(hses, cutoff, sortAndMerge);
indexer = new TwoPassDataIndexer(hses, cutoff, sortAndMerge);
/** * * @param samples * @param tagDictionary * @param ngramDictionary * @param cutoff * * @throws IOException its throws if an {@link IOException} is thrown * during IO operations on a temp file which is created during training occur. */ public static POSModel train(String languageCode, ObjectStream<POSSample> samples, POSDictionary tagDictionary, Dictionary ngramDictionary, int cutoff, int iterations) throws IOException { GISModel posModel = opennlp.maxent.GIS.trainModel(iterations, new TwoPassDataIndexer(new POSSampleEventStream(samples, new DefaultPOSContextGenerator(ngramDictionary)), cutoff)); return new POSModel(languageCode, posModel, tagDictionary, ngramDictionary); }