Omni.Answer.Score (Omni v2.0.0)

Copy Markdown View Source

The answer to an Omni.Question.Score.

%Omni.Answer.Score{
  score: 1.4,
  probabilities: [{"Calm", 0.1}, {"Frustrated but civil", 0.4}, {"Very angry", 0.5}],
  confidence: 0.4
}

Struct fields

  • :score - the probability-weighted average of the level indices, the first level being 0. It can fall between levels
  • :probabilities - {key, probability} for every level, in the question's order and with its keys
  • :confidence - the provider's confidence, or nil when it gives none. Hosts compute it differently, so compare it only within one provider; the probabilities are the portable result

Summary

Types

t()

The answer to a score question.

Functions

Creates a score answer from a keyword list or map of fields.

Types

t()

@type t() :: %Omni.Answer.Score{
  confidence: float() | nil,
  probabilities: [{Omni.Question.key(), float()}],
  score: number()
}

The answer to a score question.

Functions

new(attrs)

@spec new(Enumerable.t()) :: t()

Creates a score answer from a keyword list or map of fields.