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