google-cloud-language 0.33.1 → 0.34.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: 58f8cf8b51f275e7265b27ef1504dac3df1d9a3f17300b3af84a3d892cd0b598
4
- data.tar.gz: 3625d7633d2efeddc8e8ea04123aff3f93b54e555a51d5fe5c24119441c3a18e
3
+ metadata.gz: 9e9de61824a89be458485342e9e57335609fad2ffb07d764546088848ffb2c6f
4
+ data.tar.gz: d444740ca28ff379ca8bf7a03a4dee229f844e1026c6ed27d664689e2bf44bff
5
5
  SHA512:
6
- metadata.gz: 9a2d78215cb535512d9ef79088529b34a6a92c5827f3e441d3146ffd5869afa76683fc0b90622013e80698e4f3d458fe72b4e9a1edc4cb7ba201feda4810c3ea
7
- data.tar.gz: 7c00b29dc0622077fefc39e1e73caf985f48bb1342e049a5f8a9c50be18b1cb3e280d7d697c3341f01a436f97a5b2c95777672e071b59eca8185461baca1ed7a
6
+ metadata.gz: 693f398b70c59aa6df35aa6f895805cac627a3b913d000692fa42f485296c869ea6846efdfd87b88b4affc778c02ee805687d86d6a6562c6cf604a1ccc18bfbe
7
+ data.tar.gz: 421f7fcdaec40040424e1fb4add3ebb6196c21867c49eec330011034f9e1795ffcde352caab3766b203c0bd375003bbadd1472db260253007f684594d5c541e7
@@ -27,6 +27,7 @@ module Google
27
27
  # @!attribute [rw] content
28
28
  # @return [String]
29
29
  # The content of the input in string format.
30
+ # Cloud audit logging exempt since it is based on user data.
30
31
  # @!attribute [rw] gcs_content_uri
31
32
  # @return [String]
32
33
  # The Google Cloud Storage URI where the file content is located.
@@ -64,8 +65,8 @@ module Google
64
65
  # @!attribute [rw] sentiment
65
66
  # @return [Google::Cloud::Language::V1beta2::Sentiment]
66
67
  # For calls to {AnalyzeSentiment} or if
67
- # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest::Features#extract_document_sentiment}
68
- # is set to true, this field will contain the sentiment for the sentence.
68
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest::Features#extract_document_sentiment} is set to
69
+ # true, this field will contain the sentiment for the sentence.
69
70
  class Sentence; end
70
71
 
71
72
  # Represents a phrase in the text that is a known entity, such as
@@ -81,8 +82,9 @@ module Google
81
82
  # @return [Hash{String => String}]
82
83
  # Metadata associated with the entity.
83
84
  #
84
- # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
85
- # available. The associated keys are "wikipedia_url" and "mid", respectively.
85
+ # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
86
+ # and Knowledge Graph MID (`mid`), if they are available. For the metadata
87
+ # associated with other entity types, see the Type table below.
86
88
  # @!attribute [rw] salience
87
89
  # @return [Float]
88
90
  # The salience score associated with the entity in the [0, 1.0] range.
@@ -98,11 +100,14 @@ module Google
98
100
  # @!attribute [rw] sentiment
99
101
  # @return [Google::Cloud::Language::V1beta2::Sentiment]
100
102
  # For calls to {AnalyzeEntitySentiment} or if
101
- # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest::Features#extract_entity_sentiment}
102
- # is set to true, this field will contain the aggregate sentiment expressed
103
- # for this entity in the provided document.
103
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest::Features#extract_entity_sentiment} is set to
104
+ # true, this field will contain the aggregate sentiment expressed for this
105
+ # entity in the provided document.
104
106
  class Entity
105
- # The type of the entity.
107
+ # The type of the entity. For most entity types, the associated metadata is a
108
+ # Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
109
+ # below lists the associated fields for entities that have different
110
+ # metadata.
106
111
  module Type
