public sealed class PhraseSet : IMessage<PhraseSet>, IEquatable<PhraseSet>, IDeepCloneable<PhraseSet>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Speech-to-Text v2 API class PhraseSet.
PhraseSet for biasing in speech recognition. A PhraseSet is used to provide
"hints" to the speech recognizer to favor specific words and phrases in the
results.
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.
Valid boost values are 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.
Output only. This checksum is computed by the server based on the value of
other fields. This may be sent on update, undelete, and delete requests to
ensure the client has an up-to-date value before proceeding.
Output only. The KMS key
name with which
the PhraseSet is encrypted. The expected format is
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
Output only. The KMS key version
name
with which the PhraseSet is encrypted. The expected format is
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ePhraseSet\u003c/code\u003e class in the Cloud Speech-to-Text v2 API provides a mechanism to enhance speech recognition by offering hints that favor specific words or phrases.\u003c/p\u003e\n"],["\u003cp\u003ePhraseSets can be configured with boost values between 0 and 20 to increase the probability of recognizing certain phrases, but higher boosts may increase the risk of false positives.\u003c/p\u003e\n"],["\u003cp\u003eEach PhraseSet can include annotations for storing metadata, and they must be less than 63 characters, and there can be no more than 100 annotations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePhraseSet\u003c/code\u003e class has properties for managing its lifecycle, including creation, update, delete, and expiration times, as well as properties for encryption using KMS keys.\u003c/p\u003e\n"],["\u003cp\u003eThe PhraseSet can store a list of words and phrases to add bias to speech recognition.\u003c/p\u003e\n"]]],[],null,["# Cloud Speech-to-Text v2 API - Class PhraseSet (1.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.0 (latest)](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSet)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Speech.V2/1.4.0/Google.Cloud.Speech.V2.PhraseSet)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Speech.V2/1.3.0/Google.Cloud.Speech.V2.PhraseSet)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Speech.V2/1.2.0/Google.Cloud.Speech.V2.PhraseSet)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Speech.V2/1.1.0/Google.Cloud.Speech.V2.PhraseSet)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Speech.V2/1.0.0/Google.Cloud.Speech.V2.PhraseSet) \n\n public sealed class PhraseSet : IMessage\u003cPhraseSet\u003e, IEquatable\u003cPhraseSet\u003e, IDeepCloneable\u003cPhraseSet\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Speech-to-Text v2 API class PhraseSet.\n\nPhraseSet for biasing in speech recognition. A PhraseSet is used to provide\n\"hints\" to the speech recognizer to favor specific words and phrases in the\nresults. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e PhraseSet \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[PhraseSet](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSet), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PhraseSet](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSet), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[PhraseSet](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSet), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Speech.V2](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Speech.V2.dll\n\nConstructors\n------------\n\n### PhraseSet()\n\n public PhraseSet()\n\n### PhraseSet(PhraseSet)\n\n public PhraseSet(PhraseSet other)\n\nProperties\n----------\n\n### Annotations\n\n public MapField\u003cstring, string\u003e Annotations { get; }\n\nAllows users to store small amounts of arbitrary data.\nBoth the key and the value must be 63 characters or less each.\nAt most 100 annotations.\n\n### Boost\n\n public float Boost { get; set; }\n\nHint Boost. Positive value will increase the probability that a specific\nphrase will be recognized over other similar sounding phrases. The higher\nthe boost, the higher the chance of false positive recognition as well.\nValid `boost` values are between 0 (exclusive) and 20. We recommend using a\nbinary search approach to finding the optimal value for your use case as\nwell as adding phrases both with and without boost to your requests.\n\n### CreateTime\n\n public Timestamp CreateTime { get; set; }\n\nOutput only. Creation time.\n\n### DeleteTime\n\n public Timestamp DeleteTime { get; set; }\n\nOutput only. The time at which this resource was requested for deletion.\n\n### DisplayName\n\n public string DisplayName { get; set; }\n\nUser-settable, human-readable name for the PhraseSet. Must be 63\ncharacters or less.\n\n### Etag\n\n public string Etag { get; set; }\n\nOutput only. This checksum is computed by the server based on the value of\nother fields. This may be sent on update, undelete, and delete requests to\nensure the client has an up-to-date value before proceeding.\n\n### ExpireTime\n\n public Timestamp ExpireTime { get; set; }\n\nOutput only. The time at which this resource will be purged.\n\n### KmsKeyName\n\n public string KmsKeyName { get; set; }\n\nOutput only. The [KMS key\nname](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which\nthe PhraseSet is encrypted. The expected format is\n`projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.\n\n### KmsKeyNameAsCryptoKeyName\n\n public CryptoKeyName KmsKeyNameAsCryptoKeyName { get; set; }\n\n[CryptoKeyName](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.CryptoKeyName)-typed view over the [KmsKeyName](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSet#Google_Cloud_Speech_V2_PhraseSet_KmsKeyName) resource name property.\n\n### KmsKeyVersionName\n\n public string KmsKeyVersionName { get; set; }\n\nOutput only. The [KMS key version\nname](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)\nwith which the PhraseSet is encrypted. The expected format is\n`projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.\n\n### KmsKeyVersionNameAsCryptoKeyVersionName\n\n public CryptoKeyVersionName KmsKeyVersionNameAsCryptoKeyVersionName { get; set; }\n\n[CryptoKeyVersionName](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.CryptoKeyVersionName)-typed view over the [KmsKeyVersionName](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSet#Google_Cloud_Speech_V2_PhraseSet_KmsKeyVersionName) resource name\nproperty.\n\n### Name\n\n public string Name { get; set; }\n\nOutput only. Identifier. The resource name of the PhraseSet.\nFormat: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.\n\n### PhraseSetName\n\n public PhraseSetName PhraseSetName { get; set; }\n\n[PhraseSetName](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSetName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.Speech.V2/latest/Google.Cloud.Speech.V2.PhraseSet#Google_Cloud_Speech_V2_PhraseSet_Name) resource name property.\n\n### Phrases\n\n public RepeatedField\u003cPhraseSet.Types.Phrase\u003e Phrases { get; }\n\nA list of word and phrases.\n\n### Reconciling\n\n public bool Reconciling { get; set; }\n\nOutput only. Whether or not this PhraseSet is in the process of being\nupdated.\n\n### State\n\n public PhraseSet.Types.State State { get; set; }\n\nOutput only. The PhraseSet lifecycle state.\n\n### Uid\n\n public string Uid { get; set; }\n\nOutput only. System-assigned unique identifier for the PhraseSet.\n\n### UpdateTime\n\n public Timestamp UpdateTime { get; set; }\n\nOutput only. The most recent time this resource was modified."]]