google-cloud-speech-v1 0.6.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 379e92e549103dc1380fa9575fc75eedcf5f5fa30b91337ad0bea4da5776a69f
4
- data.tar.gz: 8013de3bba51af43d6bccbc4cc2c83020774cefbac956fcd0836685071d2ba2e
3
+ metadata.gz: f4dc617ef8f2e3cbb8318ac386f238df5b5bf25808dfabfeb07cdbd441694d96
4
+ data.tar.gz: '051599f719634071202ee7362e2bf6fd79e201cefb4602f5df966375bf29243c'
5
5
  SHA512:
6
- metadata.gz: 568ce91f8be48d7659f8bde1037ab2f598fea9d7f079e9d4424ebbdddb77dc334b26ef5f36cadbd249592b96fa3b3de0b429f35fc8ad8c1a169cda892864e2ad
7
- data.tar.gz: e0258c9d483b3c4ea234c098ce216765548da66ee7154393864bee9119df0bd6633492b81f74dc895451ccf12aa1e10c16197a5879b55396daa40476e0489c80
6
+ metadata.gz: 6d69d7844bdd65019be76c5155c04099dc76f47c715f73d944eeb332e1a3dd3e5e89c198799f2a3893375ef83c57e1feed325307a2e36c9565911c746fdd6beb
7
+ data.tar.gz: f78d1af67fbe0a5579ba516605e5e58d2f10c665b36a34599682330a9a2bc5fdb2627fd26a8dd12e8f17a5026339e3925730efb866a76fb857abb7a5964b586b
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Cloud Speech-to-Text V1 API
2
+ --title="Cloud Speech-to-Text V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Speech::V1::RecognizeRequest.new # (request fields as
37
37
  response = client.recognize request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-speech-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/speech-to-text)
@@ -4,8 +4,8 @@
4
4
  require 'google/api/annotations_pb'
5
5
  require 'google/api/client_pb'
6
6
  require 'google/api/field_behavior_pb'
7
+ require 'google/cloud/speech/v1/resource_pb'
7
8
  require 'google/longrunning/operations_pb'
8
- require 'google/protobuf/any_pb'
9
9
  require 'google/protobuf/duration_pb'
10
10
  require 'google/protobuf/timestamp_pb'
11
11
  require 'google/protobuf/wrappers_pb'
@@ -45,11 +45,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
45
45
  optional :audio_channel_count, :int32, 7
46
46
  optional :enable_separate_recognition_per_channel, :bool, 12
47
47
  optional :language_code, :string, 3
48
+ repeated :alternative_language_codes, :string, 18
48
49
  optional :max_alternatives, :int32, 4
49
50
  optional :profanity_filter, :bool, 5
51
+ optional :adaptation, :message, 20, "google.cloud.speech.v1.SpeechAdaptation"
50
52
  repeated :speech_contexts, :message, 6, "google.cloud.speech.v1.SpeechContext"
51
53
  optional :enable_word_time_offsets, :bool, 8
54
+ optional :enable_word_confidence, :bool, 15
52
55
  optional :enable_automatic_punctuation, :bool, 11
56
+ optional :enable_spoken_punctuation, :message, 22, "google.protobuf.BoolValue"
57
+ optional :enable_spoken_emojis, :message, 23, "google.protobuf.BoolValue"
53
58
  optional :diarization_config, :message, 19, "google.cloud.speech.v1.SpeakerDiarizationConfig"
54
59
  optional :metadata, :message, 9, "google.cloud.speech.v1.RecognitionMetadata"
55
60
  optional :model, :string, 13
@@ -64,6 +69,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
64
69
  value :AMR_WB, 5
65
70
  value :OGG_OPUS, 6
66
71
  value :SPEEX_WITH_HEADER_BYTE, 7
72
+ value :WEBM_OPUS, 9
67
73
  end
68
74
  add_message "google.cloud.speech.v1.SpeakerDiarizationConfig" do
69
75
  optional :enable_speaker_diarization, :bool, 1
@@ -114,6 +120,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
114
120
  end
115
121
  add_message "google.cloud.speech.v1.SpeechContext" do
116
122
  repeated :phrases, :string, 1
123
+ optional :boost, :float, 4
117
124
  end
118
125
  add_message "google.cloud.speech.v1.RecognitionAudio" do
119
126
  oneof :audio_source do
