google-cloud-language-v1 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d5ae48b355608ffae1ae5cc2911772223a85a963180648583e7386e389c3f3b
4
- data.tar.gz: 9181185fc92bdb7d41bd8b538bcd599c2b1ff75174ab85d78582415d611bc1d0
3
+ metadata.gz: 9adc4f1cd6b86c6aba8ebd140d79a2b5bf7c37e2bc068ab09efeded8e3223b4e
4
+ data.tar.gz: c72eb057130398c019db8eacaca7760bd6c248a9d11cc1f05db6fe7b838f6df5
5
5
  SHA512:
6
- metadata.gz: 1cefc4409a7092639b0b7ac1dc5286b1d7cc7dde90f26ef232ad1e69e84d6b7344c30330eb3809220757216b1203c8f45cbe9a1496ca3753109a8ae7653a94e1
7
- data.tar.gz: 4b28ed9c02e720032050c4aed2f6a2fff96aaffc45fcc8a494c5bed661072fdd8e3344d27285054a923c07e3b6d0d5365c6c65c9e86d9cea57f100fbc0a2e6ab
6
+ metadata.gz: b21eaec60cef78aa3cc57cd0e1615e5d9528a7f0c03edad486b2c053ed2e9baa5def3ce1beef465efc79e3fbdf16c517b356f84c5a4468651463938d2d9cca3c
7
+ data.tar.gz: 88f86e47b58d76ab57f5250a032c9a6ab124ec373279f4cea6d98d9c0050d2df54c2e33bfa1c5dd28290842b8e385075f538f8ef388b48b378035ff1851b441c
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
@@ -192,7 +192,7 @@ module Google
192
192
  # the default parameter values, pass an empty Hash as a request object (see above).
193
193
  #
194
194
  # @param document [::Google::Cloud::Language::V1::Document, ::Hash]
195
- # Input document.
195
+ # Required. Input document.
196
196
  # @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
197
197
  # The encoding type used by the API to calculate sentence offsets.
198
198
  #
@@ -273,7 +273,7 @@ module Google
273
273
  # the default parameter values, pass an empty Hash as a request object (see above).
274
274
  #
275
275
  # @param document [::Google::Cloud::Language::V1::Document, ::Hash]
276
- # Input document.
276
+ # Required. Input document.
277
277
  # @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
278
278
  # The encoding type used by the API to calculate offsets.
279
279
  #
@@ -353,7 +353,7 @@ module Google
353
353
  # the default parameter values, pass an empty Hash as a request object (see above).
354
354
  #
355
355
  # @param document [::Google::Cloud::Language::V1::Document, ::Hash]
356
- # Input document.
356
+ # Required. Input document.
357
357
  # @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
358
358
  # The encoding type used by the API to calculate offsets.
359
359
  #
@@ -434,7 +434,7 @@ module Google
434
434
  # the default parameter values, pass an empty Hash as a request object (see above).
435
435
  #
436
436
  # @param document [::Google::Cloud::Language::V1::Document, ::Hash]
437
- # Input document.
437
+ # Required. Input document.
438
438
  # @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
439
439
  # The encoding type used by the API to calculate offsets.
440
440
  #
@@ -507,13 +507,16 @@ module Google
507
507
  # @param options [::Gapic::CallOptions, ::Hash]
508
508
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
509
509
  #
510
- # @overload classify_text(document: nil)
510
+ # @overload classify_text(document: nil, classification_model_options: nil)
511
511
  # Pass arguments to `classify_text` via keyword arguments. Note that at
512
512
  # least one keyword argument is required. To specify no parameters, or to keep all
513
513
  # the default parameter values, pass an empty Hash as a request object (see above).
514
514
  #
515
515
  # @param document [::Google::Cloud::Language::V1::Document, ::Hash]
516
- # Input document.
516
+ # Required. Input document.
517
+ # @param classification_model_options [::Google::Cloud::Language::V1::ClassificationModelOptions, ::Hash]
518
+ # Model options to use for classification. Defaults to v1 options if not
519
+ # specified.
517
520
  #
518
521
  # @yield [response, operation] Access the result along with the RPC operation
519
522
  # @yieldparam response [::Google::Cloud::Language::V1::ClassifyTextResponse]
@@ -591,9 +594,9 @@ module Google
591
594
  # the default parameter values, pass an empty Hash as a request object (see above).
592
595
  #
593
596
  # @param document [::Google::Cloud::Language::V1::Document, ::Hash]
