Package opennlp.tools.langdetect
Klasse LanguageDetectorCrossValidator
java.lang.Object
opennlp.tools.langdetect.LanguageDetectorCrossValidator
Cross validator for
LanguageDetector.-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungLanguageDetectorCrossValidator(TrainingParameters mlParams, LanguageDetectorFactory factory, LanguageDetectorEvaluationMonitor... listeners) Initializes aLanguageDetectorCrossValidatorwith the givenparameters. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidevaluate(ObjectStream<LanguageSample> samples, int nFolds) Starts the evaluation.doublelong
-
Konstruktordetails
-
LanguageDetectorCrossValidator
public LanguageDetectorCrossValidator(TrainingParameters mlParams, LanguageDetectorFactory factory, LanguageDetectorEvaluationMonitor... listeners) Initializes aLanguageDetectorCrossValidatorwith the givenparameters.- Parameter:
mlParams- TheTrainingParametersfor the context of cross validation.factory- TheLanguageDetectorFactoryfor creating related objects.listeners- theevaluation listeners.
-
-
Methodendetails
-
evaluate
Starts the evaluation.- Parameter:
samples- TheObjectStreamofsamplesto train and test with.nFolds- Number of folds. It must be greater than zero.- Löst aus:
IOException- Thrown if IO errors occurred.
-
getDocumentAccuracy
public double getDocumentAccuracy()- Gibt zurück:
- Retrieves the word accuracy for all iterations.
-
getDocumentCount
public long getDocumentCount()- Gibt zurück:
- 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.
-