17 September 2017

Introduction

This application tries to predict the next word that you are going to type.

How it Works

The application looks at groups of words (called ngrams) to find any that match with the text that has been typed. The longest groups of words are four words long. If there is a match between the last words of the text that has been typed and the first few words of the n-grams, the last word of the most common n-gram is displayed. If there is no match for with the quadgrams (n-grams that are four words long) then the application searches the trigrams (three words long) and if there are still no words, it searches the bigrams. If nothing is found you will see a message, "Sorry. I can't predict the last word."

Definitiions and Sources of Data

Using the Application

To start the application go to:

https://waterman3.shinyapps.io/shinyapp/

Once the application starts, type the text for which you want the next word predicted, in the box and push the Ready button.

To try again, push the reload button on the right of the toolbar at the top of the screen.

What Next?

This could be further developed to :

  • allow the user to type in the word they really wanted in the case that the word was not the right one so that the application would learn to give a better predicition.

  • make a better prediction, based on the context of what the user writes rather than on the last two or three words typed.