google-cloud-language 0.27.1 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.yardopts +2 -6
- data/LICENSE +1 -1
- data/README.md +35 -59
- data/lib/google/cloud/language.rb +81 -230
- data/lib/google/cloud/language/credentials.rb +9 -11
- data/lib/google/cloud/language/v1.rb +107 -0
- data/lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb +108 -18
- data/lib/google/cloud/language/v1/doc/overview.rb +67 -0
- data/lib/google/cloud/language/v1/language_service_client.rb +157 -67
- data/lib/google/cloud/language/v1/language_service_client_config.json +10 -0
- data/lib/google/cloud/language/v1/language_service_pb.rb +34 -0
- data/lib/google/cloud/language/v1/language_service_services_pb.rb +5 -0
- data/lib/google/cloud/language/v1beta2.rb +107 -0
- data/lib/google/cloud/language/v1beta2/doc/google/cloud/language/v1beta2/language_service.rb +29 -0
- data/lib/google/cloud/language/v1beta2/doc/overview.rb +67 -0
- data/lib/google/cloud/language/v1beta2/language_service_client.rb +5 -6
- data/lib/google/cloud/language/v1beta2/language_service_pb.rb +6 -0
- metadata +24 -100
- data/lib/google-cloud-language.rb +0 -112
- data/lib/google/cloud/language/annotation.rb +0 -1084
- data/lib/google/cloud/language/convert.rb +0 -35
- data/lib/google/cloud/language/document.rb +0 -375
- data/lib/google/cloud/language/project.rb +0 -376
- data/lib/google/cloud/language/service.rb +0 -143
- data/lib/google/cloud/language/version.rb +0 -22
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2017, Google
|
1
|
+
# Copyright 2017, Google LLC All rights reserved.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -28,6 +28,7 @@ require "pathname"
|
|
28
28
|
require "google/gax"
|
29
29
|
|
30
30
|
require "google/cloud/language/v1/language_service_pb"
|
31
|
+
require "google/cloud/language/credentials"
|
31
32
|
|
32
33
|
module Google
|
33
34
|
module Cloud
|
@@ -55,21 +56,24 @@ module Google
|
|
55
56
|
"https://www.googleapis.com/auth/cloud-platform"
|
56
57
|
].freeze
|
57
58
|
|
58
|
-
# @param
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
# A
|
64
|
-
#
|
65
|
-
# A
|
66
|
-
#
|
67
|
-
# A
|
68
|
-
#
|
59
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
60
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
61
|
+
# be many types.
|
62
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
63
|
+
# authenticating requests made by this client.
|
64
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
65
|
+
# credentials for this client.
|
66
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
67
|
+
# credentials for this client.
|
68
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
69
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
70
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
71
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
72
|
+
# metadata for requests, generally, to give OAuth credentials.
|
69
73
|
# @param scopes [Array<String>]
|
70
74
|
# The OAuth scopes for this service. This parameter is ignored if
|
71
75
|
# an updater_proc is supplied.
|
72
|
-
# @param client_config[Hash]
|
76
|
+
# @param client_config [Hash]
|
73
77
|
# A Hash for call options for each method. See
|
74
78
|
# Google::Gax#construct_settings for the structure of
|
75
79
|
# this data. Falls back to the default config if not specified
|
@@ -82,11 +86,10 @@ module Google
|
|
82
86
|
channel: nil,
|
83
87
|
chan_creds: nil,
|
84
88
|
updater_proc: nil,
|
89
|
+
credentials: nil,
|
85
90
|
scopes: ALL_SCOPES,
|
86
91
|
client_config: {},
|
87
92
|
timeout: DEFAULT_TIMEOUT,
|
88
|
-
app_name: nil,
|
89
|
-
app_version: nil,
|
90
93
|
lib_name: nil,
|
91
94
|
lib_version: ""
|
92
95
|
# These require statements are intentionally placed here to initialize
|
@@ -95,14 +98,38 @@ module Google
|
|
95
98
|
require "google/gax/grpc"
|
96
99
|
require "google/cloud/language/v1/language_service_services_pb"
|
97
100
|
|
101
|
+
if channel || chan_creds || updater_proc
|
102
|
+
warn "The `channel`, `chan_creds`, and `updater_proc` parameters will be removed " \
|
103
|
+
"on 2017/09/08"
|
104
|
+
credentials ||= channel
|
105
|
+
credentials ||= chan_creds
|
106
|
+
credentials ||= updater_proc
|
107
|
+
end
|
108
|
+
if service_path != SERVICE_ADDRESS || port != DEFAULT_SERVICE_PORT
|
109
|
+
warn "`service_path` and `port` parameters are deprecated and will be removed"
|
110
|
+
end
|
98
111
|
|
99
|
-
|
100
|
-
|
112
|
+
credentials ||= Google::Cloud::Language::Credentials.default
|
113
|
+
|
114
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
115
|
+
updater_proc = Google::Cloud::Language::Credentials.new(credentials).updater_proc
|
116
|
+
end
|
117
|
+
if credentials.is_a?(GRPC::Core::Channel)
|
118
|
+
channel = credentials
|
119
|
+
end
|
120
|
+
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
121
|
+
chan_creds = credentials
|
122
|
+
end
|
123
|
+
if credentials.is_a?(Proc)
|
124
|
+
updater_proc = credentials
|
125
|
+
end
|
126
|
+
if credentials.is_a?(Google::Auth::Credentials)
|
127
|
+
updater_proc = credentials.updater_proc
|
101
128
|
end
|
102
129
|
|
103
130
|
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
104
131
|
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
105
|
-
google_api_client << " gapic/0.
|
132
|
+
google_api_client << " gapic/0.1.0 gax/#{Google::Gax::VERSION}"
|
106
133
|
google_api_client << " grpc/#{GRPC::VERSION}"
|
107
134
|
google_api_client.freeze
|
108
135
|
|
@@ -139,10 +166,18 @@ module Google
|
|
139
166
|
@language_service_stub.method(:analyze_entities),
|
140
167
|
defaults["analyze_entities"]
|
141
168
|
)
|
169
|
+
@analyze_entity_sentiment = Google::Gax.create_api_call(
|
170
|
+
@language_service_stub.method(:analyze_entity_sentiment),
|
171
|
+
defaults["analyze_entity_sentiment"]
|
172
|
+
)
|
142
173
|
@analyze_syntax = Google::Gax.create_api_call(
|
143
174
|
@language_service_stub.method(:analyze_syntax),
|
144
175
|
defaults["analyze_syntax"]
|
145
176
|
)
|
177
|
+
@classify_text = Google::Gax.create_api_call(
|
178
|
+
@language_service_stub.method(:classify_text),
|
179
|
+
defaults["classify_text"]
|
180
|
+
)
|
146
181
|
@annotate_text = Google::Gax.create_api_call(
|
147
182
|
@language_service_stub.method(:annotate_text),
|
148
183
|
defaults["annotate_text"]
|
@@ -153,9 +188,10 @@ module Google
|
|
153
188
|
|
154
189
|
# Analyzes the sentiment of the provided text.
|
155
190
|
#
|
156
|
-
# @param document [Google::Cloud::Language::V1::Document]
|
157
|
-
# Input document.
|
158
|
-
#
|
191
|
+
# @param document [Google::Cloud::Language::V1::Document | Hash]
|
192
|
+
# Input document.
|
193
|
+
# A hash of the same form as `Google::Cloud::Language::V1::Document`
|
194
|
+
# can also be provided.
|
159
195
|
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
160
196
|
# The encoding type used by the API to calculate sentence offsets.
|
161
197
|
# @param options [Google::Gax::CallOptions]
|
@@ -166,21 +202,19 @@ module Google
|
|
166
202
|
# @example
|
167
203
|
# require "google/cloud/language/v1"
|
168
204
|
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
# language_service_client = LanguageServiceClient.new
|
173
|
-
# document = Document.new
|
205
|
+
# language_service_client = Google::Cloud::Language::V1.new
|
206
|
+
# document = {}
|
174
207
|
# response = language_service_client.analyze_sentiment(document)
|
175
208
|
|
176
209
|
def analyze_sentiment \
|
177
210
|
document,
|
178
211
|
encoding_type: nil,
|
179
212
|
options: nil
|
180
|
-
req =
|
213
|
+
req = {
|
181
214
|
document: document,
|
182
215
|
encoding_type: encoding_type
|
183
|
-
}.delete_if { |_, v| v.nil? }
|
216
|
+
}.delete_if { |_, v| v.nil? }
|
217
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Language::V1::AnalyzeSentimentRequest)
|
184
218
|
@analyze_sentiment.call(req, options)
|
185
219
|
end
|
186
220
|
|
@@ -188,8 +222,10 @@ module Google
|
|
188
222
|
# along with entity types, salience, mentions for each entity, and
|
189
223
|
# other properties.
|
190
224
|
#
|
191
|
-
# @param document [Google::Cloud::Language::V1::Document]
|
225
|
+
# @param document [Google::Cloud::Language::V1::Document | Hash]
|
192
226
|
# Input document.
|
227
|
+
# A hash of the same form as `Google::Cloud::Language::V1::Document`
|
228
|
+
# can also be provided.
|
193
229
|
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
194
230
|
# The encoding type used by the API to calculate offsets.
|
195
231
|
# @param options [Google::Gax::CallOptions]
|
@@ -200,32 +236,63 @@ module Google
|
|
200
236
|
# @example
|
201
237
|
# require "google/cloud/language/v1"
|
202
238
|
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
# language_service_client = LanguageServiceClient.new
|
208
|
-
# document = Document.new
|
209
|
-
# encoding_type = EncodingType::NONE
|
210
|
-
# response = language_service_client.analyze_entities(document, encoding_type)
|
239
|
+
# language_service_client = Google::Cloud::Language::V1.new
|
240
|
+
# document = {}
|
241
|
+
# response = language_service_client.analyze_entities(document)
|
211
242
|
|
212
243
|
def analyze_entities \
|
213
244
|
document,
|
214
|
-
encoding_type,
|
245
|
+
encoding_type: nil,
|
215
246
|
options: nil
|
216
|
-
req =
|
247
|
+
req = {
|
217
248
|
document: document,
|
218
249
|
encoding_type: encoding_type
|
219
|
-
}.delete_if { |_, v| v.nil? }
|
250
|
+
}.delete_if { |_, v| v.nil? }
|
251
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Language::V1::AnalyzeEntitiesRequest)
|
220
252
|
@analyze_entities.call(req, options)
|
221
253
|
end
|
222
254
|
|
255
|
+
# Finds entities, similar to {Google::Cloud::Language::V1::LanguageService::AnalyzeEntities AnalyzeEntities} in the text and analyzes
|
256
|
+
# sentiment associated with each entity and its mentions.
|
257
|
+
#
|
258
|
+
# @param document [Google::Cloud::Language::V1::Document | Hash]
|
259
|
+
# Input document.
|
260
|
+
# A hash of the same form as `Google::Cloud::Language::V1::Document`
|
261
|
+
# can also be provided.
|
262
|
+
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
263
|
+
# The encoding type used by the API to calculate offsets.
|
264
|
+
# @param options [Google::Gax::CallOptions]
|
265
|
+
# Overrides the default settings for this call, e.g, timeout,
|
266
|
+
# retries, etc.
|
267
|
+
# @return [Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse]
|
268
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
269
|
+
# @example
|
270
|
+
# require "google/cloud/language/v1"
|
271
|
+
#
|
272
|
+
# language_service_client = Google::Cloud::Language::V1.new
|
273
|
+
# document = {}
|
274
|
+
# response = language_service_client.analyze_entity_sentiment(document)
|
275
|
+
|
276
|
+
def analyze_entity_sentiment \
|
277
|
+
document,
|
278
|
+
encoding_type: nil,
|
279
|
+
options: nil
|
280
|
+
req = {
|
281
|
+
document: document,
|
282
|
+
encoding_type: encoding_type
|
283
|
+
}.delete_if { |_, v| v.nil? }
|
284
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest)
|
285
|
+
@analyze_entity_sentiment.call(req, options)
|
286
|
+
end
|
287
|
+
|
223
288
|
# Analyzes the syntax of the text and provides sentence boundaries and
|
224
289
|
# tokenization along with part of speech tags, dependency trees, and other
|
225
290
|
# properties.
|
226
291
|
#
|
227
|
-
# @param document [Google::Cloud::Language::V1::Document]
|
292
|
+
# @param document [Google::Cloud::Language::V1::Document | Hash]
|
228
293
|
# Input document.
|
294
|
+
# A hash of the same form as `Google::Cloud::Language::V1::Document`
|
295
|
+
# can also be provided.
|
229
296
|
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
230
297
|
# The encoding type used by the API to calculate offsets.
|
231
298
|
# @param options [Google::Gax::CallOptions]
|
@@ -236,33 +303,61 @@ module Google
|
|
236
303
|
# @example
|
237
304
|
# require "google/cloud/language/v1"
|
238
305
|
#
|
239
|
-
#
|
240
|
-
#
|
241
|
-
#
|
242
|
-
#
|
243
|
-
# language_service_client = LanguageServiceClient.new
|
244
|
-
# document = Document.new
|
245
|
-
# encoding_type = EncodingType::NONE
|
246
|
-
# response = language_service_client.analyze_syntax(document, encoding_type)
|
306
|
+
# language_service_client = Google::Cloud::Language::V1.new
|
307
|
+
# document = {}
|
308
|
+
# response = language_service_client.analyze_syntax(document)
|
247
309
|
|
248
310
|
def analyze_syntax \
|
249
311
|
document,
|
250
|
-
encoding_type,
|
312
|
+
encoding_type: nil,
|
251
313
|
options: nil
|
252
|
-
req =
|
314
|
+
req = {
|
253
315
|
document: document,
|
254
316
|
encoding_type: encoding_type
|
255
|
-
}.delete_if { |_, v| v.nil? }
|
317
|
+
}.delete_if { |_, v| v.nil? }
|
318
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Language::V1::AnalyzeSyntaxRequest)
|
256
319
|
@analyze_syntax.call(req, options)
|
257
320
|
end
|
258
321
|
|
322
|
+
# Classifies a document into categories.
|
323
|
+
#
|
324
|
+
# @param document [Google::Cloud::Language::V1::Document | Hash]
|
325
|
+
# Input document.
|
326
|
+
# A hash of the same form as `Google::Cloud::Language::V1::Document`
|
327
|
+
# can also be provided.
|
328
|
+
# @param options [Google::Gax::CallOptions]
|
329
|
+
# Overrides the default settings for this call, e.g, timeout,
|
330
|
+
# retries, etc.
|
331
|
+
# @return [Google::Cloud::Language::V1::ClassifyTextResponse]
|
332
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
333
|
+
# @example
|
334
|
+
# require "google/cloud/language/v1"
|
335
|
+
#
|
336
|
+
# language_service_client = Google::Cloud::Language::V1.new
|
337
|
+
# document = {}
|
338
|
+
# response = language_service_client.classify_text(document)
|
339
|
+
|
340
|
+
def classify_text \
|
341
|
+
document,
|
342
|
+
options: nil
|
343
|
+
req = {
|
344
|
+
document: document
|
345
|
+
}.delete_if { |_, v| v.nil? }
|
346
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Language::V1::ClassifyTextRequest)
|
347
|
+
@classify_text.call(req, options)
|
348
|
+
end
|
349
|
+
|
259
350
|
# A convenience method that provides all the features that analyzeSentiment,
|
260
351
|
# analyzeEntities, and analyzeSyntax provide in one call.
|
261
352
|
#
|
262
|
-
# @param document [Google::Cloud::Language::V1::Document]
|
353
|
+
# @param document [Google::Cloud::Language::V1::Document | Hash]
|
263
354
|
# Input document.
|
264
|
-
#
|
355
|
+
# A hash of the same form as `Google::Cloud::Language::V1::Document`
|
356
|
+
# can also be provided.
|
357
|
+
# @param features [Google::Cloud::Language::V1::AnnotateTextRequest::Features | Hash]
|
265
358
|
# The enabled features.
|
359
|
+
# A hash of the same form as `Google::Cloud::Language::V1::AnnotateTextRequest::Features`
|
360
|
+
# can also be provided.
|
266
361
|
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
267
362
|
# The encoding type used by the API to calculate offsets.
|
268
363
|
# @param options [Google::Gax::CallOptions]
|
@@ -273,27 +368,22 @@ module Google
|
|
273
368
|
# @example
|
274
369
|
# require "google/cloud/language/v1"
|
275
370
|
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
# language_service_client = LanguageServiceClient.new
|
282
|
-
# document = Document.new
|
283
|
-
# features = Features.new
|
284
|
-
# encoding_type = EncodingType::NONE
|
285
|
-
# response = language_service_client.annotate_text(document, features, encoding_type)
|
371
|
+
# language_service_client = Google::Cloud::Language::V1.new
|
372
|
+
# document = {}
|
373
|
+
# features = {}
|
374
|
+
# response = language_service_client.annotate_text(document, features)
|
286
375
|
|
287
376
|
def annotate_text \
|
288
377
|
document,
|
289
378
|
features,
|
290
|
-
encoding_type,
|
379
|
+
encoding_type: nil,
|
291
380
|
options: nil
|
292
|
-
req =
|
381
|
+
req = {
|
293
382
|
document: document,
|
294
383
|
features: features,
|
295
384
|
encoding_type: encoding_type
|
296
|
-
}.delete_if { |_, v| v.nil? }
|
385
|
+
}.delete_if { |_, v| v.nil? }
|
386
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Language::V1::AnnotateTextRequest)
|
297
387
|
@annotate_text.call(req, options)
|
298
388
|
end
|
299
389
|
end
|
@@ -30,11 +30,21 @@
|
|
30
30
|
"retry_codes_name": "idempotent",
|
31
31
|
"retry_params_name": "default"
|
32
32
|
},
|
33
|
+
"AnalyzeEntitySentiment": {
|
34
|
+
"timeout_millis": 30000,
|
35
|
+
"retry_codes_name": "idempotent",
|
36
|
+
"retry_params_name": "default"
|
37
|
+
},
|
33
38
|
"AnalyzeSyntax": {
|
34
39
|
"timeout_millis": 30000,
|
35
40
|
"retry_codes_name": "idempotent",
|
36
41
|
"retry_params_name": "default"
|
37
42
|
},
|
43
|
+
"ClassifyText": {
|
44
|
+
"timeout_millis": 30000,
|
45
|
+
"retry_codes_name": "idempotent",
|
46
|
+
"retry_params_name": "default"
|
47
|
+
},
|
38
48
|
"AnnotateText": {
|
39
49
|
"timeout_millis": 30000,
|
40
50
|
"retry_codes_name": "idempotent",
|
@@ -28,6 +28,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
28
28
|
map :metadata, :string, :string, 3
|
29
29
|
optional :salience, :float, 4
|
30
30
|
repeated :mentions, :message, 5, "google.cloud.language.v1.EntityMention"
|
31
|
+
optional :sentiment, :message, 6, "google.cloud.language.v1.Sentiment"
|
31
32
|
end
|
32
33
|
add_enum "google.cloud.language.v1.Entity.Type" do
|
33
34
|
value :UNKNOWN, 0
|
@@ -251,10 +252,17 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
251
252
|
value :NUMC, 74
|
252
253
|
value :COP, 75
|
253
254
|
value :DISLOCATED, 76
|
255
|
+
value :ASP, 77
|
256
|
+
value :GMOD, 78
|
257
|
+
value :GOBJ, 79
|
258
|
+
value :INFMOD, 80
|
259
|
+
value :MES, 81
|
260
|
+
value :NCOMP, 82
|
254
261
|
end
|
255
262
|
add_message "google.cloud.language.v1.EntityMention" do
|
256
263
|
optional :text, :message, 1, "google.cloud.language.v1.TextSpan"
|
257
264
|
optional :type, :enum, 2, "google.cloud.language.v1.EntityMention.Type"
|
265
|
+
optional :sentiment, :message, 3, "google.cloud.language.v1.Sentiment"
|
258
266
|
end
|
259
267
|
add_enum "google.cloud.language.v1.EntityMention.Type" do
|
260
268
|
value :TYPE_UNKNOWN, 0
|
@@ -265,6 +273,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
265
273
|
optional :content, :string, 1
|
266
274
|
optional :begin_offset, :int32, 2
|
267
275
|
end
|
276
|
+
add_message "google.cloud.language.v1.ClassificationCategory" do
|
277
|
+
optional :name, :string, 1
|
278
|
+
optional :confidence, :float, 2
|
279
|
+
end
|
268
280
|
add_message "google.cloud.language.v1.AnalyzeSentimentRequest" do
|
269
281
|
optional :document, :message, 1, "google.cloud.language.v1.Document"
|
270
282
|
optional :encoding_type, :enum, 2, "google.cloud.language.v1.EncodingType"
|
@@ -274,6 +286,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
274
286
|
optional :language, :string, 2
|
275
287
|
repeated :sentences, :message, 3, "google.cloud.language.v1.Sentence"
|
276
288
|
end
|
289
|
+
add_message "google.cloud.language.v1.AnalyzeEntitySentimentRequest" do
|
290
|
+
optional :document, :message, 1, "google.cloud.language.v1.Document"
|
291
|
+
optional :encoding_type, :enum, 2, "google.cloud.language.v1.EncodingType"
|
292
|
+
end
|
293
|
+
add_message "google.cloud.language.v1.AnalyzeEntitySentimentResponse" do
|
294
|
+
repeated :entities, :message, 1, "google.cloud.language.v1.Entity"
|
295
|
+
optional :language, :string, 2
|
296
|
+
end
|
277
297
|
add_message "google.cloud.language.v1.AnalyzeEntitiesRequest" do
|
278
298
|
optional :document, :message, 1, "google.cloud.language.v1.Document"
|
279
299
|
optional :encoding_type, :enum, 2, "google.cloud.language.v1.EncodingType"
|
@@ -291,6 +311,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
291
311
|
repeated :tokens, :message, 2, "google.cloud.language.v1.Token"
|
292
312
|
optional :language, :string, 3
|
293
313
|
end
|
314
|
+
add_message "google.cloud.language.v1.ClassifyTextRequest" do
|
315
|
+
optional :document, :message, 1, "google.cloud.language.v1.Document"
|
316
|
+
end
|
317
|
+
add_message "google.cloud.language.v1.ClassifyTextResponse" do
|
318
|
+
repeated :categories, :message, 1, "google.cloud.language.v1.ClassificationCategory"
|
319
|
+
end
|
294
320
|
add_message "google.cloud.language.v1.AnnotateTextRequest" do
|
295
321
|
optional :document, :message, 1, "google.cloud.language.v1.Document"
|
296
322
|
optional :features, :message, 2, "google.cloud.language.v1.AnnotateTextRequest.Features"
|
@@ -300,6 +326,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
300
326
|
optional :extract_syntax, :bool, 1
|
301
327
|
optional :extract_entities, :bool, 2
|
302
328
|
optional :extract_document_sentiment, :bool, 3
|
329
|
+
optional :extract_entity_sentiment, :bool, 4
|
330
|
+
optional :classify_text, :bool, 6
|
303
331
|
end
|
304
332
|
add_message "google.cloud.language.v1.AnnotateTextResponse" do
|
305
333
|
repeated :sentences, :message, 1, "google.cloud.language.v1.Sentence"
|
@@ -307,6 +335,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
307
335
|
repeated :entities, :message, 3, "google.cloud.language.v1.Entity"
|
308
336
|
optional :document_sentiment, :message, 4, "google.cloud.language.v1.Sentiment"
|
309
337
|
optional :language, :string, 5
|
338
|
+
repeated :categories, :message, 6, "google.cloud.language.v1.ClassificationCategory"
|
310
339
|
end
|
311
340
|
add_enum "google.cloud.language.v1.EncodingType" do
|
312
341
|
value :NONE, 0
|
@@ -345,12 +374,17 @@ module Google
|
|
345
374
|
EntityMention = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.EntityMention").msgclass
|
346
375
|
EntityMention::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.EntityMention.Type").enummodule
|
347
376
|
TextSpan = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.TextSpan").msgclass
|
377
|
+
ClassificationCategory = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassificationCategory").msgclass
|
348
378
|
AnalyzeSentimentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeSentimentRequest").msgclass
|
349
379
|
AnalyzeSentimentResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeSentimentResponse").msgclass
|
380
|
+
AnalyzeEntitySentimentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeEntitySentimentRequest").msgclass
|
381
|
+
AnalyzeEntitySentimentResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeEntitySentimentResponse").msgclass
|
350
382
|
AnalyzeEntitiesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeEntitiesRequest").msgclass
|
351
383
|
AnalyzeEntitiesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeEntitiesResponse").msgclass
|
352
384
|
AnalyzeSyntaxRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeSyntaxRequest").msgclass
|
353
385
|
AnalyzeSyntaxResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnalyzeSyntaxResponse").msgclass
|
386
|
+
ClassifyTextRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassifyTextRequest").msgclass
|
387
|
+
ClassifyTextResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.ClassifyTextResponse").msgclass
|
354
388
|
AnnotateTextRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnnotateTextRequest").msgclass
|
355
389
|
AnnotateTextRequest::Features = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnnotateTextRequest.Features").msgclass
|
356
390
|
AnnotateTextResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1.AnnotateTextResponse").msgclass
|