Package opennlp.tools.monitoring
Class DefaultTrainingProgressMonitor
java.lang.Object
opennlp.tools.monitoring.DefaultTrainingProgressMonitor
- All Implemented Interfaces:
TrainingProgressMonitor
The default implementation of
TrainingProgressMonitor
.
This publishes model training progress to the chosen logging destination.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
display
(boolean clear) Displays the training progress and optionally clears the recorded progress (to save memory).void
finishedIteration
(int iteration, int numberCorrectEvents, int totalEvents, TrainingMeasure measure, double measureValue) Captures the Iteration progress.void
finishedTraining
(int iterations, StopCriteria<?> stopCriteria) Captures the training completion progress.boolean
Checks whether the training has finished.
-
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 interfaceTrainingProgressMonitor
- 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 applicableTrainingMeasure
.
-
finishedTraining
Captures the training completion progress.- Specified by:
finishedTraining
in interfaceTrainingProgressMonitor
- 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 interfaceTrainingProgressMonitor
- Parameters:
clear
- Set to true to clear the recorded progress.
-
isTrainingFinished
public boolean isTrainingFinished()Checks whether the training has finished.- Specified by:
isTrainingFinished
in interfaceTrainingProgressMonitor
- Returns:
true
if the training has finished,false
if the training is not yet completed.
-