From ba57145ea81b543ed8e4424abda2ff0cc7ad6351 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Thu, 5 Jan 2023 08:55:26 -0800 Subject: [PATCH] feat: Added ABNF Grammars field in Speech Adaptation * Added a new field to Speech Adaptation to specify ABNF grammar definitions PiperOrigin-RevId: 499896786 --- google/cloud/speech/v1/resource.proto | 15 +++++++++++++-- google/cloud/speech/v1p1beta1/resource.proto | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/google/cloud/speech/v1/resource.proto b/google/cloud/speech/v1/resource.proto index 0ae5caa9e9ff9..63b7ae4479ffd 100644 --- a/google/cloud/speech/v1/resource.proto +++ b/google/cloud/speech/v1/resource.proto @@ -120,6 +120,12 @@ message PhraseSet { // Speech adaptation configuration. message SpeechAdaptation { + message ABNFGrammar { + // All declarations and rules of an ABNF grammar broken up into multiple + // strings that will end up concatenated. + repeated string abnf_strings = 1; + } + // A collection of phrase sets. To specify the hints inline, leave the // phrase set's `name` blank and fill in the rest of its fields. Any // phrase set can use any custom class. @@ -127,12 +133,17 @@ message SpeechAdaptation { // A collection of phrase set resource names to use. repeated string phrase_set_references = 2 [(google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - }]; + type: "speech.googleapis.com/PhraseSet" + }]; // A collection of custom classes. To specify the classes inline, leave the // class' `name` blank and fill in the rest of its fields, giving it a unique // `custom_class_id`. Refer to the inline defined class in phrase hints by its // `custom_class_id`. repeated CustomClass custom_classes = 3; + + // Augmented Backus-Naur form (ABNF) is a standardized grammar notation + // comprised by a set of derivation rules. + // See specifications: https://www.w3.org/TR/speech-grammar + ABNFGrammar abnf_grammar = 4; } diff --git a/google/cloud/speech/v1p1beta1/resource.proto b/google/cloud/speech/v1p1beta1/resource.proto index 0323b19e22e9b..6a9bcaa9837ab 100644 --- a/google/cloud/speech/v1p1beta1/resource.proto +++ b/google/cloud/speech/v1p1beta1/resource.proto @@ -120,6 +120,12 @@ message PhraseSet { // Speech adaptation configuration. message SpeechAdaptation { + message ABNFGrammar { + // All declarations and rules of an ABNF grammar broken up into multiple + // strings that will end up concatenated. + repeated string abnf_strings = 1; + } + // A collection of phrase sets. To specify the hints inline, leave the // phrase set's `name` blank and fill in the rest of its fields. Any // phrase set can use any custom class. @@ -127,14 +133,19 @@ message SpeechAdaptation { // A collection of phrase set resource names to use. repeated string phrase_set_references = 2 [(google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - }]; + type: "speech.googleapis.com/PhraseSet" + }]; // A collection of custom classes. To specify the classes inline, leave the // class' `name` blank and fill in the rest of its fields, giving it a unique // `custom_class_id`. Refer to the inline defined class in phrase hints by its // `custom_class_id`. repeated CustomClass custom_classes = 3; + + // Augmented Backus-Naur form (ABNF) is a standardized grammar notation + // comprised by a set of derivation rules. + // See specifications: https://www.w3.org/TR/speech-grammar + ABNFGrammar abnf_grammar = 4; } // Transcription normalization configuration. Use transcription normalization