create_tfidf: Create a fitted tf-idf

Description Usage Arguments Value

View source: R/create-tfidf.R

Description

The text2vec package uses a Pythonic style of code to create a fitted term frequency - inverse document frequency (tf-idf) object. A new tfidf object is initialised and then the tfidf$fit_transform method is applied to an unweighted document-term matrix. This style of code is unusual in R and can cause issues with drake. This function creates a fitted tfidf object with a more functional and R-idiomatic style of code.

Usage

1
create_tfidf(dtm_unweighted)

Arguments

dtm_unweighted

An unweighted document term matrix created by the map_to_dtm function, or an equivalent from text2vec.

Value

A fitted tfidf objet created by the text2vec package


mdneuzerling/DrakeModelling documentation built on June 26, 2020, 1:25 p.m.