594
- # Input document.
597
+ # Required. Input document.
595
598
  # @param features [::Google::Cloud::Language::V1::AnnotateTextRequest::Features, ::Hash]
596
- # The enabled features.
599
+ # Required. The enabled features.
597
600
  # @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
598
601
  # The encoding type used by the API to calculate offsets.
599
602
  #
@@ -286,6 +286,22 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
286
286
  optional :name, :string, 1
287
287
  optional :confidence, :float, 2
288
288
  end
289
+ add_message "google.cloud.language.v1.ClassificationModelOptions" do
290
+ oneof :model_type do
291
+ optional :v1_model, :message, 1, "google.cloud.language.v1.ClassificationModelOptions.V1Model"
292
+ optional :v2_model, :message, 2, "google.cloud.language.v1.ClassificationModelOptions.V2Model"
293
+ end
294
+ end
295
+ add_message "google.cloud.language.v1.ClassificationModelOptions.V1Model" do
296
+ end
297
+ add_message "google.cloud.language.v1.ClassificationModelOptions.V2Model" do
298
+ optional :content_categories_version, :enum, 1, "google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion"
299
+ end
300
+ add_enum "google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion" do
301
+ value :CONTENT_CATEGORIES_VERSION_UNSPECIFIED, 0
302
+ value :V1, 1
303
+ value :V2, 2
304
+ end
289
305
  add_message "google.cloud.language.v1.AnalyzeSentimentRequest" do
290
306
  optional :document, :message, 1, "google.cloud.language.v1.Document"
291
307
  optional :encoding_type, :enum, 2, "google.cloud.language.v1.EncodingType"
@@ -322,6 +338,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
322
338
  end
323
339
  add_message "google.cloud.language.v1.ClassifyTextRequest" do
324
340
  optional :document, :message, 1, "google.cloud.language.v1.Document"
341
+ optional :classification_model_options, :message, 3, "google.cloud.language.v1.ClassificationModelOptions"
325
342
  end
326
343
  add_message "google.cloud.language.v1.ClassifyTextResponse" do
327
344
  repeated :categories, :message, 1, "google.cloud.language.v1.ClassificationCategory"
@@ -337,6 +354,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
337
354
  optional :extract_document_sentiment, :bool, 3
338
355
  optional :extract_entity_sentiment, :bool, 4
339
356
  optional :classify_text, :bool, 6
357
+ optional :classification_model_options, :message, 10, "google.cloud.language.v1.ClassificationModelOptions"
340
358
  end
341
359
  add_message "google.cloud.language.v1.AnnotateTextResponse" do
342
360
  repeated :sentences, :message, 1, "google.cloud.language.v1.Sentence"
@@ -385,6 +403,10 @@ module Google
385
403
  EntityMention::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.EntityMention.Type").enummodule
386
404
  TextSpan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.TextSpan").msgclass
387
405
  ClassificationCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassificationCategory").msgclass
406
+ ClassificationModelOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassificationModelOptions").msgclass
407
+ ClassificationModelOptions::V1Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassificationModelOptions.V1Model").msgclass
408
+ ClassificationModelOptions::V2Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassificationModelOptions.V2Model").msgclass
409
+ ClassificationModelOptions::V2Model::ContentCategoriesVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion").enummodule
388
410
  AnalyzeSentimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeSentimentRequest").msgclass
389
411
  AnalyzeSentimentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeSentimentResponse").msgclass
390
412
  AnalyzeEntitySentimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeEntitySentimentRequest").msgclass
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/language/v1/language_service.proto for package 'google.cloud.language.v1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2022 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
  require 'grpc'
21
20
  require 'google/cloud/language/v1/language_service_pb'
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Language
23
23
  module V1
24
- VERSION = "0.5.0"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  end
@@ -153,44 +153,53 @@ module Google
153
153
  # Other types of entities
154
154
  OTHER = 7
155
155
 
156
- # Phone number<br><br>
156
+ # Phone number
157
+ #
157
158
  # The metadata lists the phone number, formatted according to local
158
- # convention, plus whichever additional elements appear in the text:<ul>
159
- # <li><code>number</code> &ndash; the actual number, broken down into
160
- # sections as per local convention</li> <li><code>national_prefix</code>
161
- # &ndash; country code, if detected</li> <li><code>area_code</code> &ndash;
162
- # region or area code, if detected</li> <li><code>extension</code> &ndash;
163
- # phone extension (to be dialed after connection), if detected</li></ul>
159
+ # convention, plus whichever additional elements appear in the text:
160
+ #
161
+ # * `number` - the actual number, broken down into sections as per local
162
+ # convention
163
+ # * `national_prefix` - country code, if detected
164
+ # * `area_code` - region or area code, if detected
165
+ # * `extension` - phone extension (to be dialed after connection), if
166
+ # detected
164
167
  PHONE_NUMBER = 9
