split_corpus: Preprocess a text corpus and divide it into training and...

View source: R/text_analysis.R

split_corpusR Documentation

Preprocess a text corpus and divide it into training and testing sets based on number of training items. Note: it is more efficient to preprocess and split separately, especially if running in a loop.

Description

Preprocess a text corpus and divide it into training and testing sets based on number of training items. Note: it is more efficient to preprocess and split separately, especially if running in a loop.

Usage

split_corpus(
  the_corpus,
  n_train,
  min_termfreq = 2,
  min_docfreq = 2,
  remove_punct = TRUE,
  remove_numbers = TRUE,
  remove_hyphens = TRUE,
  dfm_tfidf = FALSE,
  stem = TRUE
)

gidonc/durhamevp documentation built on April 8, 2022, 10:31 a.m.