dataset_imdb {textdata}R Documentation

IMDB Large Movie Review Dataset


The core dataset contains 50,000 reviews split evenly into 25k train and 25k test sets. The overall distribution of labels is balanced (25k pos and 25k neg).


  dir = NULL,
  split = c("train", "test"),
  delete = FALSE,
  return_path = FALSE,
  clean = FALSE,
  manual_download = FALSE



Character, path to directory where data will be stored. If NULL, user_cache_dir will be used to determine path.


Character. Return training ("train") data or testing ("test") data. Defaults to "train".


Logical, set TRUE to delete dataset.


Logical, set TRUE to return the path of the dataset.


Logical, set TRUE to remove intermediate files. This can greatly reduce the size. Defaults to FALSE.


Logical, set TRUE if you have manually downloaded the file and placed it in the folder designated by running this function with return_path = TRUE.


In the entire collection, no more than 30 reviews are allowed for any given movie because reviews for the same movie tend to have correlated ratings. Further, the train and test sets contain a disjoint set of movies, so no significant performance is obtained by memorizing movie-unique terms and their associated with observed labels. In the labeled train/test sets, a negative review has a score <= 4 out of 10, and a positive review has a score >= 7 out of 10. Thus reviews with more neutral ratings are not included in the train/test sets. In the unsupervised set, reviews of any rating are included and there are an even number of reviews > 5 and <= 5.

When using this dataset, please cite the ACL 2011 paper

author = {Maas, Andrew L. and Daly, Raymond E. and Pham, Peter T. and Huang, Dan and Ng, Andrew Y. and Potts, Christopher},
title = {Learning Word Vectors for Sentiment Analysis},
booktitle = {Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies},
month = {June},
year = {2011},
address = {Portland, Oregon, USA},
publisher = {Association for Computational Linguistics},
pages = {142–150},
url = {} }


A tibble with 25,000 rows and 2 variables:


Character, denoting the sentiment


Character, text of the review



## Not run: 

# Custom directory
dataset_imdb(dir = "data/")

# Deleting dataset
dataset_imdb(delete = TRUE)

# Returning filepath of data
dataset_imdb(return_path = TRUE)

# Access both training and testing dataset
train <- dataset_imdb(split = "train")
test <- dataset_imdb(split = "test")

## End(Not run)

[Package textdata version 0.4.4 Index]