Class LanguageDetectorME

All Implemented Interfaces:
Serializable, LanguageDetector

public class LanguageDetectorME extends Object implements LanguageDetector
Implements a learnable LanguageDetector.

This will process the entire string when called with predictLanguage(CharSequence) or predictLanguages(CharSequence).

If you want this to stop early, use probingPredictLanguages(CharSequence) or probingPredictLanguages(CharSequence, LanguageDetectorConfig). When run in probing mode, this starts at the beginning of the char sequence and runs language detection on chunks of text. If the end of the string is reached or there are LanguageDetectorConfig.getMinConsecImprovements() consecutive predictions for the best language and the confidence increases over those last predictions and if the difference in confidence between the highest confidence language and the second highest confidence language is greater than LanguageDetectorConfig.getMinDiff(), the language detector will stop and report the results.

The authors wish to thank Ken Krugler and Yalder} for the inspiration for many of the design components of this detector.

See Also: