TeamGleason / SpeakFaster

MIT License
6 stars 4 forks source link

[WebUI] Add local trie store for user text history to augment next-word prediction #351

Open caisq opened 2 years ago

caisq commented 2 years ago

The WebUI currently queries the server-side neural LM for next-word prediction (NWP) as well as word completion. Hence the results don't depend on user's text history and hence doesn't reflect it. Typical keyboards has this memory, which facilitates repeated writing of a sentence that has been written before (or a prefix of it).

This FR is about implementing a trie data structure, which is serialized to browser local storage. It can be loaded on each app start. The probabilities from the trie can be combined with the probabilities from the neural LM's NWP according to a certain heuristics.