TextPsychic Word Prediction Application

Joshua Smith

John Hopkins Data Science Specialization on Coursera: Capstone Project

Introducing TextPsychic

TextPsychic is a word prediction application. The application operates simply, efficiently, and presents a comfortable and stimulating interface to the user.

TextPsychic will accept text from a user and then predict the next word. TextPsychic could be applied to devices with small or cumbersome keyboards to increase the usability of the device or existing software. Currently only one word is predicted, but with small code modifications, the algorithm can provide multiple predictions so the user can select from a list of predictions.

TextPsychic was designed as a Capstone Project for the John Hopkins Data Science Specialization on Coursera.

How it works: The Algorithm

The data were tokenized into uni-, bi-, tri- and quadgrams and placed into into frequency tables.

  1. Search for last three words of user's text in the first three words of the quadgrams. If a match is found, return the most frequent fourth word. If no match is found, continue to next step.
  2. Search for last two words of user's text in the first two words of the trigrams. If a match is found, return the most frequent third word. If no match is found, continue to next step.
  3. Search for last word of user's text in the first word of the bigrams. If a match is found, return the most frequent second word. If no match is found, continue to next step.
  4. If no matches are found, return top unigram.

How it works: The Algorithm

alt text

Instructions

alt text

TextPsychic is simple - once the application has loaded into the browser (this may take a few seconds), simply type some text into the white box on the left (shown here circled in red). Click 'Submit', and the algorithm will offer a prediction.

Note: make certain you are under the application tab by clicking 'TextPsychicPredictor'.