165
168
 
166
- # Address<br><br>
169
+ # Address
170
+ #
167
171
  # The metadata identifies the street number and locality plus whichever
168
- # additional elements appear in the text:<ul>
169
- # <li><code>street_number</code> &ndash; street number</li>
170
- # <li><code>locality</code> &ndash; city or town</li>
171
- # <li><code>street_name</code> &ndash; street/route name, if detected</li>
172
- # <li><code>postal_code</code> &ndash; postal code, if detected</li>
173
- # <li><code>country</code> &ndash; country, if detected</li>
174
- # <li><code>broad_region</code> &ndash; administrative area, such as the
175
- # state, if detected</li> <li><code>narrow_region</code> &ndash; smaller
176
- # administrative area, such as county, if detected</li>
177
- # <li><code>sublocality</code> &ndash; used in Asian addresses to demark a
178
- # district within a city, if detected</li></ul>
172
+ # additional elements appear in the text:
173
+ #
174
+ # * `street_number` - street number
175
+ # * `locality` - city or town
176
+ # * `street_name` - street/route name, if detected
177
+ # * `postal_code` - postal code, if detected
178
+ # * `country` - country, if detected<
179
+ # * `broad_region` - administrative area, such as the state, if detected
180
+ # * `narrow_region` - smaller administrative area, such as county, if
181
+ # detected
182
+ # * `sublocality` - used in Asian addresses to demark a district within a
183
+ # city, if detected
179
184
  ADDRESS = 10
180
185
 
181
- # Date<br><br>
182
- # The metadata identifies the components of the date:<ul>
183
- # <li><code>year</code> &ndash; four digit year, if detected</li>
184
- # <li><code>month</code> &ndash; two digit month number, if detected</li>
185
- # <li><code>day</code> &ndash; two digit day number, if detected</li></ul>
186
+ # Date
187
+ #
188
+ # The metadata identifies the components of the date:
189
+ #
190
+ # * `year` - four digit year, if detected
191
+ # * `month` - two digit month number, if detected
192
+ # * `day` - two digit day number, if detected
186
193
  DATE = 11
187
194
 
188
- # Number<br><br>
195
+ # Number
196
+ #
189
197
  # The metadata is the number itself.
190
198
  NUMBER = 12
191
199
 
192
- # Price<br><br>
193
- # The metadata identifies the <code>value</code> and <code>currency</code>.
200
+ # Price
201
+ #
202
+ # The metadata identifies the `value` and `currency`.
194
203
  PRICE = 13
195
204
  end
196
205
  end
@@ -890,10 +899,53 @@ module Google
890
899
  extend ::Google::Protobuf::MessageExts::ClassMethods
891
900
  end
892
901
 
902
+ # Model options available for classification requests.
903
+ # @!attribute [rw] v1_model
904
+ # @return [::Google::Cloud::Language::V1::ClassificationModelOptions::V1Model]
905
+ # Setting this field will use the V1 model and V1 content categories
906
+ # version. The V1 model is a legacy model; support for this will be
907
+ # discontinued in the future.
908
+ # @!attribute [rw] v2_model
909
+ # @return [::Google::Cloud::Language::V1::ClassificationModelOptions::V2Model]
910
+ # Setting this field will use the V2 model with the appropriate content
911
+ # categories version. The V2 model is a better performing model.
912
+ class ClassificationModelOptions
913
+ include ::Google::Protobuf::MessageExts
914
+ extend ::Google::Protobuf::MessageExts::ClassMethods
915
+
916
+ # Options for the V1 model.
917
+ class V1Model
918
+ include ::Google::Protobuf::MessageExts
919
+ extend ::Google::Protobuf::MessageExts::ClassMethods
920
+ end
921
+
922
+ # Options for the V2 model.
923
+ # @!attribute [rw] content_categories_version
924
+ # @return [::Google::Cloud::Language::V1::ClassificationModelOptions::V2Model::ContentCategoriesVersion]
925
+ # The content categories used for classification.
926
+ class V2Model
927
+ include ::Google::Protobuf::MessageExts
928
+ extend ::Google::Protobuf::MessageExts::ClassMethods
929
+
930
+ # The content categories used for classification.
931
+ module ContentCategoriesVersion
932
+ # If `ContentCategoriesVersion` is not specified, this option will
933
+ # default to `V1`.
934
+ CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0
935
+
936
+ # Legacy content categories of our initial launch in 2017.
937
+ V1 = 1
938
+
939
+ # Updated content categories in 2022.
940
+ V2 = 2
941
+ end
942
+ end
943
+ end
944
+
893
945
  # The sentiment analysis request message.
