March 16, 2019

Introduction

The purpose of this presentation is to describe my text prediction algorithm and application for the Data Science capstone project.

Over the next few slides I will cover the basic information of the model and application. Specifically, the next three slides will cover the following:

  • Data
  • Model
  • Application Overview

Data

The data used for this project was downloaded from the following link:

https://d396qusza40orc.cloudfront.net/dsscapstone/dataset/Coursera-SwiftKey.zip

This data contains text from multiple sources (news, blog, and twitter data). The data was loaded into R and randomly subsetted into a more manageable dataset before being converted into a corpus for analysis. The corpus was then scraped into n-grams (phrases of n words) in order to build the predictive model.

Model

The predictive model I have used in my analysis is a Stupid Backoff model of 1, 2, 3, and 4-grams, with an alpha level set to 0.4 (a commonly accepted level).

In the Stupid Backoff method, the algorithm will first look to see if a prediction can be made based on the first three words. If not, the algorithm will continue to move down level by level until a prediction can be made.

Application

The Shiny application was created with simplicity as the goal. The user only needs to enter a word or phrase and then press the button, after which the top three predicted words will be produced. A screenshot of the interface is shown below.