Coursera Data Science Capstone

Next Word Prediction App (WHATSNEXT)

Charmaine Ang
Shiny app that accepts an n-gram and predicts the next word

1. Introduction

WHATSNEXT is a Shiny app designed to accept an n-gram English text and predicts the next word. This app used data provided by HC Corpora. These data are used to create a ngram frequency dictionary for the app to predict the next word (up to top 3 possibilities). Just like the crystal ball used by the fortune-teller, the dictionary will give the prediction as accurate as it can based on the given "facts"/ngram.

Predict Turkey Fate

2. How to use "WHATSNEXT" App

WHATSNEXT is designed with the focus of the needs of users: EASY, FAST, GOOD. [E]: Easy to use with a simple and intuitive user interface. [F] Fast in prediction and offers top 3 possibilities. [G] Good-natured app which does not predict/promote use of profanity.

Go ahead and have fun with WHATSNEXT!

WHATSNEXT APP

3. Insights of WHATSNEXT Prediction Model (Step 1)

Step 1: For WHATSNEXT to predict, it extracts last 3 words input by the users (and format with NA if users input less than 3 words), as depicted by the diagram below in 2 passes of predictions.

Extract 3 words

4. Insights of WHATSNEXT Prediction Model (Step 2)

Step 2: Next, WHATSNEXT offers its top 3 predictions by performing one or two passes of ngram match, as depicted by the digram below.

Extract 3 words