John Theodore
11/10/19
Predictive text algorithms have many applications…
The application presented today would simply aid someone in writing a sentence in an electronic device, offering a suggestive “next” word while typing.
To test the model's overall accuracy in predicting “next”“ words in a sentence, a series of 10 random sentences (8 words in length) were fed into the model. Additionally, three different models were used–each using a different amount of training data:
The following table compares the model results. "Accuracy” reflects the average percentage of words in each sentence that the model predicted accurately (e.g., Model 15K predicted an avg of 58% of words in all 10 sentences correctly). The run-time of each model was also collected using R's built-in “system.time” function.
user | system | elapsed | Accuracy | |
---|---|---|---|---|
Model 15K | 0.03 | 0 | 0.04 | 0.58 |
Model 30K | 0.05 | 0 | 0.06 | 0.61 |
Model 45k | 0.08 | 0 | 0.09 | 0.63 |
Once in the application, start typing a sentence in the text box and a list of predicted “next” words will appear to the right of the text box (in order of highest to lowest probability).
PLEASE NOTE: WORDS WILL APPEAR AFTER TYPING THE LAST LETTER OF EACH WORD–DO NOT HIT THE “SPACE BAR” ON YOUR KEY BOARD UNTIL THE LIST OF WORDS APPEAR, THEN GO ON TO TYPE THE NEXT WORD IN YOUR SENTENCE.