opennlp-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [13/50] [abbrv] opennlp git commit: OPENNLP-984: Remove type parameter from POS Tagger Trainer cli
Date Thu, 20 Apr 2017 10:41:00 GMT
OPENNLP-984: Remove type parameter from POS Tagger Trainer cli


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

Branch: refs/heads/parser_regression
Commit: a1bb54b0e7aa93be11ce206678457e1cfa329027
Parents: 797c234
Author: Jörn Kottmann <joern@apache.org>
Authored: Sat Feb 11 00:20:45 2017 +0100
Committer: Jörn Kottmann <joern@apache.org>
Committed: Thu Apr 20 12:40:19 2017 +0200

----------------------------------------------------------------------
 .../cmdline/postag/POSTaggerTrainerTool.java    | 25 --------------------
 .../tools/cmdline/postag/TrainingParams.java    |  6 -----
 2 files changed, 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/opennlp/blob/a1bb54b0/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTrainerTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTrainerTool.java
b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTrainerTool.java
index 4a78602..1e6fb54 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTrainerTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTrainerTool.java
@@ -34,8 +34,6 @@ import opennlp.tools.postag.POSTaggerFactory;
 import opennlp.tools.postag.POSTaggerME;
 import opennlp.tools.postag.TagDictionary;
 import opennlp.tools.util.InvalidFormatException;
-import opennlp.tools.util.TrainingParameters;
-import opennlp.tools.util.model.ModelType;
 import opennlp.tools.util.model.ModelUtil;
 
 public final class POSTaggerTrainerTool
@@ -63,7 +61,6 @@ public final class POSTaggerTrainerTool
 
     if (mlParams == null) {
       mlParams = ModelUtil.createDefaultTrainingParameters();
-      mlParams.put(TrainingParameters.ALGORITHM_PARAM, getModelType(params.getType()).toString());
     }
 
     File modelOutFile = params.getModel();
@@ -142,26 +139,4 @@ public final class POSTaggerTrainerTool
 
     CmdLineUtil.writeModel("pos tagger", modelOutFile, model);
   }
-
-  static ModelType getModelType(String modelString) {
-    ModelType model;
-    if (modelString == null)
-      modelString = "maxent";
-
-    switch (modelString) {
-      case "maxent":
-        model = ModelType.MAXENT;
-        break;
-      case "perceptron":
-        model = ModelType.PERCEPTRON;
-        break;
-      case "perceptron_sequence":
-        model = ModelType.PERCEPTRON_SEQUENCE;
-        break;
-      default:
-        model = null;
-        break;
-    }
-    return model;
-  }
 }

http://git-wip-us.apache.org/repos/asf/opennlp/blob/a1bb54b0/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
index 221dcbe..690b359 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
@@ -29,12 +29,6 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
  * Note: Do not use this class, internal use only!
  */
 interface TrainingParams extends BasicTrainingParams {
-
-  @ParameterDescription(valueName = "maxent|perceptron|perceptron_sequence",
-      description = "The type of the token name finder model. One of maxent|perceptron|perceptron_sequence.")
-  @OptionalParameter(defaultValue = "maxent")
-  String getType();
-
   @ParameterDescription(valueName = "dictionaryPath", description = "The XML tag dictionary
file")
   @OptionalParameter
   File getDict();


Mime
View raw message