Compute term-frequency inverse-document-frequency.

tf_idf(dtm)

# S3 method for dtm
tf_idf(dtm)

# S3 method for JuliaObject
tf_idf(dtm)

Arguments

dtm

An object of class document_term_matrix as returned by document_term_matrix.

Examples

# NOT RUN {
init_textanalysis()

# build document
doc1 <- string_document("First document.")
doc2 <- string_document("Second document.")

corpus <- corpus(doc1, doc2)

update_lexicon(corpus)
m <- document_term_matrix(corpus)
tf_idf(m)
# }