You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by GitBox <gi...@apache.org> on 2022/12/23 12:29:10 UTC

[GitHub] [opennlp] mawiesne opened a new pull request, #469: OPENNLP-1423 Enhance JavaDoc in opennlp.tools.ml package

mawiesne opened a new pull request, #469:
URL: https://github.com/apache/opennlp/pull/469

   Change
   -
   - adds missing JavaDoc for `opennlp.tools.ml`
   - improves existing documentation for clarity
   - removes superfluous text
   - adds 'final' modifier where useful and applicable
   - adds 'Override' annotation where useful and applicable
   - adds `package-info.java` files for several sub-packages
   - simplifies several constructors, removing duplicate code
   - fixes several typos
   
   Tasks
   -
   Thank you for contributing to Apache OpenNLP.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [x] Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [x] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [x] Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder?
   - [ ] Have you written or updated unit tests to verify your changes?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
   - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder?
   - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder?
   
   ### For documentation related changes:
   - [x] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions for build issues and submit an update to your PR as soon as possible.
   


-- 
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-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp] rzo1 commented on a diff in pull request #469: OPENNLP-1423 Enhance JavaDoc in opennlp.tools.ml package

Posted by GitBox <gi...@apache.org>.
rzo1 commented on code in PR #469:
URL: https://github.com/apache/opennlp/pull/469#discussion_r1056619744


##########
opennlp-tools/src/main/java/opennlp/tools/commons/Trainer.java:
##########
@@ -17,8 +17,36 @@
 
 package opennlp.tools.commons;
 
