Java Reference
In-Depth Information
new FileInputStream("en-animal.train");
OutputStream dataOut =
new FileOutputStream("en-animal.model");) {
ObjectStream<String> lineStream
= new PlainTextByLineStream(dataIn, "UTF-8");
ObjectStream<DocumentSample> sampleStream =
new DocumentSampleStream(lineStream);
model = DocumentCategorizerME.train("en", sampleStream);
...
} catch (IOException e) {
// Handle exceptions
}
The output is as follows and has been shortened to conserve space:
Indexing events using cutoff of 5
Computing event counts... done. 12 events
Indexing... done.
Sorting and merging events... done. Reduced 12 events to 12.
Done indexing.
Incorporating indexed data for training...
done.
Number of Event Tokens: 12
Number of Outcomes: 2
Number of Predicates: 30
...done.
Computing model parameters ...
Performing 100 iterations.
1: ... loglikelihood=-8.317766166719343 0.75
2: ... loglikelihood=-7.1439957443937265 0.75
3: ... loglikelihood=-6.560690872956419 0.75
4: ... loglikelihood=-6.106743124066829 0.75
5: ... loglikelihood=-5.721805583104927
0.8333333333333334
6: ... loglikelihood=-5.3891508904777785
0.8333333333333334
7: ... loglikelihood=-5.098768040466029
0.8333333333333334
Search WWH ::




Custom Search