Predictive Text Input

Aden Guo
2015.4.20

How does it work?

It based on trained English language model

  • A lot of text is pre-processed by sentence detection, word detection, punctuation removal and many other useful methods.
  • The pre-processed text is train into a language model. In this app, I use 4-gram back-off model. This model means that if 4-gram is not available then 3-gram is checked then 2-gram then 1-gram.
  • The word is predicted basing on the conditional probability of input words from the language model trained.

Functions and Features

  • Next word prediction upto five choices! alt text
  • Auto words completion! Speed up the input!
  • All four gram prediction is mixed up to 5, that means that in the five words, some of them may be predicted by 4-gram, remaining are predicted by 3-gram.

Instructions of Use 1

alt text

1 Input area, you can input words in here and the size is adjustable(by little bottom-right triangle).

2 Predictions button, predictions of current input will be display on the buttons. Just click the button! Your choice will be pasted on the input area.

Instructions of Use 2

3 When you input a word without whitespace in the end. The predictions will only be some completions of the word. For example, if you input “I love y”, the prediction will be completions of last letter “y”. They may be “you”, “your” and etc..

4 When you complete a word by adding a whitespace in the end. The application will predict 5 words based upon your input. For example, if you input “I love you ”(the last character is a whitespace). The application will provide 5 predicted words on the button such as “so”, “too”, “guys” and etc.

Access it at https://adenguo.shinyapps.io/app-1/