Classifier: fixed word count

This commit is contained in:
M66B 2021-01-08 18:30:00 +01:00
parent 42ee16aa71
commit 5c155e787e
1 changed files with 3 additions and 2 deletions

View File

@ -223,12 +223,13 @@ public class MessageClassifier {
Stat stat = state.classStats.get(clazz);
double chance = stat.totalFrequency / maxMessages / state.words.size();
int words = state.words.size() - 2;
double chance = stat.totalFrequency / maxMessages / words;
Chance c = new Chance(clazz, chance);
chances.add(c);
EntityLog.log(context, "Classifier " + c +
" frequency=" + (Math.round(stat.totalFrequency * 100.0) / 100.0) + "/" + maxMessages + " msgs" +
" matched=" + stat.matchedWords + "/" + state.words.size() + " words" +
" matched=" + stat.matchedWords + "/" + words + " words" +
" text=" + TextUtils.join(", ", stat.words));
}