keyman icon indicating copy to clipboard operation
keyman copied to clipboard

bug(android): predictions are not always giving useful results

Open mcdurdin opened this issue 3 years ago • 3 comments

Describe the bug

This may be a problem with web rather than android.

Starting at 0:44 in the attached video, is the most obvious example, although there may be others that are less obvious. I finish the word problen but am not offered any predictions. I delete the n and then am offered problem. Retyping either n or m again offers no predictions. On the following word, you can see how I type problen and am offered problem as a correction.

https://user-images.githubusercontent.com/4498365/180669638-5f7651da-15b8-43fe-94d0-2e3dc36120bf.mp4

To Reproduce

  1. Type rapidly. At some point, predictions will either not be offered, or will offer unhelpful options.

Expected behavior

Consistent suggestions, particularly e.g. if I have typed problem or problen, say, then problem, problems, problematic should really always be offered!


Keyman for iPhone/iPad/Android:

  • Device: Samsung A90 5G
  • OS: Android 12
  • Keyman version: 16.0.37-alpha-local-6984 (applied fix from #6984 so rapid typing works)

Keyboard

  • Keyboard name: sil_euro_latin
  • Keyboard version: 1.9.6
  • Language name: English
  • Model name: nrc_en_mtnt
  • Model version: 0.1.8

Additional context

mcdurdin avatar Jul 24 '22 23:07 mcdurdin

... I finish the word problen but am not offered any predictions.

I have seen this sort of thing happen at times. My first instinct is that my keystroke touchpoints were too consistently off-center, but it's possible something's there. (More on that "first instinct" comes later in this reply.) Checking this "instinct" and its relation to this issue in high detail would require logging and analyzing the fat-finger probability distributions involved.

... I delete the n and then am offered problem. Retyping either n or m again offers no predictions.

Yeah, the last part of that is definitely suspect. A backspace is supposed to eliminate the probability weighting data for previously-typed keys and set them as "known", so there's no reason that the follow-up keystroke should no longer offer "problem" as a suggestion in this scenario unless corrections are disabled.

On the following word, you can see how I type problen and am offered problem as a correction.

... which confirms you don't have corrections disabled, hence why I said "definitely suspect."

Consistent suggestions, particularly e.g. if I have typed problem or problen, say, then problem, problems, problematic should really always be offered!

If the keystrokes are reasonably and consistently placed. Keep in mind that we care about where on the key each key is pressed when determining suggestions; this affects the underlying probability weightings and can cause sequences of consistently off-center keystrokes to fall prey to internal 'thresholding' that helps keep predictive text reasonably performant. (The thresholding's designed to help it avoid wasting time on "rabbit trails" and keep it reasonably focused.)

jahorton avatar Jul 25 '22 01:07 jahorton

If the keystrokes are reasonably and consistently placed.

I dunno. I think it's reasonable for the end user to assume that having typed problem, they'll be offered problems, even if it is slightly fatfingered...

That is, while I can see scenarios where shorter words may offer a very common fat fingered alternative, but once we get to the 7 letters of problem, I really think that it is unlikely that a fat fingering option is going to have that much higher a probability than that valid word problem that the user has actually typed, to the point where problems is thresholded out of the picture? I hear ya but if our algorithm is dropping problems because it's outside the threshold, then that's not good.

mcdurdin avatar Aug 01 '22 00:08 mcdurdin

Upon investigating some of the instability noted with the predictive-text engine's unit tests, I think the most inconsistent one might actually be related to some aspects of this. So, a potential "two birds, one stone" mitigation/fix: #7037.

jahorton avatar Aug 04 '22 08:08 jahorton

Consistent suggestions, particularly e.g. if I have typed problem or problen, say, then problem, problems, problematic should really always be offered!

"problematic" is in the mtnt wordlist (frequency of 40). I tried the KeymanWeb prediction-ui test page on the master branch.

After typing "problema", the only two suggestions ever offered are "problems" or "problem".

darcywong00 avatar Aug 29 '22 02:08 darcywong00

This issue cannot be repro consistently on Android 11, Galaxy S9+, on both Keyman Alpha and Stable.

MakaraSok avatar Aug 31 '22 08:08 MakaraSok

This is adequately fixed in v17.0, as far as I can tell. @jahorton which PR resolves this?

mcdurdin avatar Feb 26 '24 03:02 mcdurdin

If I had to pick, I'd go with #10330. That gave us far better performance, which certainly helped to stabilize things.

jahorton avatar Feb 26 '24 06:02 jahorton

Fixed by #10330.

mcdurdin avatar Feb 26 '24 22:02 mcdurdin