894
946
  # @!attribute [rw] document
895
947
  # @return [::Google::Cloud::Language::V1::Document]
896
- # Input document.
948
+ # Required. Input document.
897
949
  # @!attribute [rw] encoding_type
898
950
  # @return [::Google::Cloud::Language::V1::EncodingType]
899
951
  # The encoding type used by the API to calculate sentence offsets.
@@ -922,7 +974,7 @@ module Google
922
974
  # The entity-level sentiment analysis request message.
923
975
  # @!attribute [rw] document
924
976
  # @return [::Google::Cloud::Language::V1::Document]
925
- # Input document.
977
+ # Required. Input document.
926
978
  # @!attribute [rw] encoding_type
927
979
  # @return [::Google::Cloud::Language::V1::EncodingType]
928
980
  # The encoding type used by the API to calculate offsets.
@@ -948,7 +1000,7 @@ module Google
948
1000
  # The entity analysis request message.
949
1001
  # @!attribute [rw] document
950
1002
  # @return [::Google::Cloud::Language::V1::Document]
951
- # Input document.
1003
+ # Required. Input document.
952
1004
  # @!attribute [rw] encoding_type
953
1005
  # @return [::Google::Cloud::Language::V1::EncodingType]
954
1006
  # The encoding type used by the API to calculate offsets.
@@ -974,7 +1026,7 @@ module Google
974
1026
  # The syntax analysis request message.
975
1027
  # @!attribute [rw] document
976
1028
  # @return [::Google::Cloud::Language::V1::Document]
977
- # Input document.
1029
+ # Required. Input document.
978
1030
  # @!attribute [rw] encoding_type
979
1031
  # @return [::Google::Cloud::Language::V1::EncodingType]
980
1032
  # The encoding type used by the API to calculate offsets.
@@ -1003,7 +1055,11 @@ module Google
1003
1055
  # The document classification request message.
1004
1056
  # @!attribute [rw] document
1005
1057
  # @return [::Google::Cloud::Language::V1::Document]
1006
- # Input document.
1058
+ # Required. Input document.
1059
+ # @!attribute [rw] classification_model_options
1060
+ # @return [::Google::Cloud::Language::V1::ClassificationModelOptions]
1061
+ # Model options to use for classification. Defaults to v1 options if not
1062
+ # specified.
1007
1063
  class ClassifyTextRequest
1008
1064
  include ::Google::Protobuf::MessageExts
1009
1065
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -1022,10 +1078,10 @@ module Google
1022
1078
  # analysis types (sentiment, entities, and syntax) in one call.
1023
1079
  # @!attribute [rw] document
1024
1080
  # @return [::Google::Cloud::Language::V1::Document]
1025
- # Input document.
1081
+ # Required. Input document.
1026
1082
  # @!attribute [rw] features
1027
1083
  # @return [::Google::Cloud::Language::V1::AnnotateTextRequest::Features]
1028
- # The enabled features.
1084
+ # Required. The enabled features.
1029
1085
  # @!attribute [rw] encoding_type
1030
1086
  # @return [::Google::Cloud::Language::V1::EncodingType]
1031
1087
  # The encoding type used by the API to calculate offsets.
@@ -1050,6 +1106,10 @@ module Google
1050
1106
  # @!attribute [rw] classify_text
1051
1107
  # @return [::Boolean]
1052
1108
  # Classify the full document into categories.
1109
+ # @!attribute [rw] classification_model_options
1110
+ # @return [::Google::Cloud::Language::V1::ClassificationModelOptions]
1111
+ # The model options to use for classification. Defaults to v1 options
1112
+ # if not specified. Only used if `classify_text` is set to true.
1053
1113
  class Features
1054
1114
  include ::Google::Protobuf::MessageExts
1055
1115
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-language-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-02 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.10'
19
+ version: '0.12'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.10'
29
+ version: '0.12'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a