Deepgram.Types.Read (Deepgram v0.1.0)

View Source

Types for the Read (Text Intelligence) service.

Summary

Types

analyze_options()

@type analyze_options() :: %{
  optional(:model) => String.t(),
  optional(:language) => String.t(),
  optional(:topics) => boolean(),
  optional(:intents) => boolean(),
  optional(:sentiment) => boolean(),
  optional(:summarize) => boolean() | String.t(),
  optional(:custom_intent) => [String.t()] | String.t(),
  optional(:custom_intent_mode) => String.t(),
  optional(:custom_topic) => [String.t()] | String.t(),
  optional(:custom_topic_mode) => String.t()
}

analyze_response()

@type analyze_response() :: %{metadata: metadata(), results: results()}

intent()

@type intent() :: %{intent: String.t(), confidence_score: float()}

intents()

@type intents() :: %{
  segments: [
    %{
      text: String.t(),
      start_word: integer(),
      end_word: integer(),
      intents: [intent()]
    }
  ],
  average: %{intent: String.t(), confidence_score: float()},
  info: intents_info()
}

intents_info()

@type intents_info() :: %{
  model_uuid: String.t(),
  input_tokens: integer(),
  output_tokens: integer()
}

metadata()

@type metadata() :: %{
  request_id: String.t(),
  created: String.t(),
  language: String.t(),
  model_uuid: String.t(),
  input_tokens: integer(),
  output_tokens: integer()
}

results()

@type results() :: %{
  intents: intents() | nil,
  sentiments: sentiments() | nil,
  topics: topics() | nil,
  summary: summary() | nil
}

sentiment()

@type sentiment() :: %{sentiment: String.t(), confidence_score: float()}

sentiment_info()

@type sentiment_info() :: %{
  model_uuid: String.t(),
  input_tokens: integer(),
  output_tokens: integer()
}

sentiments()

@type sentiments() :: %{
  segments: [
    %{
      text: String.t(),
      start_word: integer(),
      end_word: integer(),
      sentiments: [sentiment()]
    }
  ],
  average: %{sentiment: String.t(), confidence_score: float()},
  info: sentiment_info()
}

summary()

@type summary() :: %{
  summary: String.t(),
  short_summary: String.t(),
  info: summary_info()
}

summary_info()

@type summary_info() :: %{
  model_uuid: String.t(),
  input_tokens: integer(),
  output_tokens: integer()
}

text_source()

@type text_source() :: %{text: String.t()}

topic()

@type topic() :: %{topic: String.t(), confidence_score: float()}

topics()

@type topics() :: %{
  segments: [
    %{
      text: String.t(),
      start_word: integer(),
      end_word: integer(),
      topics: [topic()]
    }
  ],
  average: %{topics: [topic()]},
  info: topics_info()
}

topics_info()

@type topics_info() :: %{
  model_uuid: String.t(),
  input_tokens: integer(),
  output_tokens: integer()
}