public static ChunkerModel train(String lang, ObjectStream<ChunkSample> in,
TrainingParameters mlParams, ChunkerFactory factory) throws IOException {
Map<String, String> manifestInfoEntries = new HashMap<String, String>();
EventStream es = new ChunkerEventStream(in, factory.getContextGenerator());
AbstractModel maxentModel = TrainUtil.train(es, mlParams.getSettings(),
manifestInfoEntries);
return new ChunkerModel(lang, maxentModel, manifestInfoEntries, factory);