string_to_word_vector: string_to_word_vector

View source: R/string_to_word_vector.R

string_to_word_vectorR Documentation

string_to_word_vector

Description

Convert a string into a dictionary TF-IDF vector.

Usage

string_to_word_vector(string)

Arguments

string

A character string to be converted into a TF-IDF vector

Details

The function takes in a character string, removes punctuation and special characters, converts the string to lower case, splits the string into words, removes stop words, performs stemming using the Snowball Stemmer, creates a corpus of text, and calculates the TF-IDF (term frequency-inverse document frequency) values. The result is a matrix representing the TF-IDF vector for the input string.

Value

A matrix representing the TF-IDF vector for the input string

Examples

string_to_word_vector("The quick brown fox jumps over the lazy dog.")


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