airalcorn2 / LMIR

Pure Python implementations of the language models for information retrieval surveyed here: https://dl.acm.org/doi/10.1145/383952.384019.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LMIR

Pure Python implementations of the language models for information retrieval surveyed here.

import lmir

doc_1 = "This is document one.".split()
doc_2 = "This is document two. It contains different words.".split()
docs = [doc_1, doc_2]

models = lmir.LMIR(docs)

print(models.jelinek_mercer("This query has words that are found in the corpus.".split()))
print(models.jelinek_mercer("No matches.".split()))

About

Pure Python implementations of the language models for information retrieval surveyed here: https://dl.acm.org/doi/10.1145/383952.384019.

License:MIT License


Languages

Language:Python 100.0%