Package com. shubham0204. text_predictor
Types
Validates input using regular expressions It is used to report errors in the input provided to WordAutoCompletion.predict or NextWordPredictor.predict.
Next-word prediction system which internally uses a prebuilt Markov-model to predict the next-word given the current word. Markov models could modelled as directed-graphs where nodes are the words from the training corpus (huge text dataset) and edges represent dependencies. If a directed-edge goes from word A to word B, then its weight is the frequency of word B, given that word A precedes it in the corpus. Once the graph is built, the top-3 words that precede any word 'w' are stored in a hashmap, where the key is the word 'w' and the value is List<String>
that contains the top-3 words succeeding 'w'. These words are displayed to the user as suggestions. For more implementation details, see the rust
branch.
Common errors that are raised when an invalid input is received in WordAutoCompletion and WordAutoCompletion