Skip to content

Commit

Permalink
feat: Add transcript normalization (#792)
Browse files Browse the repository at this point in the history
* feat: Add transcript normalization

Committer: @jameszhao
PiperOrigin-RevId: 391603958

Source-Link: googleapis/googleapis@76bed90

Source-Link: googleapis/googleapis-gen@c7aaaa7

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Aug 19, 2021
1 parent 24a8e86 commit de5b118
Show file tree
Hide file tree
Showing 5 changed files with 730 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ message RecognitionConfig {
// documentation.
SpeechAdaptation adaptation = 20;

// Use transcription normalization to automatically replace parts of the
// transcript with phrases of your choosing. For StreamingRecognize, this
// normalization only applies to stable partial transcripts (stability > 0.8)
// and final transcripts.
TranscriptNormalization transcript_normalization = 24;

// Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
// A means to provide context to assist the speech recognition. For more
// information, see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ syntax = "proto3";
package google.cloud.speech.v1p1beta1;

import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option cc_enable_arenas = true;
Expand Down Expand Up @@ -132,3 +133,27 @@ message SpeechAdaptation {
// `custom_class_id`.
repeated CustomClass custom_classes = 3;
}

// Transcription normalization configuration. Use transcription normalization
// to automatically replace parts of the transcript with phrases of your
// choosing. For StreamingRecognize, this normalization only applies to stable
// partial transcripts (stability > 0.8) and final transcripts.
message TranscriptNormalization {
// A single replacement configuration.
message Entry {
// What to replace. Max length is 100 characters.
string search = 1;

// What to replace with. Max length is 100 characters.
string replace = 2;

// Whether the search is case sensitive.
bool case_sensitive = 3;
}

// A list of replacement entries. We will perform replacement with one entry
// at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
// => "mountain dog"] will never be applied because we will always process the
// first entry before it. At most 100 entries.
repeated Entry entries = 1;
}
201 changes: 201 additions & 0 deletions packages/google-cloud-speech/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit de5b118

Please sign in to comment.