2024-12-13

Language Prediction Model Description

The Natural Language Prediction Model application predicts the next word from the input of a sentence or phrase using probabilities of two-word or three-word combinations determined from a large dataset provided by Swiftkey.

Language Prediction Model Flow

  • Model Input:
    • Enter a sentence or phrase into the text input box.
    • Press the “Predict Next Word” button.
    • The system captures the input.
  • Model Processing
    • The user’s text is passed to the model for processing.
    • The input is “cleaned” of extraneous words and split into words.
    • The prediction function is called using probabilities to determine the next word.
  • Model Output
    • The Input is displayed along with the most likely predicted next word.

Example Model Input & Output

  • The user enters the text then clicks the “Predict Next Word” button.

  • The text string is passed to the prediction function for a predicted next word.

Memory Management and Performance

  • A 20% random sample from the data set was taken and cleaned for a total of 538.2 MB
    • The percent can be adjusted based on memory capacity.
  • There is a hesitation for the first output for the application.
    • Additional output is returned in less than a second.
  • Application access from: https://bmerr.shinyapps.io/Prediction/