Skip to contents

This function creates an instance of the ClassTfidfTransformer from the bertopic.vectorizers module, with the provided arguments. It is used to generate representations for topics by selecting words which are frequent within a topic and less frequent in the entire corpus.

Usage

bt_make_ctfidf(reduce_frequent_words = TRUE, bm25_weighting = FALSE)

Arguments

reduce_frequent_words

should frequent words be reduced? Default is TRUE.

bm25_weighting

should BM25 weighting be used? Default is FALSE.

Value

A ctfidf model (Python object).

Examples

ctfidf <- bt_make_ctfidf(reduce_frequent_words = TRUE, bm25_weighting = FALSE)