NishantShri4 commented on code in PR #758: URL: https://github.com/apache/opennlp/pull/758#discussion_r2012761368
########## opennlp-tools/src/main/java/opennlp/tools/monitoring/ConsoleTrainingProgressMonitor.java: ########## @@ -0,0 +1,51 @@ +package opennlp.tools.monitoring; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; + +import static opennlp.tools.monitoring.StopCriteria.TRAINING_FINISHED_DEFAULT_MSG; + +/** + * Publishes ML model's Training progress to console. + */ +public class ConsoleTrainingProgressMonitor implements TrainingProgressMonitor { + + private static final Logger logger = LoggerFactory.getLogger(ConsoleTrainingProgressMonitor.class); + + /** + * Keeps a track whether training was already finished because StopCriteria was met. + */ + volatile boolean isTrainingFinished; + + private final List<String> progress = new LinkedList<>(); Review Comment: Good point! Should we think about following? 1. Add an extractAndClear() method on TPM interface , which when invoked empties the underlying data-structure and returns the logged progress. The caller then decides what to do with the returned results? 2. finishedIteration() issues a warning when number of items logged reach a configured threshold e.g. 50k progress events logged. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@opennlp.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org