Class: Google::Apis::SpeechV1::PhraseSet

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/speech_v1/classes.rb,
lib/google/apis/speech_v1/representations.rb,
lib/google/apis/speech_v1/representations.rb
more...

Overview

Provides "hints" to the speech recognizer to favor specific words and phrases in the results.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PhraseSet

Returns a new instance of PhraseSet.

[View source]

528
529
530
# File 'lib/google/apis/speech_v1/classes.rb', line 528

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#boostFloat

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 as well as adding phrases both with and without boost to your requests. Corresponds to the JSON property boost

Returns:

  • (Float)

516
517
518
# File 'lib/google/apis/speech_v1/classes.rb', line 516

def boost
  @boost
end

#nameString

The resource name of the phrase set. Corresponds to the JSON property name

Returns:

  • (String)

521
522
523
# File 'lib/google/apis/speech_v1/classes.rb', line 521

def name
  @name
end

#phrasesArray<Google::Apis::SpeechV1::Phrase>

A list of word and phrases. Corresponds to the JSON property phrases

Returns:


526
527
528
# File 'lib/google/apis/speech_v1/classes.rb', line 526

def phrases
  @phrases
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object

[View source]

533
534
535
536
537
# File 'lib/google/apis/speech_v1/classes.rb', line 533

def update!(**args)
  @boost = args[:boost] if args.key?(:boost)
  @name = args[:name] if args.key?(:name)
  @phrases = args[:phrases] if args.key?(:phrases)
end