Word Predictor

Devashish Sharma
23-Mar-2017

Objective

The primary objective is to create an app that takes a word/phrase as input from a user and predicts the next word based on a prediction algorithm.

All text mining and natural language processing was done using R packages.

Overview of the Approach

  1. A sample of set of data files which have blogs, news and tweets is used as the base data set to build N-grams (sequence of words that occur together)
  2. Thereafter the files are cleaned by removing special characters, numbers, extra white spaces and profanity.
  3. The data is then converted into bigrams (sequence of 2 words), trigrams and fourgrams.
  4. A prediction model is then created to predict the next word based on the N-grams.
  5. Finally a Shiny app is created which takes input from the end user and provides the prediction based on the model.

Using the Word Predictor App

  • Step 1: Enter the phrase for which you want a prediction.
  • Step 2: Then click submit button.
  • Step 3: Predicted word will appear on the right side under the heading “Next word prediction” Link to the app -

Word Prediction App

Thank You!