Search code examples
rtext2vec

In text2vec package in R, could not find function "create_vocab_corpus"


I was trying to understand the text2vec package from http://dsnotes.com/articles/text2vec but at the following step:

Now we can costruct DTM. Again, since all functions related to corpus construction have streaming API, we have to create iterator and provide it to create_vocab_corpus function:

it <- itoken(movie_review[['review']], preprocess_function = tolower,
             tokenizer = word_tokenizer, chunks_number = 10, progessbar = F)
corpus <- create_vocab_corpus(it, vocabulary = vocab)

This code throws an error:

Error: could not find function "create_vocab_corpus"


Solution

  • Please, see tutorial for latest version (0.3): https://cran.r-project.org/web/packages/text2vec/vignettes/text-vectorization.html . There were some API breaks in v 0.3.