@@ -128,6 +135,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
128
135
  add_message "google.cloud.speech.v1.LongRunningRecognizeResponse" do
129
136
  repeated :results, :message, 2, "google.cloud.speech.v1.SpeechRecognitionResult"
130
137
  optional :total_billed_time, :message, 3, "google.protobuf.Duration"
138
+ optional :output_config, :message, 6, "google.cloud.speech.v1.TranscriptOutputConfig"
139
+ optional :output_error, :message, 7, "google.rpc.Status"
131
140
  end
132
141
  add_message "google.cloud.speech.v1.LongRunningRecognizeMetadata" do
133
142
  optional :progress_percent, :int32, 1
@@ -156,6 +165,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
156
165
  add_message "google.cloud.speech.v1.SpeechRecognitionResult" do
157
166
  repeated :alternatives, :message, 1, "google.cloud.speech.v1.SpeechRecognitionAlternative"
158
167
  optional :channel_tag, :int32, 2
168
+ optional :result_end_time, :message, 4, "google.protobuf.Duration"
169
+ optional :language_code, :string, 5
159
170
  end
160
171
  add_message "google.cloud.speech.v1.SpeechRecognitionAlternative" do
161
172
  optional :transcript, :string, 1
@@ -166,6 +177,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
166
177
  optional :start_time, :message, 1, "google.protobuf.Duration"
167
178
  optional :end_time, :message, 2, "google.protobuf.Duration"
168
179
  optional :word, :string, 3
180
+ optional :confidence, :float, 4
169
181
  optional :speaker_tag, :int32, 5
170
182
  end
171
183
  end
@@ -0,0 +1,46 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/speech/v1/resource.proto
3
+
4
+ require 'google/api/resource_pb'
5
+ require 'google/protobuf'
6
+
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_file("google/cloud/speech/v1/resource.proto", :syntax => :proto3) do
9
+ add_message "google.cloud.speech.v1.CustomClass" do
10
+ optional :name, :string, 1
11
+ optional :custom_class_id, :string, 2
12
+ repeated :items, :message, 3, "google.cloud.speech.v1.CustomClass.ClassItem"
13
+ end
14
+ add_message "google.cloud.speech.v1.CustomClass.ClassItem" do
15
+ optional :value, :string, 1
16
+ end
17
+ add_message "google.cloud.speech.v1.PhraseSet" do
18
+ optional :name, :string, 1
19
+ repeated :phrases, :message, 2, "google.cloud.speech.v1.PhraseSet.Phrase"
20
+ optional :boost, :float, 4
21
+ end
22
+ add_message "google.cloud.speech.v1.PhraseSet.Phrase" do
23
+ optional :value, :string, 1
24
+ optional :boost, :float, 2
25
+ end
26
+ add_message "google.cloud.speech.v1.SpeechAdaptation" do
27
+ repeated :phrase_sets, :message, 1, "google.cloud.speech.v1.PhraseSet"
28
+ repeated :phrase_set_references, :string, 2
29
+ repeated :custom_classes, :message, 3, "google.cloud.speech.v1.CustomClass"
30
+ end
31
+ end
32
+ end
33
+
34
+ module Google
35
+ module Cloud
36
+ module Speech
37
+ module V1
38
+ CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CustomClass").msgclass
39
+ CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CustomClass.ClassItem").msgclass
40
+ PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.PhraseSet").msgclass
41
+ PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.PhraseSet.Phrase").msgclass
42
+ SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechAdaptation").msgclass
43
+ end
44
+ end
45
+ end
46
+ end
@@ -30,6 +30,8 @@ module Google
30
30
  # Service that implements Google Cloud Speech API.
31
31
  #
32
32
  class Client
33
+ include Paths
34
+
33
35
  # @private
34
36
  attr_reader :speech_stub
35
37
 
@@ -145,6 +147,7 @@ module Google
145
147
 
146
148
  @operations_client = Operations.new do |config|
147
149
  config.credentials = credentials
150
+ config.quota_project = @quota_project_id
148
151
  config.endpoint = @config.endpoint
149
152
  end
