The Data Science Capstone project focuses on analysing a large collection of text data obtained from blogs, news articles, and Twitter. The main objective of this exploratory analysis is to understand the structure and characteristics of the data before developing a predictive text application.
This report presents basic summaries, exploratory statistics, visualizations, key findings, and a plan for developing a future prediction algorithm and Shiny application.
The dataset contains three English-language text files:
The files were downloaded from the Coursera SwiftKey dataset and
stored in the final/en_US folder.
The following table shows the total number of lines present in each dataset.
| Dataset | Lines | |
|---|---|---|
| Blogs | Blogs | 899288 |
| News | News | 1010206 |
| 2360148 |
The following table shows the estimated total number of words in each dataset.
| Dataset | Words | |
|---|---|---|
| Blogs | Blogs | 37546806 |
| News | News | 34761151 |
| 30096690 |
The following table shows the size of each dataset file.
| Dataset | Size_MB |
|---|---|
| Blogs | 200.42 |
| News | 196.28 |
| 159.36 |
The following analysis is based on a sample of 50,000 lines from each dataset.
| Dataset | Sample_Lines | Average_Line_Length |
|---|---|---|
| Blogs | 50000 | 228.66 |
| News | 50000 | 202.28 |
| 50000 | 68.52 |
The distribution of line lengths provides an initial understanding of the structure of the text data.
The exploratory analysis provides several useful observations about the datasets.
These observations will be useful when developing a predictive text model in the later stages of the project.
The final stage of the project will focus on developing a predictive text algorithm.
The model will analyse sequences of words and use them to predict the next likely word entered by a user. The cleaned text data will be used to create a suitable training dataset.
The planned steps include:
The model will be designed to balance prediction accuracy with computational efficiency.
A Shiny application will be developed to provide an interactive interface for the predictive text model.
Users will enter a phrase into the application, and the model will return possible next-word predictions.
The application will focus on simplicity, usability, and fast response time.
The exploratory analysis provided an initial understanding of the Blogs, News, and Twitter datasets. The data was summarized using line counts, word counts, file sizes, and sample-based statistics.
The visualizations also showed differences in text length across the three sources. These findings provide a useful foundation for further text preprocessing, predictive modeling, and development of the Shiny application.
The next stage will focus on building and evaluating the predictive text algorithm using the insights gained from this exploratory analysis.