107
112
  # Unknown
108
113
  UNKNOWN = 0
@@ -119,14 +124,63 @@ module Google
119
124
  # Event
120
125
  EVENT = 4
121
126
 
122
- # Work of art
127
+ # Artwork
123
128
  WORK_OF_ART = 5
124
129
 
125
- # Consumer goods
130
+ # Consumer product
126
131
  CONSUMER_GOOD = 6
127
132
 
128
- # Other types
133
+ # Other types of entities
129
134
  OTHER = 7
135
+
136
+ # Phone number
137
+ #
138
+ # The metadata lists the phone number, formatted according to local
139
+ # convention, plus whichever additional elements appear in the text:
140
+ #
141
+ # * `number` - the actual number, broken down into sections as per local
142
+ # convention
143
+ # * `national_prefix` - country code, if detected
144
+ # * `area_code` - region or area code, if detected
145
+ # * `extension` - phone extension (to be dialed after connection), if
146
+ # detected
147
+ PHONE_NUMBER = 9
148
+
149
+ # Address
150
+ #
151
+ # The metadata identifies the street number and locality plus whichever
152
+ # additional elements appear in the text:
153
+ #
154
+ # * `street_number` - street number
155
+ # * `locality` - city or town
156
+ # * `street_name` - street/route name, if detected
157
+ # * `postal_code` - postal code, if detected
158
+ # * `country` - country, if detected<
159
+ # * `broad_region` - administrative area, such as the state, if detected
160
+ # * `narrow_region` - smaller administrative area, such as county, if
161
+ # detected
162
+ # * `sublocality` - used in Asian addresses to demark a district within a
163
+ # city, if detected
164
+ ADDRESS = 10
165
+
166
+ # Date
167
+ #
168
+ # The metadata identifies the components of the date:
169
+ #
170
+ # * `year` - four digit year, if detected
171
+ # * `month` - two digit month number, if detected
172
+ # * `day` - two digit day number, if detected
173
+ DATE = 11
174
+
175
+ # Number
176
+ #
177
+ # The metadata is the number itself.
178
+ NUMBER = 12
179
+
180
+ # Price
181
+ #
182
+ # The metadata identifies the `value` and `currency`.
183
+ PRICE = 13
130
184
  end
131
185
  end
132
186
 
@@ -147,6 +201,7 @@ module Google
147
201
 
148
202
  # Represents the feeling associated with the entire text or entities in
149
203
  # the text.
204
+ # Next ID: 6
150
205
  # @!attribute [rw] magnitude
151
206
  # @return [Float]
152
207
  # A non-negative number in the [0, +inf) range, which represents
@@ -762,9 +817,9 @@ module Google
762
817
  # @!attribute [rw] sentiment
763
818
  # @return [Google::Cloud::Language::V1beta2::Sentiment]
764
819
  # For calls to {AnalyzeEntitySentiment} or if
765
- # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest::Features#extract_entity_sentiment}
766
- # is set to true, this field will contain the sentiment expressed for this
767
- # mention of the entity in the provided document.
820
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest::Features#extract_entity_sentiment} is set to
821
+ # true, this field will contain the sentiment expressed for this mention of
822
+ # the entity in the provided document.
768
823
  class EntityMention
769
824
  # The supported types of mentions.
770
825
  module Type
@@ -786,15 +841,14 @@ module Google
786
841
  # @!attribute [rw] begin_offset
787
842
  # @return [Integer]
788
843
  # The API calculates the beginning offset of the content in the original
789
- # document according to the
790
- # {Google::Cloud::Language::V1beta2::EncodingType EncodingType} specified in the
791
- # API request.
844
+ # document according to the {Google::Cloud::Language::V1beta2::EncodingType EncodingType} specified in the API request.
792
845
  class TextSpan; end
793
846
 
794
847
  # Represents a category returned from the text classifier.
795
848
  # @!attribute [rw] name
796
849
  # @return [String]
