Hawk
2016.01.24
This is a very simple application to list most possible prediction of next word of user input.
The application is hosted on shinyapps.io and its URL is: https://yourwanghao.shinyapps.io/wordPrediction2/
User only needs to input some english sentence in the text input box, and the most possible next word will automatically listed on the page.
The application is based on modern natural language processing technic by the CMU-Cambridge Statistical Language Modeling toolkit (http://svr-www.eng.cam.ac.uk/~prc14/toolkit.html)
For more technical information, please refer to http://svr-www.eng.cam.ac.uk/~prc14/eurospeech97.ps
Preload unigram, bigram, trigram table.
Read user input string, get the last 2-ngrams after normalize the input.
Search this 2-grams in the trigram table. If found, then return the highest possibility next word in the trigram table
If not found, then search the first word of the 2-grams in the bigram table. If found, then return the highest possibility next word in the trigram table
If still not found, then then return the highest possibility word in the unigram table