2/13/2018

Next Word App

This app allows users to predict the next word based on a phrase entered by the user. Try on your laptop, tablet, and/or smart phone.

Instructions

  • Go to the app
  • Type in phrase in the input box
  • Click "Predict Next Word"
  • See the predicted word
  • If you want to use this word, click "Use this Word"

The Algorithm

The algorithm uses a back-off model that estimates the probability of the predicted word given up to prior four words.

  • First, the data has to be loaded from a prepared file
  • The phrase entered by the user is trimmed and made lower case
  • If the phrase has more than four words, only takes the last four words
  • If the phrase matches an entry in the data file, returns the last word in the n-gram (the predicted word)
  • If the phrase does not match any entries in the data file, it runs the function again with the first word of the removed (backs off)
  • If the phrase is one word and no matches were found, return "the"

Taking it to the next level

Future plans include:

  • creating a suggested answer feature (which would add a proposed entry into the table)
  • correcting misspellings ("Did you mean?")
  • suggesting three answers at once
  • building the app in different languages (Russian, Finnish, and German)