google-cloud-language-v1beta2 0.1.0

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.
@@ -0,0 +1,63 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/language/v1beta2/language_service.proto for package 'google.cloud.language.v1beta2'
3
+ # Original file comments:
4
+ # Copyright 2019 Google LLC.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ #
19
+
20
+ require 'grpc'
21
+ require 'google/cloud/language/v1beta2/language_service_pb'
22
+
23
+ module Google
24
+ module Cloud
25
+ module Language
26
+ module V1beta2
27
+ module LanguageService
28
+ # Provides text analysis operations such as sentiment analysis and entity
29
+ # recognition.
30
+ class Service
31
+
32
+ include GRPC::GenericService
33
+
34
+ self.marshal_class_method = :encode
35
+ self.unmarshal_class_method = :decode
36
+ self.service_name = 'google.cloud.language.v1beta2.LanguageService'
37
+
38
+ # Analyzes the sentiment of the provided text.
39
+ rpc :AnalyzeSentiment, AnalyzeSentimentRequest, AnalyzeSentimentResponse
40
+ # Finds named entities (currently proper names and common nouns) in the text
41
+ # along with entity types, salience, mentions for each entity, and
42
+ # other properties.
43
+ rpc :AnalyzeEntities, AnalyzeEntitiesRequest, AnalyzeEntitiesResponse
44
+ # Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
45
+ # sentiment associated with each entity and its mentions.
46
+ rpc :AnalyzeEntitySentiment, AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse
47
+ # Analyzes the syntax of the text and provides sentence boundaries and
48
+ # tokenization along with part-of-speech tags, dependency trees, and other
49
+ # properties.
50
+ rpc :AnalyzeSyntax, AnalyzeSyntaxRequest, AnalyzeSyntaxResponse
51
+ # Classifies a document into categories.
52
+ rpc :ClassifyText, ClassifyTextRequest, ClassifyTextResponse
53
+ # A convenience method that provides all syntax, sentiment, entity, and
54
+ # classification features in one call.
55
+ rpc :AnnotateText, AnnotateTextRequest, AnnotateTextResponse
56
+ end
57
+
58
+ Stub = Service.rpc_stub_class
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Language
23
+ module V1beta2
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,4 @@
1
+ # Natural Language V1beta2 Protocol Buffer Documentation
2
+
3
+ These files are for the YARD documentation of the generated protobuf files.
4
+ They are not intended to be required or loaded at runtime.
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Api
22
+ # An indicator of the behavior of a given field (for example, that a field
23
+ # is required in requests, or given as output but ignored as input).
24
+ # This **does not** change the behavior in protocol buffers itself; it only
25
+ # denotes the behavior and may affect how API tooling handles the field.
26
+ #
27
+ # Note: This enum **may** receive new values in the future.
28
+ module FieldBehavior
29
+ # Conventional default for enums. Do not use this.
30
+ FIELD_BEHAVIOR_UNSPECIFIED = 0
31
+
32
+ # Specifically denotes a field as optional.
33
+ # While all fields in protocol buffers are optional, this may be specified
34
+ # for emphasis if appropriate.
35
+ OPTIONAL = 1
36
+
37
+ # Denotes a field as required.
38
+ # This indicates that the field **must** be provided as part of the request,
39
+ # and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
40
+ REQUIRED = 2
41
+
42
+ # Denotes a field as output only.
43
+ # This indicates that the field is provided in responses, but including the
44
+ # field in a request does nothing (the server *must* ignore it and
45
+ # *must not* throw an error as a result of the field's presence).
46
+ OUTPUT_ONLY = 3
47
+
48
+ # Denotes a field as input only.
49
+ # This indicates that the field is provided in requests, and the
50
+ # corresponding field is not included in output.
51
+ INPUT_ONLY = 4
52
+
53
+ # Denotes a field as immutable.
54
+ # This indicates that the field may be set once in a request to create a
55
+ # resource, but may not be changed thereafter.
56
+ IMMUTABLE = 5
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,247 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Api
22
+ # A simple descriptor of a resource type.
23
+ #
24
+ # ResourceDescriptor annotates a resource message (either by means of a
25
+ # protobuf annotation or use in the service config), and associates the
26
+ # resource's schema, the resource type, and the pattern of the resource name.
27
+ #
28
+ # Example:
29
+ #
30
+ # message Topic {
31
+ # // Indicates this message defines a resource schema.
32
+ # // Declares the resource type in the format of {service}/{kind}.
33
+ # // For Kubernetes resources, the format is {api group}/{kind}.
34
+ # option (google.api.resource) = {
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
+ # }
41
+ # };
42
+ # }
43
+ #
44
+ # The ResourceDescriptor Yaml config will look like:
45
+ #
46
+ # resources:
47
+ # - 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}"
52
+ #
53
+ # Sometimes, resources have multiple patterns, typically because they can
54
+ # live under multiple parents.
55
+ #
56
+ # Example:
57
+ #
58
+ # message LogEntry {
59
+ # option (google.api.resource) = {
60
+ # 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
+ # }
81
+ # };
82
+ # }
83
+ #
84
+ # The ResourceDescriptor Yaml config will look like:
85
+ #
86
+ # resources:
87
+ # - 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"
130
+ # @!attribute [rw] type
131
+ # @return [String]
132
+ # The resource type. It must be in the format of
133
+ # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be
134
+ # singular and must not include version numbers.
135
+ #
136
+ # Example: `storage.googleapis.com/Bucket`
137
+ #
138
+ # The value of the resource_type_kind must follow the regular expression
139
+ # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
140
+ # should use PascalCase (UpperCamelCase). The maximum number of
141
+ # characters allowed for the `resource_type_kind` is 100.
142
+ # @!attribute [rw] pattern
143
+ # @return [Array<String>]
144
+ # Optional. The relative resource name pattern associated with this resource
145
+ # type. The DNS prefix of the full resource name shouldn't be specified here.
146
+ #
147
+ # The path pattern must follow the syntax, which aligns with HTTP binding
148
+ # syntax:
149
+ #
150
+ # Template = Segment { "/" Segment } ;
151
+ # Segment = LITERAL | Variable ;
152
+ # Variable = "{" LITERAL "}" ;
153
+ #
154
+ # Examples:
155
+ #
156
+ # - "projects/\\{project}/topics/\\{topic}"
157
+ # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}"
158
+ #
159
+ # The components in braces correspond to the IDs for each resource in the
160
+ # hierarchy. It is expected that, if multiple patterns are provided,
161
+ # the same component name (e.g. "project") refers to IDs of the same
162
+ # type of resource.
163
+ # @!attribute [rw] name_field
164
+ # @return [String]
165
+ # Optional. The field on the resource that designates the resource name
166
+ # field. If omitted, this is assumed to be "name".
167
+ # @!attribute [rw] history
168
+ # @return [Google::Api::ResourceDescriptor::History]
169
+ # Optional. The historical or future-looking state of the resource pattern.
170
+ #
171
+ # Example:
172
+ #
173
+ # // The InspectTemplate message originally only supported resource
174
+ # // names with organization, and project was added later.
175
+ # message InspectTemplate {
176
+ # option (google.api.resource) = {
177
+ # type: "dlp.googleapis.com/InspectTemplate"
178
+ # pattern:
179
+ # "organizations/{organization}/inspectTemplates/{inspect_template}"
180
+ # pattern: "projects/{project}/inspectTemplates/{inspect_template}"
181
+ # history: ORIGINALLY_SINGLE_PATTERN
182
+ # };
183
+ # }
184
+ # @!attribute [rw] plural
185
+ # @return [String]
186
+ # The plural name used in the resource name, such as 'projects' for
187
+ # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
+ # field in k8s CRD spec
189
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
190
+ # @!attribute [rw] singular
191
+ # @return [String]
192
+ # The same concept of the `singular` field in k8s CRD spec
193
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
+ # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
195
+ class ResourceDescriptor
196
+ include Google::Protobuf::MessageExts
197
+ extend Google::Protobuf::MessageExts::ClassMethods
198
+
199
+ # A description of the historical or future-looking state of the
200
+ # resource pattern.
201
+ module History
202
+ # The "unset" value.
203
+ HISTORY_UNSPECIFIED = 0
204
+
205
+ # The resource originally had one pattern and launched as such, and
206
+ # additional patterns were added later.
207
+ ORIGINALLY_SINGLE_PATTERN = 1
208
+
209
+ # The resource has one pattern, but the API owner expects to add more
210
+ # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
211
+ # that from being necessary once there are multiple patterns.)
212
+ FUTURE_MULTI_PATTERN = 2
213
+ end
214
+ end
215
+
216
+ # Defines a proto annotation that describes a string field that refers to
217
+ # an API resource.
218
+ # @!attribute [rw] type
219
+ # @return [String]
220
+ # The resource type that the annotated field references.
221
+ #
222
+ # Example:
223
+ #
224
+ # message Subscription {
225
+ # string topic = 2 [(google.api.resource_reference) = {
226
+ # type: "pubsub.googleapis.com/Topic"
227
+ # }];
228
+ # }
229
+ # @!attribute [rw] child_type
230
+ # @return [String]
231
+ # The resource type of a child collection that the annotated field
232
+ # references. This is useful for annotating the `parent` field that
233
+ # doesn't have a fixed resource type.
234
+ #
235
+ # Example:
236
+ #
237
+ # message ListLogEntriesRequest {
238
+ # string parent = 1 [(google.api.resource_reference) = {
239
+ # child_type: "logging.googleapis.com/LogEntry"
240
+ # };
241
+ # }
242
+ class ResourceReference
243
+ include Google::Protobuf::MessageExts
244
+ extend Google::Protobuf::MessageExts::ClassMethods
245
+ end
246
+ end
247
+ end
@@ -0,0 +1,1131 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Language
23
+ module V1beta2
24
+ # ################################################################ #
25
+ #
26
+ # Represents the input to API methods.
27
+ # @!attribute [rw] type
28
+ # @return [Google::Cloud::Language::V1beta2::Document::Type]
29
+ # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
30
+ # returns an `INVALID_ARGUMENT` error.
31
+ # @!attribute [rw] content
32
+ # @return [String]
33
+ # The content of the input in string format.
34
+ # Cloud audit logging exempt since it is based on user data.
35
+ # @!attribute [rw] gcs_content_uri
36
+ # @return [String]
37
+ # The Google Cloud Storage URI where the file content is located.
38
+ # This URI must be of the form: gs://bucket_name/object_name. For more
39
+ # details, see https://cloud.google.com/storage/docs/reference-uris.
40
+ # NOTE: Cloud Storage object versioning is not supported.
41
+ # @!attribute [rw] language
42
+ # @return [String]
43
+ # The language of the document (if not specified, the language is
44
+ # automatically detected). Both ISO and BCP-47 language codes are
45
+ # accepted.<br>
46
+ # [Language Support](/natural-language/docs/languages)
47
+ # lists currently supported languages for each API method.
48
+ # If the language (either specified by the caller or automatically detected)
49
+ # is not supported by the called API method, an `INVALID_ARGUMENT` error
50
+ # is returned.
51
+ class Document
52
+ include Google::Protobuf::MessageExts
53
+ extend Google::Protobuf::MessageExts::ClassMethods
54
+
55
+ # The document types enum.
56
+ module Type
57
+ # The content type is not specified.
58
+ TYPE_UNSPECIFIED = 0
59
+
60
+ # Plain text
61
+ PLAIN_TEXT = 1
62
+
63
+ # HTML
64
+ HTML = 2
65
+ end
66
+ end
67
+
68
+ # Represents a sentence in the input document.
69
+ # @!attribute [rw] text
70
+ # @return [Google::Cloud::Language::V1beta2::TextSpan]
71
+ # The sentence text.
72
+ # @!attribute [rw] sentiment
73
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
74
+ # For calls to [AnalyzeSentiment][] or if
75
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest.Features.extract_document_sentiment} is set to
76
+ # true, this field will contain the sentiment for the sentence.
77
+ class Sentence
78
+ include Google::Protobuf::MessageExts
79
+ extend Google::Protobuf::MessageExts::ClassMethods
80
+ end
81
+
82
+ # Represents a phrase in the text that is a known entity, such as
83
+ # a person, an organization, or location. The API associates information, such
84
+ # as salience and mentions, with entities.
85
+ # @!attribute [rw] name
86
+ # @return [String]
87
+ # The representative name for the entity.
88
+ # @!attribute [rw] type
89
+ # @return [Google::Cloud::Language::V1beta2::Entity::Type]
90
+ # The entity type.
91
+ # @!attribute [rw] metadata
92
+ # @return [Google::Protobuf::Map{String => String}]
93
+ # Metadata associated with the entity.
94
+ #
95
+ # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
96
+ # and Knowledge Graph MID (`mid`), if they are available. For the metadata
97
+ # associated with other entity types, see the Type table below.
98
+ # @!attribute [rw] salience
99
+ # @return [Float]
100
+ # The salience score associated with the entity in the [0, 1.0] range.
101
+ #
102
+ # The salience score for an entity provides information about the
103
+ # importance or centrality of that entity to the entire document text.
104
+ # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
105
+ # salient.
106
+ # @!attribute [rw] mentions
107
+ # @return [Array<Google::Cloud::Language::V1beta2::EntityMention>]
108
+ # The mentions of this entity in the input document. The API currently
109
+ # supports proper noun mentions.
110
+ # @!attribute [rw] sentiment
111
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
112
+ # For calls to [AnalyzeEntitySentiment][] or if
113
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment} is set to
114
+ # true, this field will contain the aggregate sentiment expressed for this
115
+ # entity in the provided document.
116
+ class Entity
117
+ include Google::Protobuf::MessageExts
118
+ extend Google::Protobuf::MessageExts::ClassMethods
119
+
120
+ # @!attribute [rw] key
121
+ # @return [String]
122
+ # @!attribute [rw] value
123
+ # @return [String]
124
+ class MetadataEntry
125
+ include Google::Protobuf::MessageExts
126
+ extend Google::Protobuf::MessageExts::ClassMethods
127
+ end
128
+
129
+ # The type of the entity. For most entity types, the associated metadata is a
130
+ # Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
131
+ # below lists the associated fields for entities that have different
132
+ # metadata.
133
+ module Type
134
+ # Unknown
135
+ UNKNOWN = 0
136
+
137
+ # Person
138
+ PERSON = 1
139
+
140
+ # Location
141
+ LOCATION = 2
142
+
143
+ # Organization
144
+ ORGANIZATION = 3
145
+
146
+ # Event
147
+ EVENT = 4
148
+
149
+ # Artwork
150
+ WORK_OF_ART = 5
151
+
152
+ # Consumer product
153
+ CONSUMER_GOOD = 6
154
+
155
+ # Other types of entities
156
+ OTHER = 7
157
+
158
+ # Phone number
159
+ #
160
+ # The metadata lists the phone number, formatted according to local
161
+ # convention, plus whichever additional elements appear in the text:
162
+ #
163
+ # * `number` - the actual number, broken down into sections as per local
164
+ # convention
165
+ # * `national_prefix` - country code, if detected
166
+ # * `area_code` - region or area code, if detected
167
+ # * `extension` - phone extension (to be dialed after connection), if
168
+ # detected
169
+ PHONE_NUMBER = 9
170
+
171
+ # Address
172
+ #
173
+ # The metadata identifies the street number and locality plus whichever
174
+ # additional elements appear in the text:
175
+ #
176
+ # * `street_number` - street number
177
+ # * `locality` - city or town
178
+ # * `street_name` - street/route name, if detected
179
+ # * `postal_code` - postal code, if detected
180
+ # * `country` - country, if detected<
181
+ # * `broad_region` - administrative area, such as the state, if detected
182
+ # * `narrow_region` - smaller administrative area, such as county, if
183
+ # detected
184
+ # * `sublocality` - used in Asian addresses to demark a district within a
185
+ # city, if detected
186
+ ADDRESS = 10
187
+
188
+ # Date
189
+ #
190
+ # The metadata identifies the components of the date:
191
+ #
192
+ # * `year` - four digit year, if detected
193
+ # * `month` - two digit month number, if detected
194
+ # * `day` - two digit day number, if detected
195
+ DATE = 11
196
+
197
+ # Number
198
+ #
199
+ # The metadata is the number itself.
200
+ NUMBER = 12
201
+
202
+ # Price
203
+ #
204
+ # The metadata identifies the `value` and `currency`.
205
+ PRICE = 13
206
+ end
207
+ end
208
+
209
+ # Represents the smallest syntactic building block of the text.
210
+ # @!attribute [rw] text
211
+ # @return [Google::Cloud::Language::V1beta2::TextSpan]
212
+ # The token text.
213
+ # @!attribute [rw] part_of_speech
214
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech]
215
+ # Parts of speech tag for this token.
216
+ # @!attribute [rw] dependency_edge
217
+ # @return [Google::Cloud::Language::V1beta2::DependencyEdge]
218
+ # Dependency tree parse for this token.
219
+ # @!attribute [rw] lemma
220
+ # @return [String]
221
+ # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
222
+ class Token
223
+ include Google::Protobuf::MessageExts
224
+ extend Google::Protobuf::MessageExts::ClassMethods
225
+ end
226
+
227
+ # Represents the feeling associated with the entire text or entities in
228
+ # the text.
229
+ # Next ID: 6
230
+ # @!attribute [rw] magnitude
231
+ # @return [Float]
232
+ # A non-negative number in the [0, +inf) range, which represents
233
+ # the absolute magnitude of sentiment regardless of score (positive or
234
+ # negative).
235
+ # @!attribute [rw] score
236
+ # @return [Float]
237
+ # Sentiment score between -1.0 (negative sentiment) and 1.0
238
+ # (positive sentiment).
239
+ class Sentiment
240
+ include Google::Protobuf::MessageExts
241
+ extend Google::Protobuf::MessageExts::ClassMethods
242
+ end
243
+
244
+ # Represents part of speech information for a token.
245
+ # @!attribute [rw] tag
246
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Tag]
247
+ # The part of speech tag.
248
+ # @!attribute [rw] aspect
249
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Aspect]
250
+ # The grammatical aspect.
251
+ # @!attribute [rw] case
252
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Case]
253
+ # The grammatical case.
254
+ # @!attribute [rw] form
255
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Form]
256
+ # The grammatical form.
257
+ # @!attribute [rw] gender
258
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Gender]
259
+ # The grammatical gender.
260
+ # @!attribute [rw] mood
261
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Mood]
262
+ # The grammatical mood.
263
+ # @!attribute [rw] number
264
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Number]
265
+ # The grammatical number.
266
+ # @!attribute [rw] person
267
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Person]
268
+ # The grammatical person.
269
+ # @!attribute [rw] proper
270
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Proper]
271
+ # The grammatical properness.
272
+ # @!attribute [rw] reciprocity
273
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Reciprocity]
274
+ # The grammatical reciprocity.
275
+ # @!attribute [rw] tense
276
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Tense]
277
+ # The grammatical tense.
278
+ # @!attribute [rw] voice
279
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Voice]
280
+ # The grammatical voice.
281
+ class PartOfSpeech
282
+ include Google::Protobuf::MessageExts
283
+ extend Google::Protobuf::MessageExts::ClassMethods
284
+
285
+ # The part of speech tags enum.
286
+ module Tag
287
+ # Unknown
288
+ UNKNOWN = 0
289
+
290
+ # Adjective
291
+ ADJ = 1
292
+
293
+ # Adposition (preposition and postposition)
294
+ ADP = 2
295
+
296
+ # Adverb
297
+ ADV = 3
298
+
299
+ # Conjunction
300
+ CONJ = 4
301
+
302
+ # Determiner
303
+ DET = 5
304
+
305
+ # Noun (common and proper)
306
+ NOUN = 6
307
+
308
+ # Cardinal number
309
+ NUM = 7
310
+
311
+ # Pronoun
312
+ PRON = 8
313
+
314
+ # Particle or other function word
315
+ PRT = 9
316
+
317
+ # Punctuation
318
+ PUNCT = 10
319
+
320
+ # Verb (all tenses and modes)
321
+ VERB = 11
322
+
323
+ # Other: foreign words, typos, abbreviations
324
+ X = 12
325
+
326
+ # Affix
327
+ AFFIX = 13
328
+ end
329
+
330
+ # The characteristic of a verb that expresses time flow during an event.
331
+ module Aspect
332
+ # Aspect is not applicable in the analyzed language or is not predicted.
333
+ ASPECT_UNKNOWN = 0
334
+
335
+ # Perfective
336
+ PERFECTIVE = 1
337
+
338
+ # Imperfective
339
+ IMPERFECTIVE = 2
340
+
341
+ # Progressive
342
+ PROGRESSIVE = 3
343
+ end
344
+
345
+ # The grammatical function performed by a noun or pronoun in a phrase,
346
+ # clause, or sentence. In some languages, other parts of speech, such as
347
+ # adjective and determiner, take case inflection in agreement with the noun.
348
+ module Case
349
+ # Case is not applicable in the analyzed language or is not predicted.
350
+ CASE_UNKNOWN = 0
351
+
352
+ # Accusative
353
+ ACCUSATIVE = 1
354
+
355
+ # Adverbial
356
+ ADVERBIAL = 2
357
+
358
+ # Complementive
359
+ COMPLEMENTIVE = 3
360
+
361
+ # Dative
362
+ DATIVE = 4
363
+
364
+ # Genitive
365
+ GENITIVE = 5
366
+
367
+ # Instrumental
368
+ INSTRUMENTAL = 6
369
+
370
+ # Locative
371
+ LOCATIVE = 7
372
+
373
+ # Nominative
374
+ NOMINATIVE = 8
375
+
376
+ # Oblique
377
+ OBLIQUE = 9
378
+
379
+ # Partitive
380
+ PARTITIVE = 10
381
+
382
+ # Prepositional
383
+ PREPOSITIONAL = 11
384
+
385
+ # Reflexive
386
+ REFLEXIVE_CASE = 12
387
+
388
+ # Relative
389
+ RELATIVE_CASE = 13
390
+
391
+ # Vocative
392
+ VOCATIVE = 14
393
+ end
394
+
395
+ # Depending on the language, Form can be categorizing different forms of
396
+ # verbs, adjectives, adverbs, etc. For example, categorizing inflected
397
+ # endings of verbs and adjectives or distinguishing between short and long
398
+ # forms of adjectives and participles
399
+ module Form
400
+ # Form is not applicable in the analyzed language or is not predicted.
401
+ FORM_UNKNOWN = 0
402
+
403
+ # Adnomial
404
+ ADNOMIAL = 1
405
+
406
+ # Auxiliary
407
+ AUXILIARY = 2
408
+
409
+ # Complementizer
410
+ COMPLEMENTIZER = 3
411
+
412
+ # Final ending
413
+ FINAL_ENDING = 4
414
+
415
+ # Gerund
416
+ GERUND = 5
417
+
418
+ # Realis
419
+ REALIS = 6
420
+
421
+ # Irrealis
422
+ IRREALIS = 7
423
+
424
+ # Short form
425
+ SHORT = 8
426
+
427
+ # Long form
428
+ LONG = 9
429
+
430
+ # Order form
431
+ ORDER = 10
432
+
433
+ # Specific form
434
+ SPECIFIC = 11
435
+ end
436
+
437
+ # Gender classes of nouns reflected in the behaviour of associated words.
438
+ module Gender
439
+ # Gender is not applicable in the analyzed language or is not predicted.
440
+ GENDER_UNKNOWN = 0
441
+
442
+ # Feminine
443
+ FEMININE = 1
444
+
445
+ # Masculine
446
+ MASCULINE = 2
447
+
448
+ # Neuter
449
+ NEUTER = 3
450
+ end
451
+
452
+ # The grammatical feature of verbs, used for showing modality and attitude.
453
+ module Mood
454
+ # Mood is not applicable in the analyzed language or is not predicted.
455
+ MOOD_UNKNOWN = 0
456
+
457
+ # Conditional
458
+ CONDITIONAL_MOOD = 1
459
+
460
+ # Imperative
461
+ IMPERATIVE = 2
462
+
463
+ # Indicative
464
+ INDICATIVE = 3
465
+
466
+ # Interrogative
467
+ INTERROGATIVE = 4
468
+
469
+ # Jussive
470
+ JUSSIVE = 5
471
+
472
+ # Subjunctive
473
+ SUBJUNCTIVE = 6
474
+ end
475
+
476
+ # Count distinctions.
477
+ module Number
478
+ # Number is not applicable in the analyzed language or is not predicted.
479
+ NUMBER_UNKNOWN = 0
480
+
481
+ # Singular
482
+ SINGULAR = 1
483
+
484
+ # Plural
485
+ PLURAL = 2
486
+
487
+ # Dual
488
+ DUAL = 3
489
+ end
490
+
491
+ # The distinction between the speaker, second person, third person, etc.
492
+ module Person
493
+ # Person is not applicable in the analyzed language or is not predicted.
494
+ PERSON_UNKNOWN = 0
495
+
496
+ # First
497
+ FIRST = 1
498
+
499
+ # Second
500
+ SECOND = 2
501
+
502
+ # Third
503
+ THIRD = 3
504
+
505
+ # Reflexive
506
+ REFLEXIVE_PERSON = 4
507
+ end
508
+
509
+ # This category shows if the token is part of a proper name.
510
+ module Proper
511
+ # Proper is not applicable in the analyzed language or is not predicted.
512
+ PROPER_UNKNOWN = 0
513
+
514
+ # Proper
515
+ PROPER = 1
516
+
517
+ # Not proper
518
+ NOT_PROPER = 2
519
+ end
520
+
521
+ # Reciprocal features of a pronoun.
522
+ module Reciprocity
523
+ # Reciprocity is not applicable in the analyzed language or is not
524
+ # predicted.
525
+ RECIPROCITY_UNKNOWN = 0
526
+
527
+ # Reciprocal
528
+ RECIPROCAL = 1
529
+
530
+ # Non-reciprocal
531
+ NON_RECIPROCAL = 2
532
+ end
533
+
534
+ # Time reference.
535
+ module Tense
536
+ # Tense is not applicable in the analyzed language or is not predicted.
537
+ TENSE_UNKNOWN = 0
538
+
539
+ # Conditional
540
+ CONDITIONAL_TENSE = 1
541
+
542
+ # Future
543
+ FUTURE = 2
544
+
545
+ # Past
546
+ PAST = 3
547
+
548
+ # Present
549
+ PRESENT = 4
550
+
551
+ # Imperfect
552
+ IMPERFECT = 5
553
+
554
+ # Pluperfect
555
+ PLUPERFECT = 6
556
+ end
557
+
558
+ # The relationship between the action that a verb expresses and the
559
+ # participants identified by its arguments.
560
+ module Voice
561
+ # Voice is not applicable in the analyzed language or is not predicted.
562
+ VOICE_UNKNOWN = 0
563
+
564
+ # Active
565
+ ACTIVE = 1
566
+
567
+ # Causative
568
+ CAUSATIVE = 2
569
+
570
+ # Passive
571
+ PASSIVE = 3
572
+ end
573
+ end
574
+
575
+ # Represents dependency parse tree information for a token.
576
+ # @!attribute [rw] head_token_index
577
+ # @return [Integer]
578
+ # Represents the head of this token in the dependency tree.
579
+ # This is the index of the token which has an arc going to this token.
580
+ # The index is the position of the token in the array of tokens returned
581
+ # by the API method. If this token is a root token, then the
582
+ # `head_token_index` is its own index.
583
+ # @!attribute [rw] label
584
+ # @return [Google::Cloud::Language::V1beta2::DependencyEdge::Label]
585
+ # The parse label for the token.
586
+ class DependencyEdge
587
+ include Google::Protobuf::MessageExts
588
+ extend Google::Protobuf::MessageExts::ClassMethods
589
+
590
+ # The parse label enum for the token.
591
+ module Label
592
+ # Unknown
593
+ UNKNOWN = 0
594
+
595
+ # Abbreviation modifier
596
+ ABBREV = 1
597
+
598
+ # Adjectival complement
599
+ ACOMP = 2
600
+
601
+ # Adverbial clause modifier
602
+ ADVCL = 3
603
+
604
+ # Adverbial modifier
605
+ ADVMOD = 4
606
+
607
+ # Adjectival modifier of an NP
608
+ AMOD = 5
609
+
610
+ # Appositional modifier of an NP
611
+ APPOS = 6
612
+
613
+ # Attribute dependent of a copular verb
614
+ ATTR = 7
615
+
616
+ # Auxiliary (non-main) verb
617
+ AUX = 8
618
+
619
+ # Passive auxiliary
620
+ AUXPASS = 9
621
+
622
+ # Coordinating conjunction
623
+ CC = 10
624
+
625
+ # Clausal complement of a verb or adjective
626
+ CCOMP = 11
627
+
628
+ # Conjunct
629
+ CONJ = 12
630
+
631
+ # Clausal subject
632
+ CSUBJ = 13
633
+
634
+ # Clausal passive subject
635
+ CSUBJPASS = 14
636
+
637
+ # Dependency (unable to determine)
638
+ DEP = 15
639
+
640
+ # Determiner
641
+ DET = 16
642
+
643
+ # Discourse
644
+ DISCOURSE = 17
645
+
646
+ # Direct object
647
+ DOBJ = 18
648
+
649
+ # Expletive
650
+ EXPL = 19
651
+
652
+ # Goes with (part of a word in a text not well edited)
653
+ GOESWITH = 20
654
+
655
+ # Indirect object
656
+ IOBJ = 21
657
+
658
+ # Marker (word introducing a subordinate clause)
659
+ MARK = 22
660
+
661
+ # Multi-word expression
662
+ MWE = 23
663
+
664
+ # Multi-word verbal expression
665
+ MWV = 24
666
+
667
+ # Negation modifier
668
+ NEG = 25
669
+
670
+ # Noun compound modifier
671
+ NN = 26
672
+
673
+ # Noun phrase used as an adverbial modifier
674
+ NPADVMOD = 27
675
+
676
+ # Nominal subject
677
+ NSUBJ = 28
678
+
679
+ # Passive nominal subject
680
+ NSUBJPASS = 29
681
+
682
+ # Numeric modifier of a noun
683
+ NUM = 30
684
+
685
+ # Element of compound number
686
+ NUMBER = 31
687
+
688
+ # Punctuation mark
689
+ P = 32
690
+
691
+ # Parataxis relation
692
+ PARATAXIS = 33
693
+
694
+ # Participial modifier
695
+ PARTMOD = 34
696
+
697
+ # The complement of a preposition is a clause
698
+ PCOMP = 35
699
+
700
+ # Object of a preposition
701
+ POBJ = 36
702
+
703
+ # Possession modifier
704
+ POSS = 37
705
+
706
+ # Postverbal negative particle
707
+ POSTNEG = 38
708
+
709
+ # Predicate complement
710
+ PRECOMP = 39
711
+
712
+ # Preconjunt
713
+ PRECONJ = 40
714
+
715
+ # Predeterminer
716
+ PREDET = 41
717
+
718
+ # Prefix
719
+ PREF = 42
720
+
721
+ # Prepositional modifier
722
+ PREP = 43
723
+
724
+ # The relationship between a verb and verbal morpheme
725
+ PRONL = 44
726
+
727
+ # Particle
728
+ PRT = 45
729
+
730
+ # Associative or possessive marker
731
+ PS = 46
732
+
733
+ # Quantifier phrase modifier
734
+ QUANTMOD = 47
735
+
736
+ # Relative clause modifier
737
+ RCMOD = 48
738
+
739
+ # Complementizer in relative clause
740
+ RCMODREL = 49
741
+
742
+ # Ellipsis without a preceding predicate
743
+ RDROP = 50
744
+
745
+ # Referent
746
+ REF = 51
747
+
748
+ # Remnant
749
+ REMNANT = 52
750
+
751
+ # Reparandum
752
+ REPARANDUM = 53
753
+
754
+ # Root
755
+ ROOT = 54
756
+
757
+ # Suffix specifying a unit of number
758
+ SNUM = 55
759
+
760
+ # Suffix
761
+ SUFF = 56
762
+
763
+ # Temporal modifier
764
+ TMOD = 57
765
+
766
+ # Topic marker
767
+ TOPIC = 58
768
+
769
+ # Clause headed by an infinite form of the verb that modifies a noun
770
+ VMOD = 59
771
+
772
+ # Vocative
773
+ VOCATIVE = 60
774
+
775
+ # Open clausal complement
776
+ XCOMP = 61
777
+
778
+ # Name suffix
779
+ SUFFIX = 62
780
+
781
+ # Name title
782
+ TITLE = 63
783
+
784
+ # Adverbial phrase modifier
785
+ ADVPHMOD = 64
786
+
787
+ # Causative auxiliary
788
+ AUXCAUS = 65
789
+
790
+ # Helper auxiliary
791
+ AUXVV = 66
792
+
793
+ # Rentaishi (Prenominal modifier)
794
+ DTMOD = 67
795
+
796
+ # Foreign words
797
+ FOREIGN = 68
798
+
799
+ # Keyword
800
+ KW = 69
801
+
802
+ # List for chains of comparable items
803
+ LIST = 70
804
+
805
+ # Nominalized clause
806
+ NOMC = 71
807
+
808
+ # Nominalized clausal subject
809
+ NOMCSUBJ = 72
810
+
811
+ # Nominalized clausal passive
812
+ NOMCSUBJPASS = 73
813
+
814
+ # Compound of numeric modifier
815
+ NUMC = 74
816
+
817
+ # Copula
818
+ COP = 75
819
+
820
+ # Dislocated relation (for fronted/topicalized elements)
821
+ DISLOCATED = 76
822
+
823
+ # Aspect marker
824
+ ASP = 77
825
+
826
+ # Genitive modifier
827
+ GMOD = 78
828
+
829
+ # Genitive object
830
+ GOBJ = 79
831
+
832
+ # Infinitival modifier
833
+ INFMOD = 80
834
+
835
+ # Measure
836
+ MES = 81
837
+
838
+ # Nominal complement of a noun
839
+ NCOMP = 82
840
+ end
841
+ end
842
+
843
+ # Represents a mention for an entity in the text. Currently, proper noun
844
+ # mentions are supported.
845
+ # @!attribute [rw] text
846
+ # @return [Google::Cloud::Language::V1beta2::TextSpan]
847
+ # The mention text.
848
+ # @!attribute [rw] type
849
+ # @return [Google::Cloud::Language::V1beta2::EntityMention::Type]
850
+ # The type of the entity mention.
851
+ # @!attribute [rw] sentiment
852
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
853
+ # For calls to [AnalyzeEntitySentiment][] or if
854
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment} is set to
855
+ # true, this field will contain the sentiment expressed for this mention of
856
+ # the entity in the provided document.
857
+ class EntityMention
858
+ include Google::Protobuf::MessageExts
859
+ extend Google::Protobuf::MessageExts::ClassMethods
860
+
861
+ # The supported types of mentions.
862
+ module Type
863
+ # Unknown
864
+ TYPE_UNKNOWN = 0
865
+
866
+ # Proper name
867
+ PROPER = 1
868
+
869
+ # Common noun (or noun compound)
870
+ COMMON = 2
871
+ end
872
+ end
873
+
874
+ # Represents an output piece of text.
875
+ # @!attribute [rw] content
876
+ # @return [String]
877
+ # The content of the output text.
878
+ # @!attribute [rw] begin_offset
879
+ # @return [Integer]
880
+ # The API calculates the beginning offset of the content in the original
881
+ # document according to the {Google::Cloud::Language::V1beta2::EncodingType EncodingType} specified in the API request.
882
+ class TextSpan
883
+ include Google::Protobuf::MessageExts
884
+ extend Google::Protobuf::MessageExts::ClassMethods
885
+ end
886
+
887
+ # Represents a category returned from the text classifier.
888
+ # @!attribute [rw] name
889
+ # @return [String]
890
+ # The name of the category representing the document, from the [predefined
891
+ # taxonomy](/natural-language/docs/categories).
892
+ # @!attribute [rw] confidence
893
+ # @return [Float]
894
+ # The classifier's confidence of the category. Number represents how certain
895
+ # the classifier is that this category represents the given text.
896
+ class ClassificationCategory
897
+ include Google::Protobuf::MessageExts
898
+ extend Google::Protobuf::MessageExts::ClassMethods
899
+ end
900
+
901
+ # The sentiment analysis request message.
902
+ # @!attribute [rw] document
903
+ # @return [Google::Cloud::Language::V1beta2::Document]
904
+ # Required. Input document.
905
+ # @!attribute [rw] encoding_type
906
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
907
+ # The encoding type used by the API to calculate sentence offsets for the
908
+ # sentence sentiment.
909
+ class AnalyzeSentimentRequest
910
+ include Google::Protobuf::MessageExts
911
+ extend Google::Protobuf::MessageExts::ClassMethods
912
+ end
913
+
914
+ # The sentiment analysis response message.
915
+ # @!attribute [rw] document_sentiment
916
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
917
+ # The overall sentiment of the input document.
918
+ # @!attribute [rw] language
919
+ # @return [String]
920
+ # The language of the text, which will be the same as the language specified
921
+ # in the request or, if not specified, the automatically-detected language.
922
+ # See {Google::Cloud::Language::V1beta2::Document#language Document.language} field for more details.
923
+ # @!attribute [rw] sentences
924
+ # @return [Array<Google::Cloud::Language::V1beta2::Sentence>]
925
+ # The sentiment for all the sentences in the document.
926
+ class AnalyzeSentimentResponse
927
+ include Google::Protobuf::MessageExts
928
+ extend Google::Protobuf::MessageExts::ClassMethods
929
+ end
930
+
931
+ # The entity-level sentiment analysis request message.
932
+ # @!attribute [rw] document
933
+ # @return [Google::Cloud::Language::V1beta2::Document]
934
+ # Required. Input document.
935
+ # @!attribute [rw] encoding_type
936
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
937
+ # The encoding type used by the API to calculate offsets.
938
+ class AnalyzeEntitySentimentRequest
939
+ include Google::Protobuf::MessageExts
940
+ extend Google::Protobuf::MessageExts::ClassMethods
941
+ end
942
+
943
+ # The entity-level sentiment analysis response message.
944
+ # @!attribute [rw] entities
945
+ # @return [Array<Google::Cloud::Language::V1beta2::Entity>]
946
+ # The recognized entities in the input document with associated sentiments.
947
+ # @!attribute [rw] language
948
+ # @return [String]
949
+ # The language of the text, which will be the same as the language specified
950
+ # in the request or, if not specified, the automatically-detected language.
951
+ # See {Google::Cloud::Language::V1beta2::Document#language Document.language} field for more details.
952
+ class AnalyzeEntitySentimentResponse
953
+ include Google::Protobuf::MessageExts
954
+ extend Google::Protobuf::MessageExts::ClassMethods
955
+ end
956
+
957
+ # The entity analysis request message.
958
+ # @!attribute [rw] document
959
+ # @return [Google::Cloud::Language::V1beta2::Document]
960
+ # Required. Input document.
961
+ # @!attribute [rw] encoding_type
962
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
963
+ # The encoding type used by the API to calculate offsets.
964
+ class AnalyzeEntitiesRequest
965
+ include Google::Protobuf::MessageExts
966
+ extend Google::Protobuf::MessageExts::ClassMethods
967
+ end
968
+
969
+ # The entity analysis response message.
970
+ # @!attribute [rw] entities
971
+ # @return [Array<Google::Cloud::Language::V1beta2::Entity>]
972
+ # The recognized entities in the input document.
973
+ # @!attribute [rw] language
974
+ # @return [String]
975
+ # The language of the text, which will be the same as the language specified
976
+ # in the request or, if not specified, the automatically-detected language.
977
+ # See {Google::Cloud::Language::V1beta2::Document#language Document.language} field for more details.
978
+ class AnalyzeEntitiesResponse
979
+ include Google::Protobuf::MessageExts
980
+ extend Google::Protobuf::MessageExts::ClassMethods
981
+ end
982
+
983
+ # The syntax analysis request message.
984
+ # @!attribute [rw] document
985
+ # @return [Google::Cloud::Language::V1beta2::Document]
986
+ # Required. Input document.
987
+ # @!attribute [rw] encoding_type
988
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
989
+ # The encoding type used by the API to calculate offsets.
990
+ class AnalyzeSyntaxRequest
991
+ include Google::Protobuf::MessageExts
992
+ extend Google::Protobuf::MessageExts::ClassMethods
993
+ end
994
+
995
+ # The syntax analysis response message.
996
+ # @!attribute [rw] sentences
997
+ # @return [Array<Google::Cloud::Language::V1beta2::Sentence>]
998
+ # Sentences in the input document.
999
+ # @!attribute [rw] tokens
1000
+ # @return [Array<Google::Cloud::Language::V1beta2::Token>]
1001
+ # Tokens, along with their syntactic information, in the input document.
1002
+ # @!attribute [rw] language
1003
+ # @return [String]
1004
+ # The language of the text, which will be the same as the language specified
1005
+ # in the request or, if not specified, the automatically-detected language.
1006
+ # See {Google::Cloud::Language::V1beta2::Document#language Document.language} field for more details.
1007
+ class AnalyzeSyntaxResponse
1008
+ include Google::Protobuf::MessageExts
1009
+ extend Google::Protobuf::MessageExts::ClassMethods
1010
+ end
1011
+
1012
+ # The document classification request message.
1013
+ # @!attribute [rw] document
1014
+ # @return [Google::Cloud::Language::V1beta2::Document]
1015
+ # Required. Input document.
1016
+ class ClassifyTextRequest
1017
+ include Google::Protobuf::MessageExts
1018
+ extend Google::Protobuf::MessageExts::ClassMethods
1019
+ end
1020
+
1021
+ # The document classification response message.
1022
+ # @!attribute [rw] categories
1023
+ # @return [Array<Google::Cloud::Language::V1beta2::ClassificationCategory>]
1024
+ # Categories representing the input document.
1025
+ class ClassifyTextResponse
1026
+ include Google::Protobuf::MessageExts
1027
+ extend Google::Protobuf::MessageExts::ClassMethods
1028
+ end
1029
+
1030
+ # The request message for the text annotation API, which can perform multiple
1031
+ # analysis types (sentiment, entities, and syntax) in one call.
1032
+ # @!attribute [rw] document
1033
+ # @return [Google::Cloud::Language::V1beta2::Document]
1034
+ # Required. Input document.
1035
+ # @!attribute [rw] features
1036
+ # @return [Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features]
1037
+ # Required. The enabled features.
1038
+ # @!attribute [rw] encoding_type
1039
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
1040
+ # The encoding type used by the API to calculate offsets.
1041
+ class AnnotateTextRequest
1042
+ include Google::Protobuf::MessageExts
1043
+ extend Google::Protobuf::MessageExts::ClassMethods
1044
+
1045
+ # All available features for sentiment, syntax, and semantic analysis.
1046
+ # Setting each one to true will enable that specific analysis for the input.
1047
+ # Next ID: 10
1048
+ # @!attribute [rw] extract_syntax
1049
+ # @return [Boolean]
1050
+ # Extract syntax information.
1051
+ # @!attribute [rw] extract_entities
1052
+ # @return [Boolean]
1053
+ # Extract entities.
1054
+ # @!attribute [rw] extract_document_sentiment
1055
+ # @return [Boolean]
1056
+ # Extract document-level sentiment.
1057
+ # @!attribute [rw] extract_entity_sentiment
1058
+ # @return [Boolean]
1059
+ # Extract entities and their associated sentiment.
1060
+ # @!attribute [rw] classify_text
1061
+ # @return [Boolean]
1062
+ # Classify the full document into categories. If this is true,
1063
+ # the API will use the default model which classifies into a
1064
+ # [predefined taxonomy](/natural-language/docs/categories).
1065
+ class Features
1066
+ include Google::Protobuf::MessageExts
1067
+ extend Google::Protobuf::MessageExts::ClassMethods
1068
+ end
1069
+ end
1070
+
1071
+ # The text annotations response message.
1072
+ # @!attribute [rw] sentences
1073
+ # @return [Array<Google::Cloud::Language::V1beta2::Sentence>]
1074
+ # Sentences in the input document. Populated if the user enables
1075
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_syntax AnnotateTextRequest.Features.extract_syntax}.
1076
+ # @!attribute [rw] tokens
1077
+ # @return [Array<Google::Cloud::Language::V1beta2::Token>]
1078
+ # Tokens, along with their syntactic information, in the input document.
1079
+ # Populated if the user enables
1080
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_syntax AnnotateTextRequest.Features.extract_syntax}.
1081
+ # @!attribute [rw] entities
1082
+ # @return [Array<Google::Cloud::Language::V1beta2::Entity>]
1083
+ # Entities, along with their semantic information, in the input document.
1084
+ # Populated if the user enables
1085
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entities AnnotateTextRequest.Features.extract_entities}.
1086
+ # @!attribute [rw] document_sentiment
1087
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
1088
+ # The overall sentiment for the document. Populated if the user enables
1089
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest.Features.extract_document_sentiment}.
1090
+ # @!attribute [rw] language
1091
+ # @return [String]
1092
+ # The language of the text, which will be the same as the language specified
1093
+ # in the request or, if not specified, the automatically-detected language.
1094
+ # See {Google::Cloud::Language::V1beta2::Document#language Document.language} field for more details.
1095
+ # @!attribute [rw] categories
1096
+ # @return [Array<Google::Cloud::Language::V1beta2::ClassificationCategory>]
1097
+ # Categories identified in the input document.
1098
+ class AnnotateTextResponse
1099
+ include Google::Protobuf::MessageExts
1100
+ extend Google::Protobuf::MessageExts::ClassMethods
1101
+ end
1102
+
1103
+ # Represents the text encoding that the caller uses to process the output.
1104
+ # Providing an `EncodingType` is recommended because the API provides the
1105
+ # beginning offsets for various outputs, such as tokens and mentions, and
1106
+ # languages that natively use different text encodings may access offsets
1107
+ # differently.
1108
+ module EncodingType
1109
+ # If `EncodingType` is not specified, encoding-dependent information (such as
1110
+ # `begin_offset`) will be set at `-1`.
1111
+ NONE = 0
1112
+
1113
+ # Encoding-dependent information (such as `begin_offset`) is calculated based
1114
+ # on the UTF-8 encoding of the input. C++ and Go are examples of languages
1115
+ # that use this encoding natively.
1116
+ UTF8 = 1
1117
+
1118
+ # Encoding-dependent information (such as `begin_offset`) is calculated based
1119
+ # on the UTF-16 encoding of the input. Java and JavaScript are examples of
1120
+ # languages that use this encoding natively.
1121
+ UTF16 = 2
1122
+
1123
+ # Encoding-dependent information (such as `begin_offset`) is calculated based
1124
+ # on the UTF-32 encoding of the input. Python is an example of a language
1125
+ # that uses this encoding natively.
1126
+ UTF32 = 3
1127
+ end
1128
+ end
1129
+ end
1130
+ end
1131
+ end