NishantShri4 commented on code in PR #758: URL: https://github.com/apache/opennlp/pull/758#discussion_r2041237249
########## 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: Thanks. Added a displayAndClear() method, which takes care of emptying the underlying data structure. -- 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