By using the English text data from 3 different sources: Blogs, Twitter & News were used in this project. The data were uploaded, summarized, preprocessed and tokenized using R-text mining packages such as quanteda,dt, dplyr, tm, ggplot2, ngram, tidytext and other packages that have not been mentioned.
The word prediction model was developed putting in the back of our mind ensuring optimizing accuracy and efficiency. In case there is no suggestion for the next word using 5-Grams the use of 4-Grams is the option or 3-grams,and 2-Grams. The model also calculates a second guess and a third guess respectively.
The developed Shiny app was launched in web Shinyapps.io.on 198Mg account. It’s used to predict words based on guess when a user enters words and displays the plots and data of n- grams as selected by the user.
##How Does the shiny App Work in the Next word prediction?
The user has to be aple to sign in to RPubs account and enter text to a given box and the predicted next word, 2nd guess and 3rd guess predictions are displayed. For example, if I entered the text Not the below prediction was generated. Enter Text: Not
Predicted Next Word: a
Second Guess: to
Third Guess: the ## N-Gram Plots in shinyapp The shinyapp also has the tab “N-GRAM PLOTS”, the user can select the n-gram to view from a drop down menu and the number of terms to display within the slider bar and thus displaying the graphs .