library(gensimr)

set.seed(42) # rerproducability

# sample data
data(corpus, package = "gensimr")

# preprocess corpus
docs <- preprocess(corpus)

BM25 Weights

get_bm25_weights(docs)