NishantShri4 commented on code in PR #758:
URL: https://github.com/apache/opennlp/pull/758#discussion_r2056729011


##########
opennlp-tools/src/main/java/opennlp/tools/commons/Trainer.java:
##########
@@ -35,4 +36,14 @@ public interface Trainer {
    */
   void init(TrainingParameters trainParams, Map<String, String> reportMap);
 
+  /**
+   * Conducts the initialization of a {@link Trainer} via
+   * {@link TrainingParameters}, {@link Map report map} and {@link 
TrainingConfiguration}
+   *
+   * @param trainParams The {@link TrainingParameters} to use.
+   * @param reportMap The {@link Map} instance used as report map.
+   * @param config The {@link TrainingConfiguration} to use.

Review Comment:
   Hello. Training configuration is allowed to be null. This allows handling 
following scenarios.
   
   ii) Training models via command line. In this case there isn't any offering 
currently to provide the TrainingConfiguration via command line. 
   
   ii) Trainers are instantiated without using TrainerFactory. This happens in 
some tests e.g. PerceptronPrepAttachTest.testPerceptronOnPrepAttachData(...).
   
   In both of the above scenarios, if TrainingConfiguration is not provided, 
the implementation provides default values for it (i.e. by constituting it 
using DefaultTrainingProgressMonitor and the default stop criteria (identified 
based on the trainer)).
   
   I have updated the javadoc like below to reflect this.
   
    `   @param config      The {@link TrainingConfiguration} to use. If null, 
suitable defaults will be used.`
   



-- 
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

Reply via email to