4/2/2024

Introduction to Prediction Algorithm

  • Goal: Apply a Shiny app to predict the next word of a phrase.

  • Prediction Algorithm: N-Gram Models

    • Principle: Estimate the conditional probability of a word to complete a given phrase of n words, and present the word with the highest conditional probability.

    • Methods: Construct (unigrams), bigrams, trigrams, and fourgrams to predict the next word.

About the APP

  • The Word Prediction APP will predict the next word of an incomplete phrase (multiple words).

  • Data: SwiftKey (blogs, news, twitter)

  • Instructions:

    • Step 1: Please open the Word Prediction APP.

    • Step 2: Type some words in the input box (e.g., “To be”).

    • Step 3: Click the “Submit” button.

    • Step 4: See the predicted next word below.

User Experience: Highlights

  • The Word Prediction APP

    • provides customers with a real-time prediction of the next word with the highest probability,

    • improves interactions with targeted consumers, and

    • promotes engagement and enjoyment of users.

Limitations and Future Works

  • Limitations:

    • The prediction algorithm processes a subsample that may not exactly reflect the whole situation.

    • The data sets are restricted to the blogs, news, and twitter (in English).

  • Future Works:

    • Extend the sample size, or

    • Apply different data (e.g., papers in top journals).