150
153
 
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Speech
23
+ module V1
24
+ module Speech
25
+ # Path helper methods for the Speech API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified CustomClass resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param custom_class [String]
37
+ #
38
+ # @return [::String]
39
+ def custom_class_path project:, location:, custom_class:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/customClasses/#{custom_class}"
44
+ end
45
+
46
+ ##
47
+ # Create a fully-qualified PhraseSet resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
52
+ #
53
+ # @param project [String]
54
+ # @param location [String]
55
+ # @param phrase_set [String]
56
+ #
57
+ # @return [::String]
58
+ def phrase_set_path project:, location:, phrase_set:
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
61
+
62
+ "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}"
63
+ end
64
+
65
+ extend self
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -23,6 +23,7 @@ require "gapic/config/method"
23
23
  require "google/cloud/speech/v1/version"
24
24
 
25
25
  require "google/cloud/speech/v1/speech/credentials"
26
+ require "google/cloud/speech/v1/speech/paths"
26
27
  require "google/cloud/speech/v1/speech/operations"
27
28
  require "google/cloud/speech/v1/speech/client"
28
29
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Speech
23
23
  module V1
24
- VERSION = "0.6.1"
24
+ VERSION = "0.7.2"
25
25
  end
26
26
  end
27
27
  end
@@ -25,6 +25,8 @@ module Google
25
25
  ##
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
+ # @example
29
+ #
28
30
  # require "google/cloud/speech/v1"
29
31
  # client = ::Google::Cloud::Speech::V1::Speech::Client.new
30
32
  #
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
@@ -170,6 +170,20 @@ module Google
170
170
  # See [Language
171
171
  # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
172
172
  # of the currently supported language codes.
173
+ # @!attribute [rw] alternative_language_codes
174
+ # @return [::Array<::String>]
175
+ # A list of up to 3 additional
176
+ # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
177
+ # listing possible alternative languages of the supplied audio.
178
+ # See [Language
179
+ # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
180
+ # of the currently supported language codes. If alternative languages are
181
+ # listed, recognition result will contain recognition in the most likely
182
+ # language detected including the main language_code. The recognition result
183
+ # will include the language tag of the language detected in the audio. Note:
184
+ # This feature is only supported for Voice Command and Voice Search use cases
185
+ # and performance may vary for other use cases (e.g., phone call
186
+ # transcription).
173
187
  # @!attribute [rw] max_alternatives
174
188
  # @return [::Integer]
175
189
  # Maximum number of recognition hypotheses to be returned.
@@ -184,6 +198,13 @@ module Google
184
198
  # profanities, replacing all but the initial character in each filtered word
185
199
  # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
186
200
  # won't be filtered out.
201
+ # @!attribute [rw] adaptation
202
+ # @return [::Google::Cloud::Speech::V1::SpeechAdaptation]
203
+ # Speech adaptation configuration improves the accuracy of speech
204
+ # recognition. For more information, see the [speech
205
+ # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
206
+ # documentation.
207
+ # When speech adaptation is set it supersedes the `speech_contexts` field.
187
208
  # @!attribute [rw] speech_contexts
188
209
  # @return [::Array<::Google::Cloud::Speech::V1::SpeechContext>]
189
210
  # Array of {::Google::Cloud::Speech::V1::SpeechContext SpeechContext}.
@@ -197,12 +218,33 @@ module Google
197
218
  # the start and end time offsets (timestamps) for those words. If
198
219
  # `false`, no word-level time offset information is returned. The default is
199
220
  # `false`.
221
+ # @!attribute [rw] enable_word_confidence
222
+ # @return [::Boolean]
223
+ # If `true`, the top result includes a list of words and the
224
+ # confidence for those words. If `false`, no word-level confidence
225
+ # information is returned. The default is `false`.
200
226
  # @!attribute [rw] enable_automatic_punctuation
201
227
  # @return [::Boolean]
202
228
  # If 'true', adds punctuation to recognition result hypotheses.
203
229
  # This feature is only available in select languages. Setting this for
204
230
  # requests in other languages has no effect at all.
205
231
  # The default 'false' value does not add punctuation to result hypotheses.
