Okapi BM25 (BM stands for Best Matching) is a ranking function used by search engines to estimate the relevance of documents to a given search query.

bm_25(text)

# S3 method for dtm
bm_25(text)

# S3 method for corpus
bm_25(text)

Arguments

text

A document-term martrix or a corpus.

Examples

# NOT RUN {
init_textanalysis()

# create corpus
doc <- string_document("A simple document.")
doc2 <- string_document("Another simple document.")
crps <- corpus(doc, doc2)

# matrix & plot
bm_25(crps)
# }