797
- # The name of the category representing the document.
850
+ # The name of the category representing the document, from the [predefined
851
+ # taxonomy](/natural-language/docs/categories).
798
852
  # @!attribute [rw] confidence
799
853
  # @return [Float]
800
854
  # The classifier's confidence of the category. Number represents how certain
@@ -804,7 +858,7 @@ module Google
804
858
  # The sentiment analysis request message.
805
859
  # @!attribute [rw] document
806
860
  # @return [Google::Cloud::Language::V1beta2::Document]
807
- # Input document.
861
+ # Required. Input document.
808
862
  # @!attribute [rw] encoding_type
809
863
  # @return [Google::Cloud::Language::V1beta2::EncodingType]
810
864
  # The encoding type used by the API to calculate sentence offsets for the
@@ -819,8 +873,7 @@ module Google
819
873
  # @return [String]
820
874
  # The language of the text, which will be the same as the language specified
821
875
  # in the request or, if not specified, the automatically-detected language.
822
- # See {Google::Cloud::Language::V1beta2::Document#language Document#language}
823
- # field for more details.
876
+ # See {Google::Cloud::Language::V1beta2::Document#language Document#language} field for more details.
824
877
  # @!attribute [rw] sentences
825
878
  # @return [Array<Google::Cloud::Language::V1beta2::Sentence>]
826
879
  # The sentiment for all the sentences in the document.
@@ -829,7 +882,7 @@ module Google
829
882
  # The entity-level sentiment analysis request message.
830
883
  # @!attribute [rw] document
831
884
  # @return [Google::Cloud::Language::V1beta2::Document]
832
- # Input document.
885
+ # Required. Input document.
833
886
  # @!attribute [rw] encoding_type
834
887
  # @return [Google::Cloud::Language::V1beta2::EncodingType]
835
888
  # The encoding type used by the API to calculate offsets.
@@ -843,14 +896,13 @@ module Google
843
896
  # @return [String]
844
897
  # The language of the text, which will be the same as the language specified
845
898
  # in the request or, if not specified, the automatically-detected language.
846
- # See {Google::Cloud::Language::V1beta2::Document#language Document#language}
847
- # field for more details.
899
+ # See {Google::Cloud::Language::V1beta2::Document#language Document#language} field for more details.
848
900
  class AnalyzeEntitySentimentResponse; end
849
901
 
850
902
  # The entity analysis request message.
851
903
  # @!attribute [rw] document
852
904
  # @return [Google::Cloud::Language::V1beta2::Document]
853
- # Input document.
905
+ # Required. Input document.
854
906
  # @!attribute [rw] encoding_type
855
907
  # @return [Google::Cloud::Language::V1beta2::EncodingType]
856
908
  # The encoding type used by the API to calculate offsets.
@@ -864,14 +916,13 @@ module Google
864
916
  # @return [String]
865
917
  # The language of the text, which will be the same as the language specified
866
918
  # in the request or, if not specified, the automatically-detected language.
867
- # See {Google::Cloud::Language::V1beta2::Document#language Document#language}
868
- # field for more details.
919
+ # See {Google::Cloud::Language::V1beta2::Document#language Document#language} field for more details.
869
920
  class AnalyzeEntitiesResponse; end
870
921
 
871
922
  # The syntax analysis request message.
872
923
  # @!attribute [rw] document
873
924
  # @return [Google::Cloud::Language::V1beta2::Document]
874
- # Input document.
925
+ # Required. Input document.
875
926
  # @!attribute [rw] encoding_type
876
927
  # @return [Google::Cloud::Language::V1beta2::EncodingType]
877
928
  # The encoding type used by the API to calculate offsets.
@@ -888,14 +939,13 @@ module Google
888
939
  # @return [String]
889
940
  # The language of the text, which will be the same as the language specified
890
941
  # in the request or, if not specified, the automatically-detected language.
