Reference documentation and code samples for the Cloud Speech V2 Client class 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.
Generated from protobuf messagegoogle.cloud.speech.v2.PhraseSet.Phrase
Namespace
Google \ Cloud \ Speech \ V2 \ PhraseSet
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ value
string
The phrase itself.
↳ boost
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.
getValue
The phrase itself.
Returns
Type
Description
string
setValue
The phrase itself.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getBoost
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
Type
Description
float
setBoost
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 V2 Client - Class Phrase (2.1.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.1 (latest)](/php/docs/reference/cloud-speech/latest/V2.PhraseSet.Phrase)\n- [2.1.0](/php/docs/reference/cloud-speech/2.1.0/V2.PhraseSet.Phrase)\n- [2.0.1](/php/docs/reference/cloud-speech/2.0.1/V2.PhraseSet.Phrase)\n- [1.20.1](/php/docs/reference/cloud-speech/1.20.1/V2.PhraseSet.Phrase)\n- [1.19.2](/php/docs/reference/cloud-speech/1.19.2/V2.PhraseSet.Phrase)\n- [1.18.3](/php/docs/reference/cloud-speech/1.18.3/V2.PhraseSet.Phrase)\n- [1.16.0](/php/docs/reference/cloud-speech/1.16.0/V2.PhraseSet.Phrase)\n- [1.15.0](/php/docs/reference/cloud-speech/1.15.0/V2.PhraseSet.Phrase)\n- [1.14.3](/php/docs/reference/cloud-speech/1.14.3/V2.PhraseSet.Phrase)\n- [1.13.1](/php/docs/reference/cloud-speech/1.13.1/V2.PhraseSet.Phrase)\n- [1.12.0](/php/docs/reference/cloud-speech/1.12.0/V2.PhraseSet.Phrase)\n- [1.11.2](/php/docs/reference/cloud-speech/1.11.2/V2.PhraseSet.Phrase)\n- [1.10.0](/php/docs/reference/cloud-speech/1.10.0/V2.PhraseSet.Phrase)\n- [1.9.1](/php/docs/reference/cloud-speech/1.9.1/V2.PhraseSet.Phrase)\n- [1.8.0](/php/docs/reference/cloud-speech/1.8.0/V2.PhraseSet.Phrase)\n- [1.7.0](/php/docs/reference/cloud-speech/1.7.0/V2.PhraseSet.Phrase) \nReference documentation and code samples for the Cloud Speech V2 Client class 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\nList items can also include CustomClass references containing groups of\nwords that represent common concepts that occur in natural language.\n\nGenerated from protobuf message `google.cloud.speech.v2.PhraseSet.Phrase`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Speech \\\\ V2 \\\\ PhraseSet\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getValue\n\nThe phrase itself.\n\n### setValue\n\nThe phrase itself.\n\n### getBoost\n\nHint Boost. Overrides the boost set at the phrase set level.\n\nPositive value will increase the probability that a specific phrase will\nbe recognized over other similar sounding phrases. The higher the boost,\nthe higher the chance of false positive recognition as well. Negative\nboost values would correspond to anti-biasing. Anti-biasing is not\nenabled, so negative boost values will return an error. Boost values must\nbe between 0 and 20. Any values outside that range will return an error.\nWe recommend using a binary search approach to finding the optimal value\nfor your use case as well as adding phrases both with and without boost\nto your requests.\n\n### setBoost\n\nHint Boost. Overrides the boost set at the phrase set level.\n\nPositive value will increase the probability that a specific phrase will\nbe recognized over other similar sounding phrases. The higher the boost,\nthe higher the chance of false positive recognition as well. Negative\nboost values would correspond to anti-biasing. Anti-biasing is not\nenabled, so negative boost values will return an error. Boost values must\nbe between 0 and 20. Any values outside that range will return an error.\nWe recommend using a binary search approach to finding the optimal value\nfor your use case as well as adding phrases both with and without boost\nto your requests."]]