Package opennlp.tools.namefind
Class TokenNameFinderCrossValidator
- java.lang.Object
-
- opennlp.tools.namefind.TokenNameFinderCrossValidator
-
public class TokenNameFinderCrossValidator extends Object
Cross validator forTokenNameFinder.
-
-
Constructor Summary
Constructors Constructor Description TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String,Object> resources, TokenNameFinderEvaluationMonitor... listeners)Initializes aTokenNameFinderCrossValidatorwith the given parameters.TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters params, byte[] featureGeneratorBytes, Map<String,Object> resources, SequenceCodec<String> codec, TokenNameFinderEvaluationMonitor... listeners)Initializes aTokenNameFinderCrossValidatorwith the given parameters.TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters params, TokenNameFinderFactory factory, TokenNameFinderEvaluationMonitor... listeners)Initializes aTokenNameFinderCrossValidatorwith the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevaluate(ObjectStream<NameSample> samples, int nFolds)Starts the evaluation.FMeasuregetFMeasure()
-
-
-
Constructor Detail
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters params, byte[] featureGeneratorBytes, Map<String,Object> resources, SequenceCodec<String> codec, TokenNameFinderEvaluationMonitor... listeners)
Initializes aTokenNameFinderCrossValidatorwith the given parameters.- Parameters:
languageCode- The ISO conform language code.type-nullor an override type for all types in the training data.featureGeneratorBytes- Thebyte[]representing the feature generator descriptor.resources- Additional resources in a mapping.codec- TheSequenceCodecto use.params- TheTrainingParametersfor the context of cross validation.listeners- theevaluation listeners.
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters trainParams, byte[] featureGeneratorBytes, Map<String,Object> resources, TokenNameFinderEvaluationMonitor... listeners)
Initializes aTokenNameFinderCrossValidatorwith the given parameters.- Parameters:
languageCode- The ISO conform language code.type-nullor an override type for all types in the training data.featureGeneratorBytes- Thebyte[]representing the feature generator descriptor.resources- Additional resources in a mapping.listeners- theevaluation listeners.
-
TokenNameFinderCrossValidator
public TokenNameFinderCrossValidator(String languageCode, String type, TrainingParameters params, TokenNameFinderFactory factory, TokenNameFinderEvaluationMonitor... listeners)
Initializes aTokenNameFinderCrossValidatorwith the given parameters.- Parameters:
languageCode- The ISO conform language code.type-nullor an override type for all types in the training data.params- TheTrainingParametersfor the context of cross validation.factory- TheTokenNameFinderFactoryfor creating related objects.listeners- theevaluation listeners.
-
-
Method Detail
-
evaluate
public void evaluate(ObjectStream<NameSample> samples, int nFolds) throws IOException
Starts the evaluation.Note: The name samples need to be grouped on a document basis.
- Parameters:
samples- TheObjectStreamofsamplesto train and test with.nFolds- Number of folds. It must be greater than zero.- Throws:
IOException- Thrown if IO errors occurred.
-
getFMeasure
public FMeasure getFMeasure()
-
-