Next Word Prediction Model

Jeffrey Strickland
1/26/2022

alt text

1. Introduction - Why Build It?

This model incorporates machine learning about the contents of three types of text files, blogs, news, and tweets to build a lexicon for predicting the next word is a user entered phrase.

  • Similar to your text messaging app
  • Demonstrates implementing models in a Shiny app
  • Shows an ability to manipulate text data
  • Link to the App

2. Text and Plot Outputs

alt text

alt text

3. How it Works

  • Combines test from various sources
  • Removes symbols, common use words, punctuation
  • forms n-grams: words that occur together based on frequent use
    • bigrams (2 words)
    • trigrams (3 words)
    • quadgrams (4 words)
  • Learns the patterns to make predictions

4. How if Looks

alt text

5. Does it work?

The Gettysburg Address

alt text

Random Phrase

alt text