Package opennlp.model

Examples of opennlp.model.UniformPrior


   * @param di The data indexer used to compress events in memory.
   * @return The newly trained model, which can be used immediately or saved
   *         to disk using an opennlp.maxent.io.GISModelWriter object.
   */
  public GISModel trainModel(int iterations, DataIndexer di, int cutoff) {
    return trainModel(iterations,di,new UniformPrior(),cutoff,1);
  }
View Full Code Here


   *          The parameter associated with the correction feature.
   */
  public GISModel(Context[] params, String[] predLabels, String[] outcomeNames,
      int correctionConstant, double correctionParam) {
    this(params, predLabels, outcomeNames, correctionConstant, correctionParam,
        new UniformPrior());
  }
View Full Code Here

  @Test
  public void testMaxentOnPrepAttachData2Threads() throws IOException {
    AbstractModel model =
        new GISTrainer(true).trainModel(100,
            new TwoPassDataIndexer(createTrainingStream(), 1),
            new UniformPrior(), 1, 2);
   
    testModel(model, 0.7997028967566229);
  }
View Full Code Here

      int cutoff, int threads) {
    GISTrainer trainer = new GISTrainer(printMessagesWhileTraining);
    trainer.setSmoothing(smoothing);
    trainer.setSmoothingObservation(SMOOTHING_OBSERVATION);
    if (modelPrior == null) {
      modelPrior = new UniformPrior();
    }
   
    return trainer.trainModel(iterations, indexer, modelPrior, cutoff, threads);
  }
View Full Code Here

   * @param di The data indexer used to compress events in memory.
   * @return The newly trained model, which can be used immediately or saved
   *         to disk using an opennlp.maxent.io.GISModelWriter object.
   */
  public GISModel trainModel(int iterations, DataIndexer di, int cutoff) {
    return trainModel(iterations,di,new UniformPrior(),cutoff,1);
  }
View Full Code Here

        alpha[oi] = parameters[ci + (outcomePattern[oi] * monitor.getPredLabels().length)];
      }
      params[ci] = new Context(outcomePattern, alpha);
    }
    this.evalParams = new EvalParameters(params, monitor.getOutcomeLabels().length);
    this.prior = new UniformPrior();
    this.modelType = ModelType.MaxentQn;
   
    this.parameters = parameters;
  }
View Full Code Here

  }
 
  // FROM model reader
  public QNModel(String[] predNames, String[] outcomeNames, Context[] params, double[] parameters) {
   super(params, predNames, outcomeNames);
   this.prior = new UniformPrior();
   this.modelType = ModelType.MaxentQn;
  
   this.parameters = parameters;
  }
View Full Code Here

   * @param di The data indexer used to compress events in memory.
   * @return The newly trained model, which can be used immediately or saved
   *         to disk using an opennlp.maxent.io.GISModelWriter object.
   */
  public GISModel trainModel(int iterations, DataIndexer di, int cutoff) {
    return trainModel(iterations,di,new UniformPrior(),cutoff);
  }
View Full Code Here

TOP

Related Classes of opennlp.model.UniformPrior

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.