Executive Summary

#Data Exploration - Zipf’s law says that a small number of words appear very often. Most words appear only a few times.The frequency of the top 20 most frequent words is plotted in a bar chart.

Including Plots

The plot analysis in the report is documented for en_US.twitter.txt. The summary plots for blogs and news datasets is in the end of report as supporting plots.

## Warning: package 'tidytext' was built under R version 4.6.1
## Warning: package 'dplyr' was built under R version 4.6.1
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Warning: package 'stringr' was built under R version 4.6.1
## en_US.twitter.txt: lines 2360148
## # A tibble: 10 × 2
##    word         n
##    <chr>    <int>
##  1 love    106732
##  2 day      91748
##  3 rt       89601
##  4 time     76803
##  5 lol      70162
##  6 people   52047
##  7 happy    49009
##  8 follow   48108
##  9 tonight  44706
## 10 night    41180
## Warning: package 'ggplot2' was built under R version 4.6.1
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Preparing the data

Creation of N-Gram Tables

Prediction Model

Shiny App

Supporting Plots - Blogs data set

## en_US.twitter.txt: lines 899288
## # A tibble: 10 × 2
##    word       n
##    <chr>  <int>
##  1 time   90920
##  2 people 59575
##  3 day    52373
##  4 love   45230
##  5 life   41254
##  6 it’s   38660
##  7 world  29306
##  8 i’m    29192
##  9 don’t  28389
## 10 book   28153

Supporting Plots - News data set

## en_US.twitter.txt: lines 1010206
## # A tibble: 10 × 2
##    word        n
##    <chr>   <int>
##  1 time    57061
##  2 people  47664
##  3 city    37950
##  4 school  35498
##  5 game    34947
##  6 percent 34690
##  7 day     31901
##  8 million 30913
##  9 home    30602
## 10 county  30172