Obscura.Recognizer.NER.ModelSpec (obscura v0.1.0)

Copy Markdown View Source

Normalized configuration for an optional local NER model.

Summary

Functions

Returns the Hugging Face identifier from a reference.

Returns a safe metadata map for telemetry and reports.

Builds a model spec from registry data.

Types

hf_ref()

@type hf_ref() :: {:hf, String.t()} | {:hf, String.t(), keyword()}

t()

@type t() :: %Obscura.Recognizer.NER.ModelSpec{
  aggregation: atom(),
  entities: [atom()],
  id: atom(),
  label_map: atom(),
  license: String.t(),
  model: hf_ref(),
  notes: String.t() | nil,
  offset_unit: :byte | :character,
  policy: keyword(),
  required?: boolean(),
  status: :supported | :experimental | :evaluation,
  task: :token_classification,
  tokenizer: hf_ref()
}

Functions

hf_id(arg)

@spec hf_id(hf_ref()) :: String.t()

Returns the Hugging Face identifier from a reference.

metadata(spec)

@spec metadata(t()) :: map()

Returns a safe metadata map for telemetry and reports.

new(attrs)

@spec new(map()) :: {:ok, t()} | {:error, term()}

Builds a model spec from registry data.