View source: R/string_to_fixed_dictionary_tf_idf_vector.R
string_to_fixed_dictionary_tf_idf_vector | R Documentation |
Calculates the TF-IDF vector for a string using a fixed dictionary
string_to_fixed_dictionary_tf_idf_vector(string, dictionary, num_docs)
string |
The string to process |
dictionary |
A vector of terms that will be used to calculate the TF-IDF |
num_docs |
The total number of documents in the text corpus |
A vector that contains the TF-IDF of each term in the dictionary for the input string
Erick Cuevas-Fernandez
string <- "This is a sentence"
dictionary <- c("sentence", "this", "is")
num_docs <- 10
string_to_fixed_dictionary_tf_idf_vector(string, dictionary, num_docs, stop_words)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.