botiverse.preprocessors.TF_IDF package#
Submodules#
botiverse.preprocessors.TF_IDF.TF_IDF module#
- class botiverse.preprocessors.TF_IDF.TF_IDF.TF_IDF[source]#
Bases:
objectAn interface for transforming sentences into tf-idf vectors.
- transform_list(sentence_list, all_words)[source]#
Given a list of tokenized sentences, return a table of tf-idf vectors (one for each sentence) in the form of a numpy array.
- Parameters:
sentence_list (list) – A list of tokenized sentences
all_words (list) – A list of all the words in the corpus
- Returns:
A numpy array of tf-idf vectors
- Return type:
numpy.ndarray