Shiny Text Prediction App

Ivy Woo
16 Feb, 2021

App's Function


Given some text input from the app user,
the Shiny app outputs prediction(s) of the next word following the text.

4-gram model :

The app reads the last 3 words (at most) of the input, and output the prediction(s) of the next word as the one(s) having the highest probability to appear after those 3 words.

In-/Output

Input

  • Select on the interface the number of predictions of the next word desired. (1-5 available, default is 4)
  • Type some text in the input box provided.
  • Make a blank space at the end of your text to indicate the completion of input.

Output

  • The \( n \) prediction(s) of the next word will be displayed, where \( n \in\{1,2,\ldots,5\} \) is chosen by the user.

Example

This is how it looks like:

Links


The app can be accessed at:
https://ivywoo.shinyapps.io/ShinyTextPrediction/

Detailed documentation can be found in this Github repo:
https://github.com/ivy-woo/TextPredictionApp


Thank you and have fun in playing with the app! :)