add_tf_idf() adds measurements including term frequency by document and "tf-idf" measurements for weighing relative importance in comparison to other documents in a set.
Value
The original data frame with additional columns added for n, (the number of times a term was used in this document), tf (term's frequency in this document), idf (inverse document frequency), and tf_idf (previous two columns combined).
See also
Other tf_idf helpers:
summarize_tf_idf()
Examples
if (FALSE) { # \dontrun{
dubliners <- get_gutenberg_corpus(2814) |>
load_texts() |>
identify_by(part) |>
standardize_titles()
dubliners |>
add_tf_idf()
} # }
