Class QNTrainer
- java.lang.Object
-
- opennlp.tools.ml.AbstractTrainer
-
- opennlp.tools.ml.AbstractEventTrainer
-
- opennlp.tools.ml.maxent.quasinewton.QNTrainer
-
- All Implemented Interfaces:
EventTrainer
public class QNTrainer extends AbstractEventTrainer
Maxent model trainer using L-BFGS algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description static double
L1COST_DEFAULT
static java.lang.String
L1COST_PARAM
static double
L2COST_DEFAULT
static java.lang.String
L2COST_PARAM
static int
M_DEFAULT
static java.lang.String
M_PARAM
static int
MAX_FCT_EVAL_DEFAULT
static java.lang.String
MAX_FCT_EVAL_PARAM
static java.lang.String
MAXENT_QN_VALUE
static int
THREADS_DEFAULT
static java.lang.String
THREADS_PARAM
-
Fields inherited from class opennlp.tools.ml.AbstractEventTrainer
DATA_INDEXER_ONE_PASS_REAL_VALUE, DATA_INDEXER_ONE_PASS_VALUE, DATA_INDEXER_PARAM, DATA_INDEXER_TWO_PASS_VALUE
-
Fields inherited from class opennlp.tools.ml.AbstractTrainer
ALGORITHM_PARAM, CUTOFF_DEFAULT, CUTOFF_PARAM, ITERATIONS_DEFAULT, ITERATIONS_PARAM, TRAINER_TYPE_PARAM, VERBOSE_DEFAULT, VERBOSE_PARAM
-
Fields inherited from interface opennlp.tools.ml.EventTrainer
EVENT_VALUE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AbstractModel
doTrain(DataIndexer indexer)
void
init(java.util.Map<java.lang.String,java.lang.String> trainParams, java.util.Map<java.lang.String,java.lang.String> reportMap)
Deprecated.void
init(TrainingParameters trainingParameters, java.util.Map<java.lang.String,java.lang.String> reportMap)
boolean
isSortAndMerge()
boolean
isValid()
Deprecated.QNModel
trainModel(int iterations, DataIndexer indexer)
void
validate()
Check parameters.-
Methods inherited from class opennlp.tools.ml.AbstractEventTrainer
getDataIndexer, train, train
-
Methods inherited from class opennlp.tools.ml.AbstractTrainer
getAlgorithm, getCutoff, getIterations
-
-
-
-
Field Detail
-
MAXENT_QN_VALUE
public static final java.lang.String MAXENT_QN_VALUE
- See Also:
- Constant Field Values
-
THREADS_PARAM
public static final java.lang.String THREADS_PARAM
- See Also:
- Constant Field Values
-
THREADS_DEFAULT
public static final int THREADS_DEFAULT
- See Also:
- Constant Field Values
-
L1COST_PARAM
public static final java.lang.String L1COST_PARAM
- See Also:
- Constant Field Values
-
L1COST_DEFAULT
public static final double L1COST_DEFAULT
- See Also:
- Constant Field Values
-
L2COST_PARAM
public static final java.lang.String L2COST_PARAM
- See Also:
- Constant Field Values
-
L2COST_DEFAULT
public static final double L2COST_DEFAULT
- See Also:
- Constant Field Values
-
M_PARAM
public static final java.lang.String M_PARAM
- See Also:
- Constant Field Values
-
M_DEFAULT
public static final int M_DEFAULT
- See Also:
- Constant Field Values
-
MAX_FCT_EVAL_PARAM
public static final java.lang.String MAX_FCT_EVAL_PARAM
- See Also:
- Constant Field Values
-
MAX_FCT_EVAL_DEFAULT
public static final int MAX_FCT_EVAL_DEFAULT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QNTrainer
public QNTrainer(TrainingParameters parameters)
-
QNTrainer
public QNTrainer(boolean printMessages)
-
QNTrainer
public QNTrainer(int m)
-
QNTrainer
public QNTrainer(int m, boolean verbose)
-
QNTrainer
public QNTrainer(int m, int maxFctEval, boolean printMessages)
-
QNTrainer
public QNTrainer()
-
-
Method Detail
-
init
public void init(TrainingParameters trainingParameters, java.util.Map<java.lang.String,java.lang.String> reportMap)
- Specified by:
init
in interfaceEventTrainer
- Overrides:
init
in classAbstractTrainer
-
init
@Deprecated public void init(java.util.Map<java.lang.String,java.lang.String> trainParams, java.util.Map<java.lang.String,java.lang.String> reportMap)
Deprecated.- Specified by:
init
in interfaceEventTrainer
- Overrides:
init
in classAbstractTrainer
-
validate
public void validate()
Description copied from class:AbstractTrainer
Check parameters. If subclass overrides this, it should call super.validate();- Overrides:
validate
in classAbstractEventTrainer
-
isValid
@Deprecated public boolean isValid()
Deprecated.- Overrides:
isValid
in classAbstractEventTrainer
- Returns:
-
isSortAndMerge
public boolean isSortAndMerge()
- Specified by:
isSortAndMerge
in classAbstractEventTrainer
-
doTrain
public AbstractModel doTrain(DataIndexer indexer) throws java.io.IOException
- Specified by:
doTrain
in classAbstractEventTrainer
- Throws:
java.io.IOException
-
trainModel
public QNModel trainModel(int iterations, DataIndexer indexer)
-
-