Data Science Specialization, Swiftkey Capstone project: Next word prediction

Noelia Oses
March 21st, 2022

The need for next word prediction

  • Mobile use is increasing for activities such as email, social networking, banking and others.
  • Typing on mobile devices can be bothersome.
  • Smart keyboards make typing easier by using predictive text models.
  • See my Next word predcition app at shinyapps.io

User input

To use this app:

  • The user inputs a (unfinished) sentence in the text input box
  • and then presses the 'Submit' button.

Model and calculations

  • Next word prediction is based on n-gram language models.
  • Particularly, Katz's back-off model has been used to calculate the probability of unobserved n-grams: Katz back-off is a generative n-gram language model that estimates the conditional probability of a word given its history in the n-gram. It accomplishes this estimation by backing off through progressively shorter history models under certain conditions. By doing so, the model with the most reliable information about a given history is used to provide the better results.

Output

  • When the user types an unfinished sentence and presses the 'Submit' button the model presents three options for what the next word might be.
  • The three options are sorted by highest probability.