Class DefaultTrainingProgressMonitor

java.lang.Object
opennlp.tools.monitoring.DefaultTrainingProgressMonitor
All Implemented Interfaces:
TrainingProgressMonitor

public class DefaultTrainingProgressMonitor extends Object implements TrainingProgressMonitor
The default implementation of TrainingProgressMonitor. This publishes model training progress to the chosen logging destination.
  • Constructor Details

    • DefaultTrainingProgressMonitor

      public DefaultTrainingProgressMonitor()
  • Method Details

    • finishedIteration

      public void finishedIteration(int iteration, int numberCorrectEvents, int totalEvents, TrainingMeasure measure, double measureValue)
      Captures the Iteration progress.
      Specified by:
      finishedIteration in interface TrainingProgressMonitor
      Parameters:
      iteration - The completed iteration number.
      numberCorrectEvents - Number of correctly predicted events in this iteration.
      totalEvents - Total count of events processed in this iteration.
      measure - TrainingMeasure.
      measureValue - measure value corresponding to the applicable TrainingMeasure.
    • finishedTraining

      public void finishedTraining(int iterations, StopCriteria<?> stopCriteria)
      Captures the training completion progress.
      Specified by:
      finishedTraining in interface TrainingProgressMonitor
      Parameters:
      iterations - Total number of iterations configured for the training.
      stopCriteria - StopCriteria for the training.
    • display

      public void display(boolean clear)
      Displays the training progress and optionally clears the recorded progress (to save memory). Callers of this method can invoke it periodically during training, to avoid holding too much progress related data in memory.
      Specified by:
      display in interface TrainingProgressMonitor
      Parameters:
      clear - Set to true to clear the recorded progress.
    • isTrainingFinished

      public boolean isTrainingFinished()
      Checks whether the training has finished.
      Specified by:
      isTrainingFinished in interface TrainingProgressMonitor
      Returns:
      true if the training has finished, false if the training is not yet completed.