/// <summary> /// Train a model using the GIS algorithm. /// </summary> /// <param name="eventStream"> /// The EventStream holding the data on which this model will be /// trained. </param> /// <param name="iterations"> /// The number of GIS iterations to perform. </param> /// <param name="cutoff"> /// The number of times a feature must be seen in order to be relevant /// for training. </param> /// <param name="smoothing"> /// Defines whether the created trainer will use smoothing while /// training the model. </param> /// <param name="printMessagesWhileTraining"> /// Determines whether training status messages are written to STDOUT. </param> /// <returns> The newly trained model, which can be used immediately or saved to /// disk using an opennlp.maxent.io.GISModelWriter object. </returns> public static GISModel trainModel(EventStream eventStream, int iterations, int cutoff, bool smoothing, bool printMessagesWhileTraining) { GISTrainer trainer = new GISTrainer(printMessagesWhileTraining); trainer.Smoothing = smoothing; trainer.SmoothingObservation = SMOOTHING_OBSERVATION; return(trainer.trainModel(eventStream, iterations, cutoff)); }
/// <summary> /// Train a model using the GIS algorithm. /// </summary> /// <param name="eventStream"> /// The EventStream holding the data on which this model will be /// trained. </param> /// <param name="iterations"> /// The number of GIS iterations to perform. </param> /// <param name="cutoff"> /// The number of times a feature must be seen in order to be relevant /// for training. </param> /// <param name="sigma"> /// The standard deviation for the gaussian smoother. </param> /// <returns> The newly trained model, which can be used immediately or saved to /// disk using an opennlp.maxent.io.GISModelWriter object. </returns> public static GISModel trainModel(EventStream eventStream, int iterations, int cutoff, double sigma) { GISTrainer trainer = new GISTrainer(PRINT_MESSAGES); if (sigma > 0) { trainer.GaussianSigma = sigma; } return(trainer.trainModel(eventStream, iterations, cutoff)); }
/// <summary> /// Train a model using the GIS algorithm. /// </summary> /// <param name="eventStream"> /// The EventStream holding the data on which this model will be /// trained. </param> /// <param name="iterations"> /// The number of GIS iterations to perform. </param> /// <param name="cutoff"> /// The number of times a feature must be seen in order to be relevant /// for training. </param> /// <returns> The newly trained model, which can be used immediately or saved to /// disk using an opennlp.maxent.io.GISModelWriter object. </returns> public static GISModel trainModel(EventStream eventStream, int iterations, int cutoff) { return(trainModel(eventStream, iterations, cutoff, false, PRINT_MESSAGES)); }
/// <summary> /// Train a model using the GIS algorithm, assuming 100 iterations and no /// cutoff. /// </summary> /// <param name="eventStream"> /// The EventStream holding the data on which this model will be /// trained. </param> /// <param name="smoothing"> /// Defines whether the created trainer will use smoothing while /// training the model. </param> /// <returns> The newly trained model, which can be used immediately or saved to /// disk using an opennlp.maxent.io.GISModelWriter object. </returns> public static GISModel trainModel(EventStream eventStream, bool smoothing) { return(trainModel(eventStream, 100, 0, smoothing, PRINT_MESSAGES)); }
/// <summary> /// Train a model using the GIS algorithm, assuming 100 iterations and no /// cutoff. /// </summary> /// <param name="eventStream"> /// The EventStream holding the data on which this model will be /// trained. </param> /// <returns> The newly trained model, which can be used immediately or saved to /// disk using an opennlp.maxent.io.GISModelWriter object. </returns> public static GISModel trainModel(EventStream eventStream) { return(trainModel(eventStream, 100, 0, false, PRINT_MESSAGES)); }