You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2017/04/20 10:41:03 UTC

[16/50] [abbrv] opennlp git commit: OPENNLP-980: Deprecate low-level feature constructors and methods

OPENNLP-980: Deprecate low-level feature constructors and methods


Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo
Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/38f9ac4e
Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/38f9ac4e
Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/38f9ac4e

Branch: refs/heads/parser_regression
Commit: 38f9ac4e4c172c1136f2b484af0eeb38fa3be991
Parents: 639b9cf
Author: J�rn Kottmann <jo...@apache.org>
Authored: Wed Feb 1 21:38:19 2017 +0100
Committer: J�rn Kottmann <jo...@apache.org>
Committed: Thu Apr 20 12:40:19 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/opennlp/tools/ml/maxent/GISModel.java     | 1 +
 .../java/opennlp/tools/ml/maxent/quasinewton/QNModel.java   | 1 +
 .../src/main/java/opennlp/tools/ml/model/AbstractModel.java | 9 +++++++++
 .../java/opennlp/tools/ml/naivebayes/NaiveBayesModel.java   | 2 ++
 .../java/opennlp/tools/ml/perceptron/PerceptronModel.java   | 5 +++++
 5 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/opennlp/blob/38f9ac4e/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/GISModel.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/GISModel.java b/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/GISModel.java
index e546d1c..14c7fa3 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/GISModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/GISModel.java
@@ -152,6 +152,7 @@ public final class GISModel extends AbstractModel {
    *         string representation of the outcomes can be obtained from the
    *         method getOutcome(int i).
    */
+  @Deprecated // visibility will be reduced in 1.8.1
   public static double[] eval(int[] context, float[] values, double[] prior,
       EvalParameters model) {
     Context[] params = model.getParams();

http://git-wip-us.apache.org/repos/asf/opennlp/blob/38f9ac4e/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNModel.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNModel.java b/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNModel.java
index a35d54c..f02ee75 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/quasinewton/QNModel.java
@@ -103,6 +103,7 @@ public class QNModel extends AbstractModel {
    *          Model parameters
    * @return Normalized probabilities for the outcomes given the context.
    */
+  @Deprecated // visibility will be reduced in 1.8.1
   public static double[] eval(int[] context, float[] values, double[] probs,
       int nOutcomes, int nPredLabels, double[] parameters) {
 

http://git-wip-us.apache.org/repos/asf/opennlp/blob/38f9ac4e/opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractModel.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractModel.java b/opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractModel.java
index e5a60a7..eb80f1b 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/model/AbstractModel.java
@@ -39,6 +39,15 @@ public abstract class AbstractModel implements MaxentModel {
   /** The type of the model. */
   protected ModelType modelType;
 
+  /**
+   * @deprecated this will be removed in 1.8.1, pmap should be private
+   *
+   * @param params
+   * @param predLabels
+   * @param pmap
+   * @param outcomeNames
+   */
+  @Deprecated
   public AbstractModel(Context[] params, String[] predLabels,
       Map<String, Integer> pmap, String[] outcomeNames) {
     this.pmap = pmap;

http://git-wip-us.apache.org/repos/asf/opennlp/blob/38f9ac4e/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/NaiveBayesModel.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/NaiveBayesModel.java b/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/NaiveBayesModel.java
index ec3d9bd..0a28704 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/NaiveBayesModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/NaiveBayesModel.java
@@ -31,6 +31,7 @@ public class NaiveBayesModel extends AbstractModel {
   protected double[] outcomeTotals;
   protected long vocabulary;
 
+  @Deprecated
   public NaiveBayesModel(Context[] params, String[] predLabels, Map<String, Integer> pmap,
                          String[] outcomeNames) {
     super(params, predLabels, pmap, outcomeNames);
@@ -87,6 +88,7 @@ public class NaiveBayesModel extends AbstractModel {
     return eval(context, null, prior, model, true);
   }
 
+  @Deprecated // visibility will be reduced in 1.8.1
   public static double[] eval(int[] context, float[] values, double[] prior,
                               EvalParameters model, boolean normalize) {
     Probabilities<Integer> probabilities = new LogProbabilities<>();

http://git-wip-us.apache.org/repos/asf/opennlp/blob/38f9ac4e/opennlp-tools/src/main/java/opennlp/tools/ml/perceptron/PerceptronModel.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/perceptron/PerceptronModel.java b/opennlp-tools/src/main/java/opennlp/tools/ml/perceptron/PerceptronModel.java
index 146da08..d66b553 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/perceptron/PerceptronModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/perceptron/PerceptronModel.java
@@ -25,6 +25,10 @@ import opennlp.tools.ml.model.EvalParameters;
 
 public class PerceptronModel extends AbstractModel {
 
+  /**
+   * @deprecated this will be removed in 1.8.1, pmap should be private
+   */
+  @Deprecated
   public PerceptronModel(Context[] params, String[] predLabels, Map<String, Integer> pmap,
                          String[] outcomeNames) {
     super(params,predLabels,pmap,outcomeNames);
@@ -62,6 +66,7 @@ public class PerceptronModel extends AbstractModel {
     return eval(context,null,prior,model,true);
   }
 
+  @Deprecated // visibility will be reduced in 1.8.1
   public static double[] eval(int[] context, float[] values, double[] prior, EvalParameters model,
                               boolean normalize) {
     Context[] params = model.getParams();