891
- # See {Google::Cloud::Language::V1beta2::Document#language Document#language}
892
- # field for more details.
942
+ # See {Google::Cloud::Language::V1beta2::Document#language Document#language} field for more details.
893
943
  class AnalyzeSyntaxResponse; end
894
944
 
895
945
  # The document classification request message.
896
946
  # @!attribute [rw] document
897
947
  # @return [Google::Cloud::Language::V1beta2::Document]
898
- # Input document.
948
+ # Required. Input document.
899
949
  class ClassifyTextRequest; end
900
950
 
901
951
  # The document classification response message.
@@ -908,16 +958,17 @@ module Google
908
958
  # analysis types (sentiment, entities, and syntax) in one call.
909
959
  # @!attribute [rw] document
910
960
  # @return [Google::Cloud::Language::V1beta2::Document]
911
- # Input document.
961
+ # Required. Input document.
912
962
  # @!attribute [rw] features
913
963
  # @return [Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features]
914
- # The enabled features.
964
+ # Required. The enabled features.
915
965
  # @!attribute [rw] encoding_type
916
966
  # @return [Google::Cloud::Language::V1beta2::EncodingType]
917
967
  # The encoding type used by the API to calculate offsets.
918
968
  class AnnotateTextRequest
919
969
  # All available features for sentiment, syntax, and semantic analysis.
920
970
  # Setting each one to true will enable that specific analysis for the input.
971
+ # Next ID: 10
921
972
  # @!attribute [rw] extract_syntax
922
973
  # @return [true, false]
923
974
  # Extract syntax information.
@@ -932,7 +983,9 @@ module Google
932
983
  # Extract entities and their associated sentiment.
933
984
  # @!attribute [rw] classify_text
934
985
  # @return [true, false]
935
- # Classify the full document into categories.
986
+ # Classify the full document into categories. If this is true,
987
+ # the API will use the default model which classifies into a
988
+ # [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories).
936
989
  class Features; end
937
990
  end
938
991
 
@@ -959,8 +1012,7 @@ module Google
959
1012
  # @return [String]
960
1013
  # The language of the text, which will be the same as the language specified
961
1014
  # in the request or, if not specified, the automatically-detected language.
962
- # See {Google::Cloud::Language::V1beta2::Document#language Document#language}
963
- # field for more details.
1015
+ # See {Google::Cloud::Language::V1beta2::Document#language Document#language} field for more details.
964
1016
  # @!attribute [rw] categories
965
1017
  # @return [Array<Google::Cloud::Language::V1beta2::ClassificationCategory>]
966
1018
  # Categories identified in the input document.
@@ -982,7 +1034,7 @@ module Google
982
1034
  UTF8 = 1
983
1035
 
984
1036
  # Encoding-dependent information (such as `begin_offset`) is calculated based
985
- # on the UTF-16 encoding of the input. Java and Javascript are examples of
1037
+ # on the UTF-16 encoding of the input. Java and JavaScript are examples of
986
1038
  # languages that use this encoding natively.
987
1039
  UTF16 = 2
988
1040
 
@@ -205,7 +205,7 @@ module Google
205
205
  # Analyzes the sentiment of the provided text.
206
206
  #
207
207
  # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
208
- # Input document.
208
+ # Required. Input document.
209
209
  # A hash of the same form as `Google::Cloud::Language::V1beta2::Document`
210
210
  # can also be provided.
211
211
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
@@ -246,7 +246,7 @@ module Google
246
246
  # other properties.
247
247
  #
248
248
  # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
249
- # Input document.
249
+ # Required. Input document.
250
250
  # A hash of the same form as `Google::Cloud::Language::V1beta2::Document`
251
251
  # can also be provided.
252
252
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
@@ -281,13 +281,11 @@ module Google
281
281
  @analyze_entities.call(req, options, &block)
282
282
  end
283
283
 
