Coursera Data Science Specialization Capstone Final Project

Predicting the Next Word from an Input Phrase

Vincent Kowalski
12 June 2017

Problem Statement and Project Objective

  • Problem: Given a string of words (i.e., a phrase), predict the next word that is most likely to come next. A solution to this problem would be useful in a vast array of applications such as:
    • type ahead for texting or typing apps
    • assistant apps for individuals with speech disabilities
    • educational applications
  • Objective: Using a provided training data set, train a model to predict the next word that would most likely come after a given input n-gram of words (the input phrase). Provide end-users a Shiny app that allows them to type in the input phrase, invokes the model and then presents the output predicted word.

Description of Algorithm

How To Use the Shiny App

The User Interface of the app that implements the word prediction algorith is very simple to operate. The user needs to simply follow the follow steps:

  1. Start the app by clicking on the link below
  2. Enter a sentence fragment into the text box that appears near the top of the screen
  3. Click on the Predict button that appears below the text box

The prediction will appear almost immediately below your input text

Click on the following link to launch the Shiny app: https://vkowalski.shinyapps.io/Capstone1/

Presentation Take-Aways

Given you know now that the app does indeed work and how it works, here are some important points to take with you:

  1. The algorithm and thus the app performs well - most results in a second or two
  2. The alogirhtm is accurate. Most results are what you would expect in “normal” speech
  3. The app is easy to operate and understand; the User Interface is intuitive
  4. The algorithm is fairly straight forward – more complex algorithms were considered and tried but resulted in almost no improvements