Simple word prediction application (Capstone Coursera Project)

George Fandeev

Simple word prediction app

Simple in use Words prediction.

Are you tired from

  • a lot of buttons, checkboxes and inputs?
  • low speed of app?
  • difficeult settings?
  • annoying colors?

Let's look my new product - minimalistic word prediction application.

Advantages

There are not extra fetures. Only input, predicted words, and button “About”.

It is so simple that it can be used by a child!

Screenshot

How does it work?

To be honest, not very good. But not very bad too. The basis of my application is dataset of English news, blogs and twitter posts. 1%-sample of this dataset was analysed and list of more popular 2-,3-,4- and 5-ngrams was created.

So, when you type phrase into input textbox the following actions are produced:

  1. Your phrase prepared for prediction (punctuations, digits and so on are deleted)
  2. If your phrase are longer than 4 words, it will be reduced. Only 4 lasrt words will take a part in prediction.
  3. App looks up for the longest n-gram for your phrase.
  4. Your phrase is reduced (the first word is deleted). App looks up for the second longest n-gram for your phrase. And so on. Until the 2-gram.
  5. We have a table of estimated next words. Correct this table with “stupid backoff” (you can read about it here) algorithm and show you the most credible words!

Example

I will show your an example :

require(ngram)
load("ngrams_data.RData", envir=.GlobalEnv)
phrase <- "I love<3" 
#phrase will be cleared of "<3"
#1 means number of predicted words
predictfun(phrase, 1)
[1] "you"

Unfortunatelly I have no more space to tell you about my application. Please invest in my project and I'll make it much better! Thank your for attention