The final product is a Shiny app that predicts the next word while a person types (like a phone keyboard). It will be powered by a prediction algorithm trained on real English text from blogs, news articles and Twitter. This report shows that the data is loaded, summarises it, and outlines the plan.
| Source | Size_MB | Lines | Words | Longest_line_chars |
|---|---|---|---|---|
| blogs | 200.4 | 899,288 | 37,546,806 | 40,833 |
| news | 196.3 | 1,010,242 | 34,762,658 | 11,384 |
| 159.4 | 2,360,148 | 30,096,690 | 140 |
The three sources differ in style: Twitter lines are very short (140-character limit at collection time), blogs have the longest lines, and news sits in between.
The files are large, so exploration uses a random 1% sample from each source. Text is lower-cased, and non-English characters are removed.
| Coverage | Unique_words_needed |
|---|---|
| 50% | 155 |
| 90% | 7522 |
A small number of words covers most of everyday text, while a very long tail of rare words and misspellings adds little. The dictionary can be trimmed to keep the app small and fast.
Feedback is welcome on the sampling size, the back-off approach, and the app design.