232
+ # @!attribute [rw] enable_spoken_punctuation
233
+ # @return [::Google::Protobuf::BoolValue]
234
+ # The spoken punctuation behavior for the call
235
+ # If not set, uses default behavior based on model of choice
236
+ # e.g. command_and_search will enable spoken punctuation by default
237
+ # If 'true', replaces spoken punctuation with the corresponding symbols in
238
+ # the request. For example, "how are you question mark" becomes "how are
239
+ # you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
240
+ # for support. If 'false', spoken punctuation is not replaced.
241
+ # @!attribute [rw] enable_spoken_emojis
242
+ # @return [::Google::Protobuf::BoolValue]
243
+ # The spoken emoji behavior for the call
244
+ # If not set, uses default behavior based on model of choice
245
+ # If 'true', adds spoken emoji formatting for the request. This will replace
246
+ # spoken emojis with the corresponding Unicode symbols in the final
247
+ # transcript. If 'false', spoken emojis are not replaced.
206
248
  # @!attribute [rw] diarization_config
207
249
  # @return [::Google::Cloud::Speech::V1::SpeakerDiarizationConfig]
208
250
  # Config to enable speaker diarization and set additional
@@ -274,7 +316,8 @@ module Google
274
316
  # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
275
317
  # recognition can be reduced if lossy codecs are used to capture or transmit
276
318
  # audio, particularly if background noise is present. Lossy codecs include
277
- # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`.
319
+ # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`,
320
+ # and `WEBM_OPUS`.
278
321
  #
279
322
  # The `FLAC` and `WAV` audio file formats include a header that describes the
280
323
  # included audio content. You can request recognition for `WAV` files that
@@ -329,6 +372,11 @@ module Google
329
372
  # is replaced with a single byte containing the block length. Only Speex
330
373
  # wideband is supported. `sample_rate_hertz` must be 16000.
331
374
  SPEEX_WITH_HEADER_BYTE = 7
375
+
376
+ # Opus encoded audio frames in WebM container
377
+ # ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
378
+ # one of 8000, 12000, 16000, 24000, or 48000.
379
+ WEBM_OPUS = 9
332
380
  end
333
381
  end
334
382
 
@@ -502,6 +550,16 @@ module Google
502
550
  # providing phrase hints for every month of the year, using the $MONTH class
503
551
  # improves the likelihood of correctly transcribing audio that includes
504
552
  # months.
553
+ # @!attribute [rw] boost
554
+ # @return [::Float]
555
+ # Hint Boost. Positive value will increase the probability that a specific
556
+ # phrase will be recognized over other similar sounding phrases. The higher
557
+ # the boost, the higher the chance of false positive recognition as well.
558
+ # Negative boost values would correspond to anti-biasing. Anti-biasing is not
559
+ # enabled, so negative boost will simply be ignored. Though `boost` can
560
+ # accept a wide range of positive values, most use cases are best served with
561
+ # values between 0 and 20. We recommend using a binary search approach to
562
+ # finding the optimal value for your use case.
505
563
  class SpeechContext
506
564
  include ::Google::Protobuf::MessageExts
507
565
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -557,6 +615,12 @@ module Google
557
615
  # @!attribute [rw] total_billed_time
558
616
  # @return [::Google::Protobuf::Duration]
559
617
  # When available, billed audio seconds for the corresponding request.
618
+ # @!attribute [rw] output_config
619
+ # @return [::Google::Cloud::Speech::V1::TranscriptOutputConfig]
620
+ # Original output config if present in the request.
621
+ # @!attribute [rw] output_error
622
+ # @return [::Google::Rpc::Status]
623
+ # If the transcript output fails this field contains the relevant error.
560
624
  class LongRunningRecognizeResponse
561
625
  include ::Google::Protobuf::MessageExts
562
626
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -703,9 +767,9 @@ module Google
703
767
  # For audio_channel_count = N, its output values can range from '1' to 'N'.
704
768
  # @!attribute [r] language_code
705
769
  # @return [::String]
706
- # The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
707
- # the language in this result. This language code was detected to have the
708
- # most likelihood of being spoken in the audio.
770
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
771
+ # of the language in this result. This language code was detected to have
772
+ # the most likelihood of being spoken in the audio.
709
773
  class StreamingRecognitionResult
710
774
  include ::Google::Protobuf::MessageExts
711
775
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -723,6 +787,15 @@ module Google
723
787
  # For multi-channel audio, this is the channel number corresponding to the
724
788
  # recognized result for the audio from that channel.
725
789
  # For audio_channel_count = N, its output values can range from '1' to 'N'.
790
+ # @!attribute [rw] result_end_time
791
+ # @return [::Google::Protobuf::Duration]
792
+ # Time offset of the end of this result relative to the
793
+ # beginning of the audio.
794
+ # @!attribute [r] language_code
795
+ # @return [::String]
796
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
797
+ # of the language in this result. This language code was detected to have
798
+ # the most likelihood of being spoken in the audio.
726
799
  class SpeechRecognitionResult
