preprocess_sgrams: Preprocess a text corpus including the creation of n-grams...

View source: R/firststage_functions.R

preprocess_sgramsR Documentation

Preprocess a text corpus including the creation of n-grams for specific words and return a document feature matrix (wrapper round quanteda functions).

Description

Preprocess a text corpus including the creation of n-grams for specific words and return a document feature matrix (wrapper round quanteda functions).

Usage

preprocess_sgrams(
  the_corpus,
  wseq,
  stem = TRUE,
  min_termfreq = 2,
  min_docfreq = 2,
  max_termfreq = NULL,
  max_docfreq = NULL,
  remove_punct = TRUE,
  remove_numbers = TRUE,
  remove_hyphens = TRUE,
  termfreq_type = "count",
  docfreq_type = "count",
  dfm_tfidf = FALSE
)

Arguments

the_corpus

The text corpus to be pre-processed.

wseq

Pre-specified word sequence as list on which n-grams idenfied and added to the dfm

stem

default TRUE

min_termfreq

default 2

min_docfreq

default 2

max_termfreq

default NULL

max_docfreq

default NULL

remove_punct

default TRUE

remove_numbers

default TRUE

remove_hyphens

default TRUE

termfreq_type

default "count"

docfreq_type

default "count"

dfm_tfidf

default FALSE


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