An open API service indexing awesome lists of open source software.

https://github.com/ariya/text-match

demo of text matching using BM25
https://github.com/ariya/text-match

bm25

Last synced: 1 day ago
JSON representation

demo of text matching using BM25

Awesome Lists containing this project

README

          

# Text Match

A simple demo of text matching using the [BM25 algorithm](https://en.wikipedia.org/wiki/Okapi_BM25).

Requirement: [Node.js](https://nodejs.org), [Deno](https://deno.com), or [Bun](https://bun.sh).

```bash
./text-match.js filename query
```

* `filename`: Path to the text file you want to search.
* `query`: Search query, enclosed in double quotes.

As an example, to find the most relevant lines in `solar-system.txt` related to "gas giants composition":

```bash
./text-match.js solar-system.txt "gas giants composition"
```

This will output the top 3 most similar lines from `solar-system.txt` based on the provided query.