727
800
  include ::Google::Protobuf::MessageExts
728
801
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -771,6 +844,15 @@ module Google
771
844
  # @!attribute [rw] word
772
845
  # @return [::String]
773
846
  # The word corresponding to this set of information.
847
+ # @!attribute [rw] confidence
848
+ # @return [::Float]
849
+ # The confidence estimate between 0.0 and 1.0. A higher number
850
+ # indicates an estimated greater likelihood that the recognized words are
851
+ # correct. This field is set only for the top alternative of a non-streaming
852
+ # result or, of a streaming result where `is_final=true`.
853
+ # This field is not guaranteed to be accurate and users should not rely on it
854
+ # to be always provided.
855
+ # The default of 0.0 is a sentinel value indicating `confidence` was not set.
774
856
  # @!attribute [r] speaker_tag
775
857
  # @return [::Integer]
776
858
  # Output only. A distinct integer value is assigned for every speaker within
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Speech
23
+ module V1
24
+ # A set of words or phrases that represents a common concept likely to appear
25
+ # in your audio, for example a list of passenger ship names. CustomClass items
26
+ # can be substituted into placeholders that you set in PhraseSet phrases.
27
+ # @!attribute [rw] name
28
+ # @return [::String]
29
+ # The resource name of the custom class.
30
+ # @!attribute [rw] custom_class_id
31
+ # @return [::String]
32
+ # If this custom class is a resource, the custom_class_id is the resource id
33
+ # of the CustomClass. Case sensitive.
34
+ # @!attribute [rw] items
35
+ # @return [::Array<::Google::Cloud::Speech::V1::CustomClass::ClassItem>]
36
+ # A collection of class items.
37
+ class CustomClass
38
+ include ::Google::Protobuf::MessageExts
39
+ extend ::Google::Protobuf::MessageExts::ClassMethods
40
+
41
+ # An item of the class.
42
+ # @!attribute [rw] value
43
+ # @return [::String]
44
+ # The class item's value.
45
+ class ClassItem
46
+ include ::Google::Protobuf::MessageExts
47
+ extend ::Google::Protobuf::MessageExts::ClassMethods
48
+ end
49
+ end
50
+
51
+ # Provides "hints" to the speech recognizer to favor specific words and phrases
52
+ # in the results.
53
+ # @!attribute [rw] name
54
+ # @return [::String]
55
+ # The resource name of the phrase set.
56
+ # @!attribute [rw] phrases
57
+ # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet::Phrase>]
58
+ # A list of word and phrases.
59
+ # @!attribute [rw] boost
60
+ # @return [::Float]
61
+ # Hint Boost. Positive value will increase the probability that a specific
62
+ # phrase will be recognized over other similar sounding phrases. The higher
63
+ # the boost, the higher the chance of false positive recognition as well.
64
+ # Negative boost values would correspond to anti-biasing. Anti-biasing is not
65
+ # enabled, so negative boost will simply be ignored. Though `boost` can
66
+ # accept a wide range of positive values, most use cases are best served with
67
+ # values between 0 (exclusive) and 20. We recommend using a binary search
68
+ # approach to finding the optimal value for your use case. Speech recognition
69
+ # will skip PhraseSets with a boost value of 0.
70
+ class PhraseSet
71
+ include ::Google::Protobuf::MessageExts
72
+ extend ::Google::Protobuf::MessageExts::ClassMethods
73
+
74
+ # A phrases containing words and phrase "hints" so that
75
+ # the speech recognition is more likely to recognize them. This can be used
76
+ # to improve the accuracy for specific words and phrases, for example, if
77
+ # specific commands are typically spoken by the user. This can also be used
78
+ # to add additional words to the vocabulary of the recognizer. See
79
+ # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
80
+ #
81
+ # List items can also include pre-built or custom classes containing groups
82
+ # of words that represent common concepts that occur in natural language. For
83
+ # example, rather than providing a phrase hint for every month of the
84
+ # year (e.g. "i was born in january", "i was born in febuary", ...), use the
85
+ # pre-built `$MONTH` class improves the likelihood of correctly transcribing
86
+ # audio that includes months (e.g. "i was born in $month").
87
+ # To refer to pre-built classes, use the class' symbol prepended with `$`
88
+ # e.g. `$MONTH`. To refer to custom classes that were defined inline in the
89
+ # request, set the class's `custom_class_id` to a string unique to all class
90
+ # resources and inline classes. Then use the class' id wrapped in $`{...}`
91
+ # e.g. "$\\{my-months}". To refer to custom classes resources, use the class'
92
+ # id wrapped in `${}` (e.g. `${my-months}`).
93
+ #
94
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
95
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
96
+ # endpoint, use the `global` location. To specify a region, use a
97
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
98
+ # `eu` location value.
99
+ # @!attribute [rw] value
100
+ # @return [::String]
101
+ # The phrase itself.
102
+ # @!attribute [rw] boost
103
+ # @return [::Float]
104
+ # Hint Boost. Overrides the boost set at the phrase set level.
105
+ # Positive value will increase the probability that a specific phrase will
106
+ # be recognized over other similar sounding phrases. The higher the boost,
107
+ # the higher the chance of false positive recognition as well. Negative
108
+ # boost will simply be ignored. Though `boost` can accept a wide range of
109
+ # positive values, most use cases are best served
110
+ # with values between 0 and 20. We recommend using a binary search approach
111
+ # to finding the optimal value for your use case. Speech recognition
112
+ # will skip PhraseSets with a boost value of 0.
113
+ class Phrase
114
+ include ::Google::Protobuf::MessageExts
115
+ extend ::Google::Protobuf::MessageExts::ClassMethods
116
+ end
117
+ end
118
+
119
+ # Speech adaptation configuration.
120
+ # @!attribute [rw] phrase_sets
121
+ # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet>]
122
+ # A collection of phrase sets. To specify the hints inline, leave the
123
+ # phrase set's `name` blank and fill in the rest of its fields. Any
124
+ # phrase set can use any custom class.
125
+ # @!attribute [rw] phrase_set_references
126
+ # @return [::Array<::String>]
127
+ # A collection of phrase set resource names to use.
128
+ # @!attribute [rw] custom_classes
129
+ # @return [::Array<::Google::Cloud::Speech::V1::CustomClass>]
130
+ # A collection of custom classes. To specify the classes inline, leave the
131
+ # class' `name` blank and fill in the rest of its fields, giving it a unique
132
+ # `custom_class_id`. Refer to the inline defined class in phrase hints by its
133
+ # `custom_class_id`.
134
+ class SpeechAdaptation
135
+ include ::Google::Protobuf::MessageExts
136
+ extend ::Google::Protobuf::MessageExts::ClassMethods
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-speech-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-08 00:00:00.000000000 Z
11
+ date: 2022-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -177,15 +177,18 @@ files:
177
177
  - lib/google/cloud/speech/v1.rb