+import java.util.Map;
+
+import opennlp.tools.ml.AbstractTrainer;
+import opennlp.tools.ml.EventModelSequenceTrainer;
+import opennlp.tools.util.TrainingParameters;
+
 /**
  * Represents a common base for training implementations.
  */
 public interface Trainer {
+
+  /**
+   * Initializes a {@link AbstractTrainer} via {@link TrainingParameters} and
+   * a {@link Map report map}.
+   *
+   * @param trainParams The {@link Map} that maps training parameters on a key-value basis.
+   * @param reportMap The {@link Map} instance used as report map.
+   *                  
+   * @deprecated Use {@link #init(TrainingParameters, Map)} instead.
+   */
+  @Deprecated
+  void init(Map<String, Object> trainParams, Map<String, String> reportMap);

Review Comment:
   If it is `@Deprecated` (as it was pulled up from some implementing classes), why should we keep it in the interface, i.e. shouldn't we just remove it here and migrate the remaining four usages to the other signature?
   
   We already broke binary compatibility, so imho it would be a good opportunity to get rid of it instead of keeping it in the interface. Wdyt, @mawiesne @jzonthemtn ?



##########
opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractDataIndexer.java:
##########
@@ -188,17 +233,15 @@ protected List<ComparableEvent> index(ObjectStream<Event> events,
     return eventsToCompare;
   }
 
-  public int getNumEvents() {
-    return numEvents;
-  }
-
   /**
-   * Updates the set of predicated and counter with the specified event contexts and cutoff.
+   * Updates the set of predicates and counter with the specified event contexts and cutoff.
+   *
    * @param ec The contexts/features which occur in a event.
    * @param predicateSet The set of predicates which will be used for model building.
    * @param counter The predicate counters.
    * @param cutoff The cutoff which determines whether a predicate is included.
-   * @deprecated will be removed after 1.8.1 release
+   *
+   * @deprecated Use {{@link #update(String[], Map)}}. This method will be removed after 1.8.1 release

Review Comment:
   "1.8.1" did happen a while ago? maybe time to remove? wdyt?



-- 
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-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp] mawiesne commented on pull request #469: OPENNLP-1423 Enhance JavaDoc in opennlp.tools.ml package

Posted by GitBox <gi...@apache.org>.
mawiesne commented on PR #469:
URL: https://github.com/apache/opennlp/pull/469#issuecomment-1363932733

   That's my Merry Xmas PR for 2022 🎄🌟


-- 
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-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp] mawiesne commented on a diff in pull request #469: OPENNLP-1423 Enhance JavaDoc in opennlp.tools.ml package

Posted by GitBox <gi...@apache.org>.
mawiesne commented on code in PR #469:
URL: https://github.com/apache/opennlp/pull/469#discussion_r1057168805


##########
opennlp-tools/src/main/java/opennlp/tools/commons/Trainer.java:
##########
@@ -17,8 +17,36 @@
 
 package opennlp.tools.commons;
 
+import java.util.Map;
+
+import opennlp.tools.ml.AbstractTrainer;
+import opennlp.tools.ml.EventModelSequenceTrainer;
+import opennlp.tools.util.TrainingParameters;
+
 /**
  * Represents a common base for training implementations.
  */
 public interface Trainer {
+
+  /**
+   * Initializes a {@link AbstractTrainer} via {@link TrainingParameters} and
+   * a {@link Map report map}.
+   *
+   * @param trainParams The {@link Map} that maps training parameters on a key-value basis.
+   * @param reportMap The {@link Map} instance used as report map.
+   *                  
+   * @deprecated Use {@link #init(TrainingParameters, Map)} instead.
+   */
+  @Deprecated
+  void init(Map<String, Object> trainParams, Map<String, String> reportMap);

Review Comment:
   Resolved with latest commit. The oldskool method now resides in `AbstractTrainer` not in the `Trainer` interface.



-- 
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-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp] mawiesne commented on a diff in pull request #469: OPENNLP-1423 Enhance JavaDoc in opennlp.tools.ml package

Posted by GitBox <gi...@apache.org>.
mawiesne commented on code in PR #469:
URL: https://github.com/apache/opennlp/pull/469#discussion_r1057159641


##########
opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractDataIndexer.java:
##########
@@ -188,17 +233,15 @@ protected List<ComparableEvent> index(ObjectStream<Event> events,
     return eventsToCompare;
   }
 
-  public int getNumEvents() {
-    return numEvents;
-  }
-
   /**
-   * Updates the set of predicated and counter with the specified event contexts and cutoff.
+   * Updates the set of predicates and counter with the specified event contexts and cutoff.
+   *
    * @param ec The contexts/features which occur in a event.
    * @param predicateSet The set of predicates which will be used for model building.
    * @param counter The predicate counters.
    * @param cutoff The cutoff which determines whether a predicate is included.
-   * @deprecated will be removed after 1.8.1 release
+   *
+   * @deprecated Use {{@link #update(String[], Map)}}. This method will be removed after 1.8.1 release

Review Comment:
   @rzo1 It seems worth documenting the removal on its own, for clarity in release notes. I'll open a separate Jira for this.



-- 
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-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp] mawiesne commented on a diff in pull request #469: OPENNLP-1423 Enhance JavaDoc in opennlp.tools.ml package

Posted by GitBox <gi...@apache.org>.
mawiesne commented on code in PR #469:
URL: https://github.com/apache/opennlp/pull/469#discussion_r1057162131


##########
opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractDataIndexer.java:
##########
@@ -188,17 +233,15 @@ protected List<ComparableEvent> index(ObjectStream<Event> events,
     return eventsToCompare;
   }
 
-  public int getNumEvents() {
-    return numEvents;
-  }
-
   /**
-   * Updates the set of predicated and counter with the specified event contexts and cutoff.
+   * Updates the set of predicates and counter with the specified event contexts and cutoff.
+   *
    * @param ec The contexts/features which occur in a event.
    * @param predicateSet The set of predicates which will be used for model building.
    * @param counter The predicate counters.
    * @param cutoff The cutoff which determines whether a predicate is included.
-   * @deprecated will be removed after 1.8.1 release
+   *
+   * @deprecated Use {{@link #update(String[], Map)}}. This method will be removed after 1.8.1 release

Review Comment:
   See [OPENNLP-1425](https://issues.apache.org/jira/browse/OPENNLP-1425).



-- 
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-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp] mawiesne merged pull request #469: OPENNLP-1423 Enhance JavaDoc in opennlp.tools.ml package

Posted by GitBox <gi...@apache.org>.
mawiesne merged PR #469:
URL: https://github.com/apache/opennlp/pull/469


-- 
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-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org