bm25

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 3 Imported by: 1

README

bm25 PkgGoDev Build Status Coverage Status

bm25 is a scoring function that helps with information retrieval

Documentation

Overview

package bm25 is a lingo-friendly BM25 library. BM25 is a scoring function that relies on TFIDF, and is useful for document retrieval

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocScore

type DocScore struct {
	ID    int
	Score float64
}

DocScore is a tuple of the document ID and a score

type DocScores

type DocScores []DocScore

DocScores is a list of DocScore

func BM25

func BM25(tf *tfidf.TFIDF, query tfidf.Document, docs []tfidf.Document, k1, b float64) DocScores

BM25 is the scoring function.

k1 should be between 1.2 and 2. b should be around 0.75

func (DocScores) Len

func (ds DocScores) Len() int

func (DocScores) Less

func (ds DocScores) Less(i, j int) bool

func (DocScores) Swap

func (ds DocScores) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL