Package opennlp.model

Examples of opennlp.model.MaxentModel.eval()


    MaxentModel smallModel = GIS.trainModel(100,
        new OnePassRealValueDataIndexer(smallEventStream, 0), false);
    String[] contexts = smallTest.split(" ");
    float[] values = RealValueFileEventStream.parseContexts(contexts);
    double[] smallResults = smallModel.eval(contexts, values);

    String smallResultString = smallModel.getAllOutcomes(smallResults);
    System.out.println("smallResults: " + smallResultString);

    StringReader largeReader = new StringReader(largeValues);
View Full Code Here


    MaxentModel largeModel = GIS.trainModel(100,
        new OnePassRealValueDataIndexer(largeEventStream, 0), false);
    contexts = largeTest.split(" ");
    values = RealValueFileEventStream.parseContexts(contexts);
    double[] largeResults = largeModel.eval(contexts, values);

    String largeResultString = smallModel.getAllOutcomes(largeResults);
    System.out.println("largeResults: " + largeResultString);

    assertEquals(smallResults.length, largeResults.length);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.