public class CRFTrainer
extends com.exalead.gni.GNIObject
Constructor and Description |
---|
CRFTrainer(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int |
CRFTrainer(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen,
int order)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int |
CRFTrainer(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen,
int order,
int mHess)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int |
CRFTrainer(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen,
int order,
int mHess,
double epsForConvergence)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int |
CRFTrainer(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen,
int order,
int mHess,
double epsForConvergence,
double sigmaSquare)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int |
CRFTrainer(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen,
int order,
int mHess,
double epsForConvergence,
double sigmaSquare,
int maxLinesearch)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int |
CRFTrainer(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen,
int order,
int mHess,
double epsForConvergence,
double sigmaSquare,
int maxLinesearch,
int nbThreads)
Create a new CRF Trainer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addSequence(java.lang.String text,
int lang,
java.lang.String[] labels)
Adds a training sequence for string text.
|
void |
dumpTrainBase(java.lang.String dumpFile)
Dump the training base to text.
|
protected void |
finalize() |
protected void |
init(java.lang.String modelDir,
MOTPipe pipe,
CRFCPGenerator cpGen,
int order,
int mHess,
double epsForConvergence,
double sigmaSquare,
int maxLinesearch,
int nbThreads) |
void |
train()
Launch training on current added sequences.
|
void |
train(int maxIter)
Launch training on current added sequences.
|
public CRFTrainer(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen, int order, int mHess, double epsForConvergence, double sigmaSquare, int maxLinesearch, int nbThreads)
modelDir
- the path to the directory which will contain our resource.pipe
- the MOTpipe used for tokenization and context predicate generation.cpGen
- the CRFCPGenerator.order
- the CRF order (only order 1 is supported for the moment).mHess
- number of correction to approximate the inverse hessian matrix.epsForConvergence
- convergence delta (if the difference of log likelihood between to iterations is smaller than this, stop)sigmaSquare
- penalty term for likelihood function.maxLinesearch
- maximum number of trials for the linesearch.nbThreads
- number of threads to use.public CRFTrainer(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen, int order, int mHess, double epsForConvergence, double sigmaSquare, int maxLinesearch)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int
public CRFTrainer(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen, int order, int mHess, double epsForConvergence, double sigmaSquare)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int
public CRFTrainer(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen, int order, int mHess, double epsForConvergence)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int
public CRFTrainer(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen, int order, int mHess)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int
public CRFTrainer(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen, int order)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int
public CRFTrainer(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen)
CRFTrainer(String, MOTPipe, CRFCPGenerator, int, int, double, double, int, int
public boolean addSequence(java.lang.String text, int lang, java.lang.String[] labels)
text
- the training textlang
- the languagelabels
- array of labels for each token in textpublic void train()
public void train(int maxIter)
maxIter
- the maximum number of iterations to perform.public void dumpTrainBase(java.lang.String dumpFile)
dumpFile
- filename to which we write.protected void init(java.lang.String modelDir, MOTPipe pipe, CRFCPGenerator cpGen, int order, int mHess, double epsForConvergence, double sigmaSquare, int maxLinesearch, int nbThreads)
protected void finalize()
finalize
in class java.lang.Object
Copyright © 2013 Dassault Systèmes, All Rights Reserved.