Package opennlp.tools.langdetect
Class LanguageDetectorCrossValidator
java.lang.Object
opennlp.tools.langdetect.LanguageDetectorCrossValidator
Cross validator for 
LanguageDetector.- 
Constructor SummaryConstructorsConstructorDescriptionLanguageDetectorCrossValidator(TrainingParameters mlParams, LanguageDetectorFactory factory, LanguageDetectorEvaluationMonitor... listeners) Initializes aLanguageDetectorCrossValidatorwith the givenparameters.
- 
Method SummaryModifier and TypeMethodDescriptionvoidevaluate(ObjectStream<LanguageSample> samples, int nFolds) Starts the evaluation.doublelong
- 
Constructor Details- 
LanguageDetectorCrossValidatorpublic LanguageDetectorCrossValidator(TrainingParameters mlParams, LanguageDetectorFactory factory, LanguageDetectorEvaluationMonitor... listeners) Initializes aLanguageDetectorCrossValidatorwith the givenparameters.- Parameters:
- mlParams- The- TrainingParametersfor the context of cross validation.
- factory- The- LanguageDetectorFactoryfor creating related objects.
- listeners- the- evaluation listeners.
 
 
- 
- 
Method Details- 
evaluateStarts the evaluation.- Parameters:
- samples- The- ObjectStreamof- samplesto train and test with.
- nFolds- Number of folds. It must be greater than zero.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
getDocumentAccuracypublic double getDocumentAccuracy()- Returns:
- Retrieves the word accuracy for all iterations.
 
- 
getDocumentCountpublic long getDocumentCount()- Returns:
- Retrieves the number of words which where validated over all iterations. The result is the amount of folds multiplied by the total number of words.
 
 
-