Next-Word Prediction

Huichun Chien
April 28 2015

Predicting what's in your mind….

Are you.....?

  1. Are you a fan of “The Lord of the Rings”, and fascinated by the mind reader power platinir has?!
  2. Are you a Sci-tech geek, and dreaming about talking to a Turing Machine?!
  3. Are you too busy to finsih typing whole sentence most of time?!
  4. Or…..you are just a down-arrow lover when you type on keyboard?!

If so, YOU can give our product a try!

The goal and algorithm used in this app

The goal of this app is to build an interface that can predict next word for a given phrase.

To reach this goal, the algorithm used are descibed following...

  1. The training samples are randomly picked up 2% of text messages form given Twitter and news text files. The cleaning process of text samples is conducted to remove punctuation, numbers as well as restore abbreviation. Later, tokenization is conducted to retrieve the building block of n-gram prediction algorithms.
  2. There are ~63,000 unique word tokens including stop words are used in this predicted model.

Algorithm used in this app (Cont.)

3. The prediction model is designed to choose the closest phrase in a prediction data.table, which is made by a combination of 2-gram, 3-gram and 4-gram. The priority of data tables used for phrase prediction are 4-gram, 3-gram and 2-gram.

Interface and Instruction

3 items are included in the interface: Text input box, Predict button and Prediction output box.

Instruction:

  1. Type the desired phrase in the box name “Text input”.
  2. After finishing typing, click the “Predict” button.
  3. The next word predicted will be shown in the box named “ Next word prediction” written in lower case.

Play around and Have fun !