lib/google_api/speech/v1/model/phrase_set.ex

# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Speech.V1.Model.PhraseSet do
  @moduledoc """
  Provides "hints" to the speech recognizer to favor specific words and phrases in the results.

  ## Attributes

  *   `boost` (*type:* `number()`, *default:* `nil`) - Hint Boost. Positive value will increase the probability that a specific phrase will be recognized over other similar sounding phrases. The higher the boost, the higher the chance of false positive recognition as well. Negative boost values would correspond to anti-biasing. Anti-biasing is not enabled, so negative boost will simply be ignored. Though `boost` can accept a wide range of positive values, most use cases are best served with values between 0 (exclusive) and 20. We recommend using a binary search approach to finding the optimal value for your use case. Speech recognition will skip PhraseSets with a boost value of 0.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The resource name of the phrase set.
  *   `phrases` (*type:* `list(GoogleApi.Speech.V1.Model.Phrase.t)`, *default:* `nil`) - A list of word and phrases.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :boost => number() | nil,
          :name => String.t() | nil,
          :phrases => list(GoogleApi.Speech.V1.Model.Phrase.t()) | nil
        }

  field(:boost)
  field(:name)
  field(:phrases, as: GoogleApi.Speech.V1.Model.Phrase, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Speech.V1.Model.PhraseSet do
  def decode(value, options) do
    GoogleApi.Speech.V1.Model.PhraseSet.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Speech.V1.Model.PhraseSet do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end