Skip to content

Commit ba57145

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added ABNF Grammars field in Speech Adaptation
* Added a new field to Speech Adaptation to specify ABNF grammar definitions PiperOrigin-RevId: 499896786
1 parent 8a767c9 commit ba57145

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

google/cloud/speech/v1/resource.proto

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,30 @@ message PhraseSet {
120120

121121
// Speech adaptation configuration.
122122
message SpeechAdaptation {
123+
message ABNFGrammar {
124+
// All declarations and rules of an ABNF grammar broken up into multiple
125+
// strings that will end up concatenated.
126+
repeated string abnf_strings = 1;
127+
}
128+
123129
// A collection of phrase sets. To specify the hints inline, leave the
124130
// phrase set's `name` blank and fill in the rest of its fields. Any
125131
// phrase set can use any custom class.
126132
repeated PhraseSet phrase_sets = 1;
127133

128134
// A collection of phrase set resource names to use.
129135
repeated string phrase_set_references = 2 [(google.api.resource_reference) = {
130-
type: "speech.googleapis.com/PhraseSet"
131-
}];
136+
type: "speech.googleapis.com/PhraseSet"
137+
}];
132138

133139
// A collection of custom classes. To specify the classes inline, leave the
134140
// class' `name` blank and fill in the rest of its fields, giving it a unique
135141
// `custom_class_id`. Refer to the inline defined class in phrase hints by its
136142
// `custom_class_id`.
137143
repeated CustomClass custom_classes = 3;
144+
145+
// Augmented Backus-Naur form (ABNF) is a standardized grammar notation
146+
// comprised by a set of derivation rules.
147+
// See specifications: https://www.w3.org/TR/speech-grammar
148+
ABNFGrammar abnf_grammar = 4;
138149
}

google/cloud/speech/v1p1beta1/resource.proto

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,32 @@ message PhraseSet {
120120

121121
// Speech adaptation configuration.
122122
message SpeechAdaptation {
123+
message ABNFGrammar {
124+
// All declarations and rules of an ABNF grammar broken up into multiple
125+
// strings that will end up concatenated.
126+
repeated string abnf_strings = 1;
127+
}
128+
123129
// A collection of phrase sets. To specify the hints inline, leave the
124130
// phrase set's `name` blank and fill in the rest of its fields. Any
125131
// phrase set can use any custom class.
126132
repeated PhraseSet phrase_sets = 1;
127133

128134
// A collection of phrase set resource names to use.
129135
repeated string phrase_set_references = 2 [(google.api.resource_reference) = {
130-
type: "speech.googleapis.com/PhraseSet"
131-
}];
136+
type: "speech.googleapis.com/PhraseSet"
137+
}];
132138

133139
// A collection of custom classes. To specify the classes inline, leave the
134140
// class' `name` blank and fill in the rest of its fields, giving it a unique
135141
// `custom_class_id`. Refer to the inline defined class in phrase hints by its
136142
// `custom_class_id`.
137143
repeated CustomClass custom_classes = 3;
144+
145+
// Augmented Backus-Naur form (ABNF) is a standardized grammar notation
146+
// comprised by a set of derivation rules.
147+
// See specifications: https://www.w3.org/TR/speech-grammar
148+
ABNFGrammar abnf_grammar = 4;
138149
}
139150

140151
// Transcription normalization configuration. Use transcription normalization

0 commit comments

Comments
 (0)