Reference documentation and code samples for the Cloud Speech-to-Text V1 API class Google::Cloud::Speech::V1::PhraseSet::Phrase.
A phrases containing 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. See
usage limits.
List items can also include pre-built or custom classes containing groups
of words that represent common concepts that occur in natural language. For
example, rather than providing a phrase hint for every month of the
year (e.g. "i was born in january", "i was born in febuary", ...), use the
pre-built $MONTH class improves the likelihood of correctly transcribing
audio that includes months (e.g. "i was born in $month").
To refer to pre-built classes, use the class' symbol prepended with $
e.g. $MONTH. To refer to custom classes that were defined inline in the
request, set the class's custom_class_id to a string unique to all class
resources and inline classes. Then use the class' id wrapped in ${...}
e.g. "${my-months}". To refer to custom classes resources, use the class'
id wrapped in ${} (e.g. ${my-months}).
Speech-to-Text supports three locations: global, us (US North America),
and eu (Europe). If you are calling the speech.googleapis.com
endpoint, use the global location. To specify a region, use a
regional endpoint
with matching us or eu location value.
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 will simply be ignored. Though boost can accept a wide range of
positive values, most use cases are best served
with values between 0 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.
#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 will simply be ignored. Though boost can accept a wide range of
positive values, most use cases are best served
with values between 0 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.
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 will simply be ignored. Though boost can accept a wide range of
positive values, most use cases are best served
with values between 0 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.
[[["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-08-28 UTC."],[],[],null,["# Cloud Speech-to-Text V1 API - Class Google::Cloud::Speech::V1::PhraseSet::Phrase (v1.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.0 (latest)](/ruby/docs/reference/google-cloud-speech-v1/latest/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [1.2.1](/ruby/docs/reference/google-cloud-speech-v1/1.2.1/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [1.1.0](/ruby/docs/reference/google-cloud-speech-v1/1.1.0/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [1.0.1](/ruby/docs/reference/google-cloud-speech-v1/1.0.1/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.17.0](/ruby/docs/reference/google-cloud-speech-v1/0.17.0/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.16.2](/ruby/docs/reference/google-cloud-speech-v1/0.16.2/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.15.0](/ruby/docs/reference/google-cloud-speech-v1/0.15.0/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.14.0](/ruby/docs/reference/google-cloud-speech-v1/0.14.0/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.13.1](/ruby/docs/reference/google-cloud-speech-v1/0.13.1/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.12.1](/ruby/docs/reference/google-cloud-speech-v1/0.12.1/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.11.0](/ruby/docs/reference/google-cloud-speech-v1/0.11.0/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.10.2](/ruby/docs/reference/google-cloud-speech-v1/0.10.2/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.9.0](/ruby/docs/reference/google-cloud-speech-v1/0.9.0/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.8.0](/ruby/docs/reference/google-cloud-speech-v1/0.8.0/Google-Cloud-Speech-V1-PhraseSet-Phrase)\n- [0.7.3](/ruby/docs/reference/google-cloud-speech-v1/0.7.3/Google-Cloud-Speech-V1-PhraseSet-Phrase) \nReference documentation and code samples for the Cloud Speech-to-Text V1 API class Google::Cloud::Speech::V1::PhraseSet::Phrase.\n\nA phrases containing words and phrase \"hints\" so that\nthe speech recognition is more likely to recognize them. This can be used\nto improve the accuracy for specific words and phrases, for example, if\nspecific commands are typically spoken by the user. This can also be used\nto add additional words to the vocabulary of the recognizer. See\n[usage limits](https://cloud.google.com/speech-to-text/quotas#content).\n\n\nList items can also include pre-built or custom classes containing groups\nof words that represent common concepts that occur in natural language. For\nexample, rather than providing a phrase hint for every month of the\nyear (e.g. \"i was born in january\", \"i was born in febuary\", ...), use the\npre-built `$MONTH` class improves the likelihood of correctly transcribing\naudio that includes months (e.g. \"i was born in $month\").\nTo refer to pre-built classes, use the class' symbol prepended with `$`\ne.g. `$MONTH`. To refer to custom classes that were defined inline in the\nrequest, set the class's `custom_class_id` to a string unique to all class\nresources and inline classes. Then use the class' id wrapped in $`{...}`\ne.g. \"${my-months}\". To refer to custom classes resources, use the class'\nid wrapped in `${}` (e.g. `${my-months}`).\n\n\u003cbr /\u003e\n\nSpeech-to-Text supports three locations: `global`, `us` (US North America),\nand `eu` (Europe). If you are calling the `speech.googleapis.com`\nendpoint, use the `global` location. To specify a region, use a\n[regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)\nwith matching `us` or `eu` location value. \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 will simply be ignored. Though `boost` can accept a wide range of positive values, most use cases are best served with values between 0 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.\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 will simply be ignored. Though `boost` can accept a wide range of positive values, most use cases are best served with values between 0 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. \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 will simply be ignored. Though `boost` can accept a wide range of positive values, most use cases are best served with values between 0 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.\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."]]