Assignment

The goal of this project is to create a product that highlights the prediction algorithm built and provides an interface accessible by others.

Requirements:

  • A Shiny app that takes a phrase as input and predicts the next word.
  • A 5-slide deck created using R Presentation to explain the app and algorithm.

Overview:

  • The project creates an application that predicts the next word in a phrase using natural language processing (NLP).
  • It uses a sample of blog, news, and Twitter text to train a model.
  • The Shiny app takes user input and suggests the next word, based on n-gram frequencies.

Prediction Model

The model follows the “Backoff” strategy: - If a trigram match is found, use that prediction. - If no trigram, fallback to bigram. - If no bigram, fallback to the most common unigram.

Steps: 1. Load and clean sampled data. 2. Build unigram, bigram, and trigram frequency tables. 3. Use n-grams for next-word prediction in Shiny.

App Screenshot

App Link