Skip to main content

phrase_sets

Creates, updates, deletes, gets or lists a phrase_sets resource.

Overview

Namephrase_sets
TypeResource
Idgoogle.speechv2.phrase_sets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of the PhraseSet. Format: projects/{project}/locations/{location}/phraseSets/{phrase_set}.
annotationsobjectAllows users to store small amounts of arbitrary data. Both the key and the value must be 63 characters or less each. At most 100 annotations.
boostnumber (float)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.
createTimestring (google-datetime)Output only. Creation time.
deleteTimestring (google-datetime)Output only. The time at which this resource was requested for deletion.
displayNamestringUser-settable, human-readable name for the PhraseSet. Must be 63 characters or less.
etagstringOutput 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.
expireTimestring (google-datetime)Output only. The time at which this resource will be purged.
kmsKeyNamestringOutput 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}.
kmsKeyVersionNamestringOutput 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}.
phrasesarrayA list of word and phrases.
reconcilingbooleanOutput only. Whether or not this PhraseSet is in the process of being updated.
statestringOutput only. The PhraseSet lifecycle state.
uidstringOutput only. System-assigned unique identifier for the PhraseSet.
updateTimestring (google-datetime)Output only. The most recent time this resource was modified.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, phraseSetsIdReturns the requested PhraseSet.
listselectprojectsId, locationsIdpageSize, pageToken, showDeletedLists PhraseSets.
createinsertprojectsId, locationsIdvalidateOnly, phraseSetIdCreates a PhraseSet.
patchupdateprojectsId, locationsId, phraseSetsIdupdateMask, validateOnlyUpdates the PhraseSet.
deletedeleteprojectsId, locationsId, phraseSetsIdvalidateOnly, allowMissing, etagDeletes the PhraseSet.
undeleteexecprojectsId, locationsId, phraseSetsIdUndeletes the PhraseSet.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
phraseSetsIdstring
projectsIdstring
allowMissingboolean
etagstring
pageSizeinteger (int32)
pageTokenstring
phraseSetIdstring
showDeletedboolean
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Returns the requested PhraseSet.

SELECT
name,
annotations,
boost,
createTime,
deleteTime,
displayName,
etag,
expireTime,
kmsKeyName,
kmsKeyVersionName,
phrases,
reconciling,
state,
uid,
updateTime
FROM google.speechv2.phrase_sets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND phraseSetsId = '{{ phraseSetsId }}' -- required
;

INSERT examples

Creates a PhraseSet.

INSERT INTO google.speechv2.phrase_sets (
data__phrases,
data__boost,
data__displayName,
data__annotations,
projectsId,
locationsId,
validateOnly,
phraseSetId
)
SELECT
'{{ phrases }}',
{{ boost }},
'{{ displayName }}',
'{{ annotations }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ validateOnly }}',
'{{ phraseSetId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the PhraseSet.

UPDATE google.speechv2.phrase_sets
SET
data__phrases = '{{ phrases }}',
data__boost = {{ boost }},
data__displayName = '{{ displayName }}',
data__annotations = '{{ annotations }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND phraseSetsId = '{{ phraseSetsId }}' --required
AND updateMask = '{{ updateMask}}'
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes the PhraseSet.

DELETE FROM google.speechv2.phrase_sets
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND phraseSetsId = '{{ phraseSetsId }}' --required
AND validateOnly = '{{ validateOnly }}'
AND allowMissing = '{{ allowMissing }}'
AND etag = '{{ etag }}'
;

Lifecycle Methods

Undeletes the PhraseSet.

EXEC google.speechv2.phrase_sets.undelete 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@phraseSetsId='{{ phraseSetsId }}' --required
@@json=
'{
"name": "{{ name }}",
"validateOnly": {{ validateOnly }},
"etag": "{{ etag }}"
}'
;