Hello,
I am having difficulty saving/loading GISModels using the opennlp maxent
package. I am attempting to save them with the following code
OnePassDataIndexer indexer = new OnePassDataIndexer(evStream);
GISModel model = GIS.trainModel(this.iters, indexer);
if (outputFile != null) {
SuffixSensitiveGISModelWriter writer =
new SuffixSensitiveGISModelWriter(model, outputFile);
writer.persist();
}
Subsequently, I am trying to load saved models with
SuffixSensitiveGISModelReader reader =
new SuffixSensitiveGISModelReader(file);
GISModel model = reader.constructModel();
If the output file is a text file. GISModelReader throws a number format
exception about the string GIS which is the first content in the .txt file. If
I delete this line the model loads and gives me expected performance. When I
use a bin or a bin.gz output file I receive an EOFException from construct
model.
The same errors happen using PlainTextModelWriter. Am I using the API
incorrectly?