ExNlp.Ranking.TfIdfOptions (ex_nlp v0.1.0)

View Source

Configuration options for TF-IDF calculation.

Summary

Functions

Creates TF-IDF options from keyword list.

Types

t()

@type t() :: %ExNlp.Ranking.TfIdfOptions{
  idf_variant: :standard | :bm25,
  normalize: :l2 | :l1 | nil,
  processing: ExNlp.Ranking.ProcessingOptions.t(),
  smooth_idf: boolean(),
  sublinear_tf: boolean(),
  tf_variant: :normalized | :raw
}

Functions

new(opts \\ [])

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

Creates TF-IDF options from keyword list.

Examples

iex> opts = ExNlp.Ranking.TfIdfOptions.new(
...>   smooth_idf: true,
...>   sublinear_tf: true,
...>   tf_variant: :raw
...> )
iex> opts.smooth_idf
true
iex> opts.tf_variant
:raw