Skip to content

Commit

Permalink
feat: Added ABNF Grammars field in Speech Adaptation
Browse files Browse the repository at this point in the history
    * Added a new field to Speech Adaptation to specify ABNF grammar
      definitions

PiperOrigin-RevId: 499896786
  • Loading branch information
Google APIs authored and copybara-github committed Jan 5, 2023
1 parent 8a767c9 commit ba57145
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions google/cloud/speech/v1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,30 @@ 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.
repeated PhraseSet phrase_sets = 1;

// 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;
}
15 changes: 13 additions & 2 deletions google/cloud/speech/v1p1beta1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,32 @@ 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.
repeated PhraseSet phrase_sets = 1;

// 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
Expand Down

0 comments on commit ba57145

Please sign in to comment.