This milestone report examines the three English-language SwiftKey files and outlines a practical next-word prediction prototype for a non-technical manager.

Data coverage

The corpus contains 4,269,678 lines across blogs, news, and Twitter. Word counts use a consistent alphabetic-token rule that allows apostrophes within words. The line-length distribution uses every line in each file, with newline characters excluded.

Source file Lines Words Median line length 75th percentile
Blogs 899,288 37,533,649 156 329
News 1,010,242 34,060,558 185 268
Twitter 2,360,148 29,749,975 64 100

Exploratory plot: line-length distribution

Percentages are calculated within each file; counts are shown for transparency.

Percent of lines by character-length range
Line length Blogs News Twitter
0-40 21.8 8.4 28.8
41-80 14.4 9.0 33.7
81-160 14.6 24.2 37.6
161-320 23.3 43.5 0.0
321+ 25.9 14.9 0.0

Twitter is concentrated in the shorter line-length bins, while news and blogs include substantial long-form content. This difference is relevant to the contexts available to a next-word model.

Prediction algorithm and Shiny application

A compact backoff n-gram model is a suitable prototype. It first searches for a frequent continuation given the longest available context, then backs off to shorter contexts when evidence is sparse. Evaluation should reserve a held-out sample, report top-1 accuracy and response latency, and provide a clear fallback when evidence is weak. A Shiny app can accept a short phrase and display one suggested next word with a concise fallback message.

Manager takeaway

The corpus has been summarized using consistent, reproducible rules. The next milestone is to validate predictive quality and speed on held-out text. The backoff approach is compact and explainable enough for an initial demonstration; its value should be judged against measured performance rather than assumed in advance.

Source: Coursera SwiftKey English corpus. Counts were calculated from the local source files using the project preparation script.