Add correction confidence threshold

This commit is contained in:
Aleksandras Kostarevas 2024-01-27 20:09:13 +02:00
parent abc5a74004
commit 1d4b07566c

View File

@ -194,6 +194,11 @@ public class LanguageModel {
}
}
// Threshold if the model is confident enough
if(outProbabilities[0] <= 7.0f * outProbabilities[1]) {
mustNotAutocorrect = true;
}
if(!partialWord.isEmpty() && !mustNotAutocorrect) {
kind = SuggestedWords.SuggestedWordInfo.KIND_WHITELIST | SuggestedWords.SuggestedWordInfo.KIND_FLAG_APPROPRIATE_FOR_AUTO_CORRECTION;
}