Shiny Web Application Find the next Word

Jim Cichon
August 21, 2017

Introduction

The find the next word app was built using the shiny web application framework for R.

  • Uses a database of blogs, news, and twitter data to predict the higest probablility word to finish an incomplete sentence
  • App has a simple interface and is extremely efficient.

Description of Algorithm

Katz back-off model

  • Created dataframes for three, two and one consecutive word combinations
  • Model estimates conditional probability of a word based on its history in the word combinations
  • Model with best information about history of word provides the result

Trigram Model

Description of App

The app predicts the next most likely word based on an entered incomplete sentence.

  • Text box is provided to enter an incomplete sentence
  • Hitting submit button activates the program to process the sentence and run algorithm
  • Predicted word pops up in the box underneath the prediction tab
  • Documentation describing the app can be found under the documentation tab

Conclusion

Benefits of app:

  • Simple and efficient
  • Average response time less than two seconds
  • Works best when one or two words entered

Future improvements:

  • Greater number of consecutive word combinations (4 or 5) to improve predictions
  • More stylish interface