178
178
  - lib/google/cloud/speech/v1/cloud_speech_pb.rb
179
179
  - lib/google/cloud/speech/v1/cloud_speech_services_pb.rb
180
+ - lib/google/cloud/speech/v1/resource_pb.rb
180
181
  - lib/google/cloud/speech/v1/speech.rb
181
182
  - lib/google/cloud/speech/v1/speech/client.rb
182
183
  - lib/google/cloud/speech/v1/speech/credentials.rb
183
184
  - lib/google/cloud/speech/v1/speech/operations.rb
185
+ - lib/google/cloud/speech/v1/speech/paths.rb
184
186
  - lib/google/cloud/speech/v1/version.rb
185
187
  - proto_docs/README.md
186
188
  - proto_docs/google/api/field_behavior.rb
187
189
  - proto_docs/google/api/resource.rb
188
190
  - proto_docs/google/cloud/speech/v1/cloud_speech.rb
191
+ - proto_docs/google/cloud/speech/v1/resource.rb
189
192
  - proto_docs/google/longrunning/operations.rb
190
193
  - proto_docs/google/protobuf/any.rb
191
194
  - proto_docs/google/protobuf/duration.rb
@@ -212,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
215
  - !ruby/object:Gem::Version
213
216
  version: '0'
214
217
  requirements: []
215
- rubygems_version: 3.2.17
218
+ rubygems_version: 3.3.5
216
219
  signing_key:
217
220
  specification_version: 4
218
221
  summary: API Client library for the Cloud Speech-to-Text V1 API