This report presents the initial exploratory analysis of the US
English text dataset (en_US) for the predictive text
capstone project. It covers data loading, basic file and word summaries,
key text patterns, and the plan for the prediction algorithm and Shiny
web application.
The dataset contains three text sources: blogs, news, and Twitter. The table below summarizes file sizes, line counts, word counts, and average line lengths.
| Source | File_Size_MB | Line_Count | Word_Count | Avg_Words_Per_Line | Max_Words_Per_Line |
|---|---|---|---|---|---|
| Blogs | 200.42 | 899,288 | 37,546,806 | 41.8 | 6,726 |
| News | 196.28 | 1,010,242 | 34,762,658 | 34.4 | 1,796 |
| 159.36 | 2,360,148 | 30,096,690 | 12.8 | 47 |
To inspect common word and phrase patterns without requiring external C++ dependencies, a 2% random sample from each file was combined, normalized to lowercase, stripped of URLs, punctuation, and digits, and tokenized into unigrams (1-word), bigrams (2-word), and trigrams (3-word).
| Rank | Unigram | Bigram | Trigram |
|---|---|---|---|
| 1 | the (95,460) | of the (8,516) | one of the (640) |
| 2 | to (55,275) | in the (8,278) | a lot of (618) |
| 3 | a (48,518) | to the (4,363) | thanks for the (498) |
| 4 | and (48,079) | for the (3,992) | to be a (365) |
| 5 | of (40,311) | on the (3,914) | going to be (347) |
| 6 | i (34,944) | to be (3,337) | i want to (327) |
| 7 | in (33,289) | at the (2,887) | out of the (311) |
| 8 | for (22,114) | and the (2,553) | as well as (288) |
| 9 | is (21,434) | in a (2,404) | it was a (285) |
| 10 | that (20,920) | with the (2,121) | some of the (278) |