/
language_service.pb.go
executable file
·2550 lines (2297 loc) · 105 KB
/
language_service.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v4.25.2
// source: google/cloud/language/v2/language_service.proto
package languagepb
import (
context "context"
reflect "reflect"
sync "sync"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Represents the text encoding that the caller uses to process the output.
// Providing an `EncodingType` is recommended because the API provides the
// beginning offsets for various outputs, such as tokens and mentions, and
// languages that natively use different text encodings may access offsets
// differently.
type EncodingType int32
const (
// If `EncodingType` is not specified, encoding-dependent information (such as
// `begin_offset`) will be set at `-1`.
EncodingType_NONE EncodingType = 0
// Encoding-dependent information (such as `begin_offset`) is calculated based
// on the UTF-8 encoding of the input. C++ and Go are examples of languages
// that use this encoding natively.
EncodingType_UTF8 EncodingType = 1
// Encoding-dependent information (such as `begin_offset`) is calculated based
// on the UTF-16 encoding of the input. Java and JavaScript are examples of
// languages that use this encoding natively.
EncodingType_UTF16 EncodingType = 2
// Encoding-dependent information (such as `begin_offset`) is calculated based
// on the UTF-32 encoding of the input. Python is an example of a language
// that uses this encoding natively.
EncodingType_UTF32 EncodingType = 3
)
// Enum value maps for EncodingType.
var (
EncodingType_name = map[int32]string{
0: "NONE",
1: "UTF8",
2: "UTF16",
3: "UTF32",
}
EncodingType_value = map[string]int32{
"NONE": 0,
"UTF8": 1,
"UTF16": 2,
"UTF32": 3,
}
)
func (x EncodingType) Enum() *EncodingType {
p := new(EncodingType)
*p = x
return p
}
func (x EncodingType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (EncodingType) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_language_v2_language_service_proto_enumTypes[0].Descriptor()
}
func (EncodingType) Type() protoreflect.EnumType {
return &file_google_cloud_language_v2_language_service_proto_enumTypes[0]
}
func (x EncodingType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use EncodingType.Descriptor instead.
func (EncodingType) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{0}
}
// The document types enum.
type Document_Type int32
const (
// The content type is not specified.
Document_TYPE_UNSPECIFIED Document_Type = 0
// Plain text
Document_PLAIN_TEXT Document_Type = 1
// HTML
Document_HTML Document_Type = 2
)
// Enum value maps for Document_Type.
var (
Document_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "PLAIN_TEXT",
2: "HTML",
}
Document_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"PLAIN_TEXT": 1,
"HTML": 2,
}
)
func (x Document_Type) Enum() *Document_Type {
p := new(Document_Type)
*p = x
return p
}
func (x Document_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Document_Type) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_language_v2_language_service_proto_enumTypes[1].Descriptor()
}
func (Document_Type) Type() protoreflect.EnumType {
return &file_google_cloud_language_v2_language_service_proto_enumTypes[1]
}
func (x Document_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Document_Type.Descriptor instead.
func (Document_Type) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{0, 0}
}
// The type of the entity. For most entity types, the associated metadata is a
// Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
// below lists the associated fields for entities that have different
// metadata.
type Entity_Type int32
const (
// Unknown
Entity_UNKNOWN Entity_Type = 0
// Person
Entity_PERSON Entity_Type = 1
// Location
Entity_LOCATION Entity_Type = 2
// Organization
Entity_ORGANIZATION Entity_Type = 3
// Event
Entity_EVENT Entity_Type = 4
// Artwork
Entity_WORK_OF_ART Entity_Type = 5
// Consumer product
Entity_CONSUMER_GOOD Entity_Type = 6
// Other types of entities
Entity_OTHER Entity_Type = 7
// Phone number
//
// The metadata lists the phone number, formatted according to local
// convention, plus whichever additional elements appear in the text:
//
// * `number` - the actual number, broken down into sections as per local
// convention
// * `national_prefix` - country code, if detected
// * `area_code` - region or area code, if detected
// * `extension` - phone extension (to be dialed after connection), if
// detected
Entity_PHONE_NUMBER Entity_Type = 9
// Address
//
// The metadata identifies the street number and locality plus whichever
// additional elements appear in the text:
//
// * `street_number` - street number
// * `locality` - city or town
// * `street_name` - street/route name, if detected
// * `postal_code` - postal code, if detected
// * `country` - country, if detected<
// * `broad_region` - administrative area, such as the state, if detected
// * `narrow_region` - smaller administrative area, such as county, if
// detected
// * `sublocality` - used in Asian addresses to demark a district within a
// city, if detected
Entity_ADDRESS Entity_Type = 10
// Date
//
// The metadata identifies the components of the date:
//
// * `year` - four digit year, if detected
// * `month` - two digit month number, if detected
// * `day` - two digit day number, if detected
Entity_DATE Entity_Type = 11
// Number
//
// The metadata is the number itself.
Entity_NUMBER Entity_Type = 12
// Price
//
// The metadata identifies the `value` and `currency`.
Entity_PRICE Entity_Type = 13
)
// Enum value maps for Entity_Type.
var (
Entity_Type_name = map[int32]string{
0: "UNKNOWN",
1: "PERSON",
2: "LOCATION",
3: "ORGANIZATION",
4: "EVENT",
5: "WORK_OF_ART",
6: "CONSUMER_GOOD",
7: "OTHER",
9: "PHONE_NUMBER",
10: "ADDRESS",
11: "DATE",
12: "NUMBER",
13: "PRICE",
}
Entity_Type_value = map[string]int32{
"UNKNOWN": 0,
"PERSON": 1,
"LOCATION": 2,
"ORGANIZATION": 3,
"EVENT": 4,
"WORK_OF_ART": 5,
"CONSUMER_GOOD": 6,
"OTHER": 7,
"PHONE_NUMBER": 9,
"ADDRESS": 10,
"DATE": 11,
"NUMBER": 12,
"PRICE": 13,
}
)
func (x Entity_Type) Enum() *Entity_Type {
p := new(Entity_Type)
*p = x
return p
}
func (x Entity_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Entity_Type) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_language_v2_language_service_proto_enumTypes[2].Descriptor()
}
func (Entity_Type) Type() protoreflect.EnumType {
return &file_google_cloud_language_v2_language_service_proto_enumTypes[2]
}
func (x Entity_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Entity_Type.Descriptor instead.
func (Entity_Type) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{2, 0}
}
// The supported types of mentions.
type EntityMention_Type int32
const (
// Unknown
EntityMention_TYPE_UNKNOWN EntityMention_Type = 0
// Proper name
EntityMention_PROPER EntityMention_Type = 1
// Common noun (or noun compound)
EntityMention_COMMON EntityMention_Type = 2
)
// Enum value maps for EntityMention_Type.
var (
EntityMention_Type_name = map[int32]string{
0: "TYPE_UNKNOWN",
1: "PROPER",
2: "COMMON",
}
EntityMention_Type_value = map[string]int32{
"TYPE_UNKNOWN": 0,
"PROPER": 1,
"COMMON": 2,
}
)
func (x EntityMention_Type) Enum() *EntityMention_Type {
p := new(EntityMention_Type)
*p = x
return p
}
func (x EntityMention_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (EntityMention_Type) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_language_v2_language_service_proto_enumTypes[3].Descriptor()
}
func (EntityMention_Type) Type() protoreflect.EnumType {
return &file_google_cloud_language_v2_language_service_proto_enumTypes[3]
}
func (x EntityMention_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use EntityMention_Type.Descriptor instead.
func (EntityMention_Type) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{4, 0}
}
// Represents the input to API methods.
type Document struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. If the type is not set or is `TYPE_UNSPECIFIED`,
// returns an `INVALID_ARGUMENT` error.
Type Document_Type `protobuf:"varint,1,opt,name=type,proto3,enum=google.cloud.language.v2.Document_Type" json:"type,omitempty"`
// The source of the document: a string containing the content or a
// Google Cloud Storage URI.
//
// Types that are assignable to Source:
//
// *Document_Content
// *Document_GcsContentUri
Source isDocument_Source `protobuf_oneof:"source"`
// Optional. The language of the document (if not specified, the language is
// automatically detected). Both ISO and BCP-47 language codes are
// accepted.<br>
// [Language
// Support](https://cloud.google.com/natural-language/docs/languages) lists
// currently supported languages for each API method. If the language (either
// specified by the caller or automatically detected) is not supported by the
// called API method, an `INVALID_ARGUMENT` error is returned.
LanguageCode string `protobuf:"bytes,4,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"`
}
func (x *Document) Reset() {
*x = Document{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Document) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Document) ProtoMessage() {}
func (x *Document) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Document.ProtoReflect.Descriptor instead.
func (*Document) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{0}
}
func (x *Document) GetType() Document_Type {
if x != nil {
return x.Type
}
return Document_TYPE_UNSPECIFIED
}
func (m *Document) GetSource() isDocument_Source {
if m != nil {
return m.Source
}
return nil
}
func (x *Document) GetContent() string {
if x, ok := x.GetSource().(*Document_Content); ok {
return x.Content
}
return ""
}
func (x *Document) GetGcsContentUri() string {
if x, ok := x.GetSource().(*Document_GcsContentUri); ok {
return x.GcsContentUri
}
return ""
}
func (x *Document) GetLanguageCode() string {
if x != nil {
return x.LanguageCode
}
return ""
}
type isDocument_Source interface {
isDocument_Source()
}
type Document_Content struct {
// The content of the input in string format.
// Cloud audit logging exempt since it is based on user data.
Content string `protobuf:"bytes,2,opt,name=content,proto3,oneof"`
}
type Document_GcsContentUri struct {
// The Google Cloud Storage URI where the file content is located.
// This URI must be of the form: gs://bucket_name/object_name. For more
// details, see https://cloud.google.com/storage/docs/reference-uris.
// NOTE: Cloud Storage object versioning is not supported.
GcsContentUri string `protobuf:"bytes,3,opt,name=gcs_content_uri,json=gcsContentUri,proto3,oneof"`
}
func (*Document_Content) isDocument_Source() {}
func (*Document_GcsContentUri) isDocument_Source() {}
// Represents a sentence in the input document.
type Sentence struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The sentence text.
Text *TextSpan `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
// For calls to [AnalyzeSentiment][] or if
// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_document_sentiment]
// is set to true, this field will contain the sentiment for the sentence.
Sentiment *Sentiment `protobuf:"bytes,2,opt,name=sentiment,proto3" json:"sentiment,omitempty"`
}
func (x *Sentence) Reset() {
*x = Sentence{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Sentence) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Sentence) ProtoMessage() {}
func (x *Sentence) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Sentence.ProtoReflect.Descriptor instead.
func (*Sentence) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{1}
}
func (x *Sentence) GetText() *TextSpan {
if x != nil {
return x.Text
}
return nil
}
func (x *Sentence) GetSentiment() *Sentiment {
if x != nil {
return x.Sentiment
}
return nil
}
// Represents a phrase in the text that is a known entity, such as
// a person, an organization, or location. The API associates information, such
// as probability and mentions, with entities.
type Entity struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The representative name for the entity.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The entity type.
Type Entity_Type `protobuf:"varint,2,opt,name=type,proto3,enum=google.cloud.language.v2.Entity_Type" json:"type,omitempty"`
// Metadata associated with the entity.
//
// For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
// and Knowledge Graph MID (`mid`), if they are available. For the metadata
// associated with other entity types, see the Type table below.
Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// The mentions of this entity in the input document. The API currently
// supports proper noun mentions.
Mentions []*EntityMention `protobuf:"bytes,5,rep,name=mentions,proto3" json:"mentions,omitempty"`
// For calls to [AnalyzeEntitySentiment][] or if
// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment]
// is set to true, this field will contain the aggregate sentiment expressed
// for this entity in the provided document.
Sentiment *Sentiment `protobuf:"bytes,6,opt,name=sentiment,proto3" json:"sentiment,omitempty"`
}
func (x *Entity) Reset() {
*x = Entity{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Entity) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Entity) ProtoMessage() {}
func (x *Entity) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Entity.ProtoReflect.Descriptor instead.
func (*Entity) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{2}
}
func (x *Entity) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Entity) GetType() Entity_Type {
if x != nil {
return x.Type
}
return Entity_UNKNOWN
}
func (x *Entity) GetMetadata() map[string]string {
if x != nil {
return x.Metadata
}
return nil
}
func (x *Entity) GetMentions() []*EntityMention {
if x != nil {
return x.Mentions
}
return nil
}
func (x *Entity) GetSentiment() *Sentiment {
if x != nil {
return x.Sentiment
}
return nil
}
// Represents the feeling associated with the entire text or entities in
// the text.
type Sentiment struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// A non-negative number in the [0, +inf) range, which represents
// the absolute magnitude of sentiment regardless of score (positive or
// negative).
Magnitude float32 `protobuf:"fixed32,1,opt,name=magnitude,proto3" json:"magnitude,omitempty"`
// Sentiment score between -1.0 (negative sentiment) and 1.0
// (positive sentiment).
Score float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"`
}
func (x *Sentiment) Reset() {
*x = Sentiment{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Sentiment) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Sentiment) ProtoMessage() {}
func (x *Sentiment) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Sentiment.ProtoReflect.Descriptor instead.
func (*Sentiment) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{3}
}
func (x *Sentiment) GetMagnitude() float32 {
if x != nil {
return x.Magnitude
}
return 0
}
func (x *Sentiment) GetScore() float32 {
if x != nil {
return x.Score
}
return 0
}
// Represents a mention for an entity in the text. Currently, proper noun
// mentions are supported.
type EntityMention struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The mention text.
Text *TextSpan `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
// The type of the entity mention.
Type EntityMention_Type `protobuf:"varint,2,opt,name=type,proto3,enum=google.cloud.language.v2.EntityMention_Type" json:"type,omitempty"`
// For calls to [AnalyzeEntitySentiment][] or if
// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment]
// is set to true, this field will contain the sentiment expressed for this
// mention of the entity in the provided document.
Sentiment *Sentiment `protobuf:"bytes,3,opt,name=sentiment,proto3" json:"sentiment,omitempty"`
// Probability score associated with the entity.
//
// The score shows the probability of the entity mention being the entity
// type. The score is in (0, 1] range.
Probability float32 `protobuf:"fixed32,4,opt,name=probability,proto3" json:"probability,omitempty"`
}
func (x *EntityMention) Reset() {
*x = EntityMention{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EntityMention) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EntityMention) ProtoMessage() {}
func (x *EntityMention) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EntityMention.ProtoReflect.Descriptor instead.
func (*EntityMention) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{4}
}
func (x *EntityMention) GetText() *TextSpan {
if x != nil {
return x.Text
}
return nil
}
func (x *EntityMention) GetType() EntityMention_Type {
if x != nil {
return x.Type
}
return EntityMention_TYPE_UNKNOWN
}
func (x *EntityMention) GetSentiment() *Sentiment {
if x != nil {
return x.Sentiment
}
return nil
}
func (x *EntityMention) GetProbability() float32 {
if x != nil {
return x.Probability
}
return 0
}
// Represents a text span in the input document.
type TextSpan struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The content of the text span, which is a substring of the document.
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
// The API calculates the beginning offset of the content in the original
// document according to the
// [EncodingType][google.cloud.language.v2.EncodingType] specified in the API
// request.
BeginOffset int32 `protobuf:"varint,2,opt,name=begin_offset,json=beginOffset,proto3" json:"begin_offset,omitempty"`
}
func (x *TextSpan) Reset() {
*x = TextSpan{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TextSpan) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TextSpan) ProtoMessage() {}
func (x *TextSpan) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TextSpan.ProtoReflect.Descriptor instead.
func (*TextSpan) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{5}
}
func (x *TextSpan) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *TextSpan) GetBeginOffset() int32 {
if x != nil {
return x.BeginOffset
}
return 0
}
// Represents a category returned from the text classifier.
type ClassificationCategory struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the category representing the document.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The classifier's confidence of the category. Number represents how certain
// the classifier is that this category represents the given text.
Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
}
func (x *ClassificationCategory) Reset() {
*x = ClassificationCategory{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ClassificationCategory) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ClassificationCategory) ProtoMessage() {}
func (x *ClassificationCategory) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ClassificationCategory.ProtoReflect.Descriptor instead.
func (*ClassificationCategory) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{6}
}
func (x *ClassificationCategory) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ClassificationCategory) GetConfidence() float32 {
if x != nil {
return x.Confidence
}
return 0
}
// The sentiment analysis request message.
type AnalyzeSentimentRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. Input document.
Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
// The encoding type used by the API to calculate sentence offsets.
EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,proto3,enum=google.cloud.language.v2.EncodingType" json:"encoding_type,omitempty"`
}
func (x *AnalyzeSentimentRequest) Reset() {
*x = AnalyzeSentimentRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AnalyzeSentimentRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AnalyzeSentimentRequest) ProtoMessage() {}
func (x *AnalyzeSentimentRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AnalyzeSentimentRequest.ProtoReflect.Descriptor instead.
func (*AnalyzeSentimentRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{7}
}
func (x *AnalyzeSentimentRequest) GetDocument() *Document {
if x != nil {
return x.Document
}
return nil
}
func (x *AnalyzeSentimentRequest) GetEncodingType() EncodingType {
if x != nil {
return x.EncodingType
}
return EncodingType_NONE
}
// The sentiment analysis response message.
type AnalyzeSentimentResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The overall sentiment of the input document.
DocumentSentiment *Sentiment `protobuf:"bytes,1,opt,name=document_sentiment,json=documentSentiment,proto3" json:"document_sentiment,omitempty"`
// The language of the text, which will be the same as the language specified
// in the request or, if not specified, the automatically-detected language.
// See [Document.language][] field for more details.
LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"`
// The sentiment for all the sentences in the document.
Sentences []*Sentence `protobuf:"bytes,3,rep,name=sentences,proto3" json:"sentences,omitempty"`
// Whether the language is officially supported. The API may still return a
// response when the language is not supported, but it is on a best effort
// basis.
LanguageSupported bool `protobuf:"varint,4,opt,name=language_supported,json=languageSupported,proto3" json:"language_supported,omitempty"`
}
func (x *AnalyzeSentimentResponse) Reset() {
*x = AnalyzeSentimentResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AnalyzeSentimentResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AnalyzeSentimentResponse) ProtoMessage() {}
func (x *AnalyzeSentimentResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_language_v2_language_service_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AnalyzeSentimentResponse.ProtoReflect.Descriptor instead.
func (*AnalyzeSentimentResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_language_v2_language_service_proto_rawDescGZIP(), []int{8}
}
func (x *AnalyzeSentimentResponse) GetDocumentSentiment() *Sentiment {
if x != nil {
return x.DocumentSentiment
}
return nil
}