bm_25: Okapi BM-25

Description Usage Arguments Examples

View source: R/features.R

Description

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.

Usage

1
2
3
4
5
6
7
bm_25(text)

## S3 method for class 'dtm'
bm_25(text)

## S3 method for class 'corpus'
bm_25(text)

Arguments

text

A document-term martrix or a corpus.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

## End(Not run)

news-r/textanalysis documentation built on Nov. 4, 2019, 9:40 p.m.