string_to_fixed_dictionary_tf_idf_vector: string_to_fixed_dictionary_tf_idf_vector

View source: R/string_to_fixed_dictionary_tf_idf_vector.R

string_to_fixed_dictionary_tf_idf_vectorR Documentation

string_to_fixed_dictionary_tf_idf_vector

Description

Calculates the TF-IDF vector for a string using a fixed dictionary

Usage

string_to_fixed_dictionary_tf_idf_vector(string, dictionary, num_docs)

Arguments

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

Value

A vector that contains the TF-IDF of each term in the dictionary for the input string

Author(s)

Erick Cuevas-Fernandez

Examples

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)


Erickcufe/textCells documentation built on May 20, 2023, 11:45 p.m.