284
- # Finds entities, similar to
285
- # {Google::Cloud::Language::V1beta2::LanguageService::AnalyzeEntities AnalyzeEntities}
286
- # in the text and analyzes sentiment associated with each entity and its
287
- # mentions.
284
+ # Finds entities, similar to {Google::Cloud::Language::V1beta2::LanguageService::AnalyzeEntities AnalyzeEntities} in the text and analyzes
285
+ # sentiment associated with each entity and its mentions.
288
286
  #
289
287
  # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
290
- # Input document.
288
+ # Required. Input document.
291
289
  # A hash of the same form as `Google::Cloud::Language::V1beta2::Document`
292
290
  # can also be provided.
293
291
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
@@ -327,7 +325,7 @@ module Google
327
325
  # properties.
328
326
  #
329
327
  # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
330
- # Input document.
328
+ # Required. Input document.
331
329
  # A hash of the same form as `Google::Cloud::Language::V1beta2::Document`
332
330
  # can also be provided.
333
331
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
@@ -365,7 +363,7 @@ module Google
365
363
  # Classifies a document into categories.
366
364
  #
367
365
  # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
368
- # Input document.
366
+ # Required. Input document.
369
367
  # A hash of the same form as `Google::Cloud::Language::V1beta2::Document`
370
368
  # can also be provided.
371
369
  # @param options [Google::Gax::CallOptions]
@@ -400,11 +398,11 @@ module Google
400
398
  # classification features in one call.
401
399
  #
402
400
  # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
403
- # Input document.
401
+ # Required. Input document.
404
402
  # A hash of the same form as `Google::Cloud::Language::V1beta2::Document`
405
403
  # can also be provided.
406
404
  # @param features [Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features | Hash]
407
- # The enabled features.
405
+ # Required. The enabled features.
408
406
  # A hash of the same form as `Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features`
409
407
  # can also be provided.
410
408
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
@@ -5,9 +5,9 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
- require 'google/longrunning/operations_pb'
8
+ require 'google/api/client_pb'
9
+ require 'google/api/field_behavior_pb'
9
10
  require 'google/protobuf/timestamp_pb'
10
- require 'google/rpc/status_pb'
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_message "google.cloud.language.v1beta2.Document" do
13
13
  optional :type, :enum, 1, "google.cloud.language.v1beta2.Document.Type"
@@ -43,6 +43,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
43
43
  value :WORK_OF_ART, 5
44
44
  value :CONSUMER_GOOD, 6
45
45
  value :OTHER, 7
46
+ value :PHONE_NUMBER, 9
47
+ value :ADDRESS, 10
48
+ value :DATE, 11
49
+ value :NUMBER, 12
50
+ value :PRICE, 13
46
51
  end
47
52
  add_message "google.cloud.language.v1beta2.Token" do
48
53
  optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/language/v1beta2/language_service.proto for package 'google.cloud.language.v1beta2'
3
3
  # Original file comments:
4
- # Copyright 2017 Google Inc.
4
+ # Copyright 2019 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,6 +15,7 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
+ #
18
19
 
19
20
 
20
21
  require 'grpc'
@@ -41,10 +42,8 @@ module Google
41
42
  # along with entity types, salience, mentions for each entity, and
42
43
  # other properties.
43
44
  rpc :AnalyzeEntities, AnalyzeEntitiesRequest, AnalyzeEntitiesResponse
44
- # Finds entities, similar to
45
- # [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities]
46
- # in the text and analyzes sentiment associated with each entity and its
47
- # mentions.
45
+ # Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
46
+ # sentiment associated with each entity and its mentions.
48
47
  rpc :AnalyzeEntitySentiment, AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse
49
48
  # Analyzes the syntax of the text and provides sentence boundaries and
50
49
  # tokenization along with part of speech tags, dependency trees, and other
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Language
19
- VERSION = "0.33.1".freeze
19
+ VERSION = "0.34.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-language
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.1
4
+ version: 0.34.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: 2019-08-23 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax