Package opennlp.model

Examples of opennlp.model.OnePassRealValueDataIndexer


 
  @Test
  public void testSerdeModel() throws IOException {
      // given
      RealValueFileEventStream rvfes1 = new RealValueFileEventStream("src/test/resources/data/opennlp/maxent/real-valued-weights-training-data.txt")
      DataIndexer testDataIndexer = new OnePassRealValueDataIndexer(rvfes1,1);
      // when
     // QNModel trainedModel = new QNTrainer(5, 500, true).trainModel(new TwoPassDataIndexer(createTrainingStream()));
      QNModel trainedModel = new QNTrainer(5, 700, true).trainModel(testDataIndexer);
     
      ByteArrayOutputStream modelBytes = new ByteArrayOutputStream();
View Full Code Here


      if (type.equals("maxent")) {

        if (!real) {
          model = GIS.trainModel(es, maxit, cutoff, sigma);
        } else {
          model = GIS.trainModel(maxit, new OnePassRealValueDataIndexer(es, 0),
              USE_SMOOTHING);
        }
      } else if (type.equals("perceptron")) {
        System.err.println("Perceptron training");
        model = new PerceptronTrainer().trainModel(10, new OnePassDataIndexer(
View Full Code Here

TOP

Related Classes of opennlp.model.OnePassRealValueDataIndexer

Copyright © 2018 www.massapicom. 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.