Reference documentation and code samples for the Cloud Speech-to-Text V2 API class Google::Cloud::Speech::V2::PhraseSet::Phrase.
A Phrase contains words and phrase "hints" so that the speech recognition
is more likely to recognize them. This can be used to improve the accuracy
for specific words and phrases, for example, if specific commands are
typically spoken by the user. This can also be used to add additional words
to the vocabulary of the recognizer.
List items can also include CustomClass references containing groups of
words that represent common concepts that occur in natural language.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#boost
defboost()->::Float
Returns
(::Float) — Hint Boost. Overrides the boost set at the phrase set level.
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 values will return an error. Boost values must
be between 0 and 20. Any values outside that range will return an error.
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.
#boost=
defboost=(value)->::Float
Parameter
value (::Float) — Hint Boost. Overrides the boost set at the phrase set level.
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 values will return an error. Boost values must
be between 0 and 20. Any values outside that range will return an error.
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.
Returns
(::Float) — Hint Boost. Overrides the boost set at the phrase set level.
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 values will return an error. Boost values must
be between 0 and 20. Any values outside that range will return an error.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Speech-to-Text V2 API - Class Google::Cloud::Speech::V2::PhraseSet::Phrase (v1.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.1 (latest)](/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [1.2.0](/ruby/docs/reference/google-cloud-speech-v2/1.2.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [1.1.0](/ruby/docs/reference/google-cloud-speech-v2/1.1.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [1.0.1](/ruby/docs/reference/google-cloud-speech-v2/1.0.1/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.16.0](/ruby/docs/reference/google-cloud-speech-v2/0.16.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.15.0](/ruby/docs/reference/google-cloud-speech-v2/0.15.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.14.0](/ruby/docs/reference/google-cloud-speech-v2/0.14.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.13.1](/ruby/docs/reference/google-cloud-speech-v2/0.13.1/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.12.0](/ruby/docs/reference/google-cloud-speech-v2/0.12.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.11.0](/ruby/docs/reference/google-cloud-speech-v2/0.11.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.10.0](/ruby/docs/reference/google-cloud-speech-v2/0.10.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.9.2](/ruby/docs/reference/google-cloud-speech-v2/0.9.2/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.8.0](/ruby/docs/reference/google-cloud-speech-v2/0.8.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.7.0](/ruby/docs/reference/google-cloud-speech-v2/0.7.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.6.0](/ruby/docs/reference/google-cloud-speech-v2/0.6.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.5.1](/ruby/docs/reference/google-cloud-speech-v2/0.5.1/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.4.0](/ruby/docs/reference/google-cloud-speech-v2/0.4.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.3.0](/ruby/docs/reference/google-cloud-speech-v2/0.3.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.2.0](/ruby/docs/reference/google-cloud-speech-v2/0.2.0/Google-Cloud-Speech-V2-PhraseSet-Phrase)\n- [0.1.0](/ruby/docs/reference/google-cloud-speech-v2/0.1.0/Google-Cloud-Speech-V2-PhraseSet-Phrase) \nReference documentation and code samples for the Cloud Speech-to-Text V2 API class Google::Cloud::Speech::V2::PhraseSet::Phrase.\n\nA Phrase contains words and phrase \"hints\" so that the speech recognition\nis more likely to recognize them. This can be used to improve the accuracy\nfor specific words and phrases, for example, if specific commands are\ntypically spoken by the user. This can also be used to add additional words\nto the vocabulary of the recognizer.\n\n\n\u003cbr /\u003e\n\nList items can also include CustomClass references containing groups of\nwords that represent common concepts that occur in natural language. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #boost\n\n def boost() -\u003e ::Float\n\n**Returns**\n\n- (::Float) --- Hint Boost. Overrides the boost set at the phrase set level. 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 values will return an error. Boost values must be between 0 and 20. Any values outside that range will return an error. 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.\n\n### #boost=\n\n def boost=(value) -\u003e ::Float\n\n**Parameter**\n\n- **value** (::Float) --- Hint Boost. Overrides the boost set at the phrase set level. 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 values will return an error. Boost values must be between 0 and 20. Any values outside that range will return an error. 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. \n**Returns**\n\n- (::Float) --- Hint Boost. Overrides the boost set at the phrase set level. 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 values will return an error. Boost values must be between 0 and 20. Any values outside that range will return an error. 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.\n\n### #value\n\n def value() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The phrase itself.\n\n### #value=\n\n def value=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The phrase itself. \n**Returns**\n\n- (::String) --- The phrase itself."]]