March 2017
Beginner to intermediate
1065 pages
27h 7m
English
Before we start, let's perform some preliminary steps by running the following code:
1 URL = "http://www.cs.cornell.edu/people/pabo/
2 movie-review-data/review_polarity.tar.gz"
3 download.file(URL,destfile = "reviews.tar.gz")
4 untar("reviews.tar.gz")This downloads the data you will use in a compressed file. Line 1 and 2 here should be typed on the same line in your console or script window with nospace between the quotation marks. Next, the file is uncompressed in a folder called txt_sentoken in your working directory. Change your working directory to point to this folder by using the following code line:
setwd("txt_sentoken")The folder contains the subfolders pos and neg. The pos folder contains 1,000 positive film reviews, ...
Read now
Unlock full access