ExNlp.Ranking.Bm25Options (ex_nlp v0.1.0)

View Source

Configuration options for BM25 ranking algorithm.

Summary

Functions

Merges options, with new options taking precedence.

Creates BM25 options from keyword list.

Types

t()

@type t() :: %ExNlp.Ranking.Bm25Options{
  b: float(),
  k1: float(),
  processing: ExNlp.Ranking.ProcessingOptions.t()
}

Functions

merge(existing, opts)

@spec merge(
  t(),
  keyword()
) :: t()

Merges options, with new options taking precedence.

new(opts \\ [])

@spec new(keyword()) :: t()

Creates BM25 options from keyword list.

Processing options can be specified directly and will be merged.

Examples

# Simple usage
iex> opts = ExNlp.Ranking.Bm25Options.new(k1: 1.5, b: 0.8)
iex> opts.k1
1.5

# With processing options
iex> opts = ExNlp.Ranking.Bm25Options.new(
...>   k1: 1.5,
...>   stem: true,
...>   language: :french,
...>   remove_stopwords: true
...> )
iex> opts.processing.stem
true