ObjectStream<ChunkSample> ces = new ChunkSampleStream(new ParseSampleStream(new PlainTextByLineStream(new java.io.FileReader(inFile))));
ChunkerModel chunkModel = ChunkerME.train("en", ces, cutoff, iterations,
new ChunkContextGenerator());
System.out.println("Saving the chunker model as: " + chunkFile);
OutputStream chunkOutputStream = new FileOutputStream(chunkFile);
chunkModel.serialize(chunkOutputStream);
chunkOutputStream.close();
}
if (build || all) {
System.err.println("Loading Dictionary");