Next Word Prediction

Chris Nightingale
November 12th 2022

Next Word Prediction App - Overview

  • The Next Word Prediction App (NWPA) is a web application which predicts the next word from a user input string
  • The NWPA is a free web application available at https://chrisn267.shinyapps.io/word_predict_app
  • It is a simple user friendly app which provides powerful predictive capabilities
  • This presentation sets out a technical overview of the app as well as a user guide.

Next Word Prediction App - Technical Guide

  • The NWPA is a NLP machine learning application developed by Chris Nightingale as part of the John Hopkins Data Science Specialisation
  • The NWPA uses a simple n-gram back-off model to predict the next word in a string
  • The model is trained using 150,000 texts from US blogs, news articles and twitter feeds
  • The model uses 3-gram prediction and if this does not find a suitable match it resorts to 2-gram then 1-gram.

Next Word Prediction App - User Guide

  • The NWPA is available here https://chrisn267.shinyapps.io/word_predict_app
  • The app will take around 10 seconds to load when first opened, this is to bring the text corpus into memory
  • The user enters a text string into the text box provided and presses 'generate word' to predict the next word
  • The next word will appear in the output box alongside a chart which shows the top 5 predictions for the string
  • The user can enter as many strings as they wish repeatedly and the app will work each time the button is pressed.

Next Word Prediction App - Wrap Up

I hope you enjoy using the app. The code is available on my github page.