Documentation ¶
Index ¶
- Variables
- func RegisterLanguageServiceServer(s *grpc.Server, srv LanguageServiceServer)
- type AnalyzeEntitiesRequest
- func (*AnalyzeEntitiesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AnalyzeEntitiesRequest) GetDocument() *Document
- func (x *AnalyzeEntitiesRequest) GetEncodingType() EncodingType
- func (*AnalyzeEntitiesRequest) ProtoMessage()
- func (x *AnalyzeEntitiesRequest) ProtoReflect() protoreflect.Message
- func (x *AnalyzeEntitiesRequest) Reset()
- func (x *AnalyzeEntitiesRequest) String() string
- type AnalyzeEntitiesResponse
- func (*AnalyzeEntitiesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AnalyzeEntitiesResponse) GetEntities() []*Entity
- func (x *AnalyzeEntitiesResponse) GetLanguageCode() string
- func (x *AnalyzeEntitiesResponse) GetLanguageSupported() bool
- func (*AnalyzeEntitiesResponse) ProtoMessage()
- func (x *AnalyzeEntitiesResponse) ProtoReflect() protoreflect.Message
- func (x *AnalyzeEntitiesResponse) Reset()
- func (x *AnalyzeEntitiesResponse) String() string
- type AnalyzeSentimentRequest
- func (*AnalyzeSentimentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AnalyzeSentimentRequest) GetDocument() *Document
- func (x *AnalyzeSentimentRequest) GetEncodingType() EncodingType
- func (*AnalyzeSentimentRequest) ProtoMessage()
- func (x *AnalyzeSentimentRequest) ProtoReflect() protoreflect.Message
- func (x *AnalyzeSentimentRequest) Reset()
- func (x *AnalyzeSentimentRequest) String() string
- type AnalyzeSentimentResponse
- func (*AnalyzeSentimentResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AnalyzeSentimentResponse) GetDocumentSentiment() *Sentiment
- func (x *AnalyzeSentimentResponse) GetLanguageCode() string
- func (x *AnalyzeSentimentResponse) GetLanguageSupported() bool
- func (x *AnalyzeSentimentResponse) GetSentences() []*Sentence
- func (*AnalyzeSentimentResponse) ProtoMessage()
- func (x *AnalyzeSentimentResponse) ProtoReflect() protoreflect.Message
- func (x *AnalyzeSentimentResponse) Reset()
- func (x *AnalyzeSentimentResponse) String() string
- type AnnotateTextRequest
- func (*AnnotateTextRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AnnotateTextRequest) GetDocument() *Document
- func (x *AnnotateTextRequest) GetEncodingType() EncodingType
- func (x *AnnotateTextRequest) GetFeatures() *AnnotateTextRequest_Features
- func (*AnnotateTextRequest) ProtoMessage()
- func (x *AnnotateTextRequest) ProtoReflect() protoreflect.Message
- func (x *AnnotateTextRequest) Reset()
- func (x *AnnotateTextRequest) String() string
- type AnnotateTextRequest_Features
- func (*AnnotateTextRequest_Features) Descriptor() ([]byte, []int)deprecated
- func (x *AnnotateTextRequest_Features) GetClassifyText() bool
- func (x *AnnotateTextRequest_Features) GetExtractDocumentSentiment() bool
- func (x *AnnotateTextRequest_Features) GetExtractEntities() bool
- func (x *AnnotateTextRequest_Features) GetModerateText() bool
- func (*AnnotateTextRequest_Features) ProtoMessage()
- func (x *AnnotateTextRequest_Features) ProtoReflect() protoreflect.Message
- func (x *AnnotateTextRequest_Features) Reset()
- func (x *AnnotateTextRequest_Features) String() string
- type AnnotateTextResponse
- func (*AnnotateTextResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AnnotateTextResponse) GetCategories() []*ClassificationCategory
- func (x *AnnotateTextResponse) GetDocumentSentiment() *Sentiment
- func (x *AnnotateTextResponse) GetEntities() []*Entity
- func (x *AnnotateTextResponse) GetLanguageCode() string
- func (x *AnnotateTextResponse) GetLanguageSupported() bool
- func (x *AnnotateTextResponse) GetModerationCategories() []*ClassificationCategory
- func (x *AnnotateTextResponse) GetSentences() []*Sentence
- func (*AnnotateTextResponse) ProtoMessage()
- func (x *AnnotateTextResponse) ProtoReflect() protoreflect.Message
- func (x *AnnotateTextResponse) Reset()
- func (x *AnnotateTextResponse) String() string
- type ClassificationCategory
- func (*ClassificationCategory) Descriptor() ([]byte, []int)deprecated
- func (x *ClassificationCategory) GetConfidence() float32
- func (x *ClassificationCategory) GetName() string
- func (x *ClassificationCategory) GetSeverity() float32
- func (*ClassificationCategory) ProtoMessage()
- func (x *ClassificationCategory) ProtoReflect() protoreflect.Message
- func (x *ClassificationCategory) Reset()
- func (x *ClassificationCategory) String() string
- type ClassifyTextRequest
- func (*ClassifyTextRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ClassifyTextRequest) GetDocument() *Document
- func (*ClassifyTextRequest) ProtoMessage()
- func (x *ClassifyTextRequest) ProtoReflect() protoreflect.Message
- func (x *ClassifyTextRequest) Reset()
- func (x *ClassifyTextRequest) String() string
- type ClassifyTextResponse
- func (*ClassifyTextResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ClassifyTextResponse) GetCategories() []*ClassificationCategory
- func (x *ClassifyTextResponse) GetLanguageCode() string
- func (x *ClassifyTextResponse) GetLanguageSupported() bool
- func (*ClassifyTextResponse) ProtoMessage()
- func (x *ClassifyTextResponse) ProtoReflect() protoreflect.Message
- func (x *ClassifyTextResponse) Reset()
- func (x *ClassifyTextResponse) String() string
- type Document
- func (*Document) Descriptor() ([]byte, []int)deprecated
- func (x *Document) GetContent() string
- func (x *Document) GetGcsContentUri() string
- func (x *Document) GetLanguageCode() string
- func (m *Document) GetSource() isDocument_Source
- func (x *Document) GetType() Document_Type
- func (*Document) ProtoMessage()
- func (x *Document) ProtoReflect() protoreflect.Message
- func (x *Document) Reset()
- func (x *Document) String() string
- type Document_Content
- type Document_GcsContentUri
- type Document_Type
- func (Document_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Document_Type) Enum() *Document_Type
- func (Document_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Document_Type) Number() protoreflect.EnumNumber
- func (x Document_Type) String() string
- func (Document_Type) Type() protoreflect.EnumType
- type EncodingType
- func (EncodingType) Descriptor() protoreflect.EnumDescriptor
- func (x EncodingType) Enum() *EncodingType
- func (EncodingType) EnumDescriptor() ([]byte, []int)deprecated
- func (x EncodingType) Number() protoreflect.EnumNumber
- func (x EncodingType) String() string
- func (EncodingType) Type() protoreflect.EnumType
- type Entity
- func (*Entity) Descriptor() ([]byte, []int)deprecated
- func (x *Entity) GetMentions() []*EntityMention
- func (x *Entity) GetMetadata() map[string]string
- func (x *Entity) GetName() string
- func (x *Entity) GetSentiment() *Sentiment
- func (x *Entity) GetType() Entity_Type
- func (*Entity) ProtoMessage()
- func (x *Entity) ProtoReflect() protoreflect.Message
- func (x *Entity) Reset()
- func (x *Entity) String() string
- type EntityMention
- func (*EntityMention) Descriptor() ([]byte, []int)deprecated
- func (x *EntityMention) GetProbability() float32
- func (x *EntityMention) GetSentiment() *Sentiment
- func (x *EntityMention) GetText() *TextSpan
- func (x *EntityMention) GetType() EntityMention_Type
- func (*EntityMention) ProtoMessage()
- func (x *EntityMention) ProtoReflect() protoreflect.Message
- func (x *EntityMention) Reset()
- func (x *EntityMention) String() string
- type EntityMention_Type
- func (EntityMention_Type) Descriptor() protoreflect.EnumDescriptor
- func (x EntityMention_Type) Enum() *EntityMention_Type
- func (EntityMention_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x EntityMention_Type) Number() protoreflect.EnumNumber
- func (x EntityMention_Type) String() string
- func (EntityMention_Type) Type() protoreflect.EnumType
- type Entity_Type
- func (Entity_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Entity_Type) Enum() *Entity_Type
- func (Entity_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Entity_Type) Number() protoreflect.EnumNumber
- func (x Entity_Type) String() string
- func (Entity_Type) Type() protoreflect.EnumType
- type LanguageServiceClient
- type LanguageServiceServer
- type ModerateTextRequest
- func (*ModerateTextRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ModerateTextRequest) GetDocument() *Document
- func (x *ModerateTextRequest) GetModelVersion() ModerateTextRequest_ModelVersion
- func (*ModerateTextRequest) ProtoMessage()
- func (x *ModerateTextRequest) ProtoReflect() protoreflect.Message
- func (x *ModerateTextRequest) Reset()
- func (x *ModerateTextRequest) String() string
- type ModerateTextRequest_ModelVersion
- func (ModerateTextRequest_ModelVersion) Descriptor() protoreflect.EnumDescriptor
- func (x ModerateTextRequest_ModelVersion) Enum() *ModerateTextRequest_ModelVersion
- func (ModerateTextRequest_ModelVersion) EnumDescriptor() ([]byte, []int)deprecated
- func (x ModerateTextRequest_ModelVersion) Number() protoreflect.EnumNumber
- func (x ModerateTextRequest_ModelVersion) String() string
- func (ModerateTextRequest_ModelVersion) Type() protoreflect.EnumType
- type ModerateTextResponse
- func (*ModerateTextResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ModerateTextResponse) GetLanguageCode() string
- func (x *ModerateTextResponse) GetLanguageSupported() bool
- func (x *ModerateTextResponse) GetModerationCategories() []*ClassificationCategory
- func (*ModerateTextResponse) ProtoMessage()
- func (x *ModerateTextResponse) ProtoReflect() protoreflect.Message
- func (x *ModerateTextResponse) Reset()
- func (x *ModerateTextResponse) String() string
- type Sentence
- type Sentiment
- type TextSpan
- type UnimplementedLanguageServiceServer
- func (*UnimplementedLanguageServiceServer) AnalyzeEntities(context.Context, *AnalyzeEntitiesRequest) (*AnalyzeEntitiesResponse, error)
- func (*UnimplementedLanguageServiceServer) AnalyzeSentiment(context.Context, *AnalyzeSentimentRequest) (*AnalyzeSentimentResponse, error)
- func (*UnimplementedLanguageServiceServer) AnnotateText(context.Context, *AnnotateTextRequest) (*AnnotateTextResponse, error)
- func (*UnimplementedLanguageServiceServer) ClassifyText(context.Context, *ClassifyTextRequest) (*ClassifyTextResponse, error)
- func (*UnimplementedLanguageServiceServer) ModerateText(context.Context, *ModerateTextRequest) (*ModerateTextResponse, error)
Constants ¶
This section is empty.
Variables ¶
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, } )
Enum value maps for EncodingType.
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, } )
Enum value maps for Document_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, } )
Enum value maps for Entity_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, } )
Enum value maps for EntityMention_Type.
var ( ModerateTextRequest_ModelVersion_name = map[int32]string{ 0: "MODEL_VERSION_UNSPECIFIED", 1: "MODEL_VERSION_1", 2: "MODEL_VERSION_2", } ModerateTextRequest_ModelVersion_value = map[string]int32{ "MODEL_VERSION_UNSPECIFIED": 0, "MODEL_VERSION_1": 1, "MODEL_VERSION_2": 2, } )
Enum value maps for ModerateTextRequest_ModelVersion.
var File_google_cloud_language_v2_language_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterLanguageServiceServer ¶
func RegisterLanguageServiceServer(s *grpc.Server, srv LanguageServiceServer)
Types ¶
type AnalyzeEntitiesRequest ¶
type AnalyzeEntitiesRequest struct { // Required. Input document. Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` // The encoding type used by the API to calculate offsets. EncodingType EncodingType `` /* 141-byte string literal not displayed */ // contains filtered or unexported fields }
The entity analysis request message.
func (*AnalyzeEntitiesRequest) Descriptor
deprecated
func (*AnalyzeEntitiesRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnalyzeEntitiesRequest.ProtoReflect.Descriptor instead.
func (*AnalyzeEntitiesRequest) GetDocument ¶
func (x *AnalyzeEntitiesRequest) GetDocument() *Document
func (*AnalyzeEntitiesRequest) GetEncodingType ¶
func (x *AnalyzeEntitiesRequest) GetEncodingType() EncodingType
func (*AnalyzeEntitiesRequest) ProtoMessage ¶
func (*AnalyzeEntitiesRequest) ProtoMessage()
func (*AnalyzeEntitiesRequest) ProtoReflect ¶
func (x *AnalyzeEntitiesRequest) ProtoReflect() protoreflect.Message
func (*AnalyzeEntitiesRequest) Reset ¶
func (x *AnalyzeEntitiesRequest) Reset()
func (*AnalyzeEntitiesRequest) String ¶
func (x *AnalyzeEntitiesRequest) String() string
type AnalyzeEntitiesResponse ¶
type AnalyzeEntitiesResponse struct { // The recognized entities in the input document. Entities []*Entity `protobuf:"bytes,1,rep,name=entities,proto3" json:"entities,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"` // 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,3,opt,name=language_supported,json=languageSupported,proto3" json:"language_supported,omitempty"` // contains filtered or unexported fields }
The entity analysis response message.
func (*AnalyzeEntitiesResponse) Descriptor
deprecated
func (*AnalyzeEntitiesResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnalyzeEntitiesResponse.ProtoReflect.Descriptor instead.
func (*AnalyzeEntitiesResponse) GetEntities ¶
func (x *AnalyzeEntitiesResponse) GetEntities() []*Entity
func (*AnalyzeEntitiesResponse) GetLanguageCode ¶
func (x *AnalyzeEntitiesResponse) GetLanguageCode() string
func (*AnalyzeEntitiesResponse) GetLanguageSupported ¶
func (x *AnalyzeEntitiesResponse) GetLanguageSupported() bool
func (*AnalyzeEntitiesResponse) ProtoMessage ¶
func (*AnalyzeEntitiesResponse) ProtoMessage()
func (*AnalyzeEntitiesResponse) ProtoReflect ¶
func (x *AnalyzeEntitiesResponse) ProtoReflect() protoreflect.Message
func (*AnalyzeEntitiesResponse) Reset ¶
func (x *AnalyzeEntitiesResponse) Reset()
func (*AnalyzeEntitiesResponse) String ¶
func (x *AnalyzeEntitiesResponse) String() string
type AnalyzeSentimentRequest ¶
type AnalyzeSentimentRequest struct { // 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 `` /* 141-byte string literal not displayed */ // contains filtered or unexported fields }
The sentiment analysis request message.
func (*AnalyzeSentimentRequest) Descriptor
deprecated
func (*AnalyzeSentimentRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnalyzeSentimentRequest.ProtoReflect.Descriptor instead.
func (*AnalyzeSentimentRequest) GetDocument ¶
func (x *AnalyzeSentimentRequest) GetDocument() *Document
func (*AnalyzeSentimentRequest) GetEncodingType ¶
func (x *AnalyzeSentimentRequest) GetEncodingType() EncodingType
func (*AnalyzeSentimentRequest) ProtoMessage ¶
func (*AnalyzeSentimentRequest) ProtoMessage()
func (*AnalyzeSentimentRequest) ProtoReflect ¶
func (x *AnalyzeSentimentRequest) ProtoReflect() protoreflect.Message
func (*AnalyzeSentimentRequest) Reset ¶
func (x *AnalyzeSentimentRequest) Reset()
func (*AnalyzeSentimentRequest) String ¶
func (x *AnalyzeSentimentRequest) String() string
type AnalyzeSentimentResponse ¶
type AnalyzeSentimentResponse struct { // 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"` // contains filtered or unexported fields }
The sentiment analysis response message.
func (*AnalyzeSentimentResponse) Descriptor
deprecated
func (*AnalyzeSentimentResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnalyzeSentimentResponse.ProtoReflect.Descriptor instead.
func (*AnalyzeSentimentResponse) GetDocumentSentiment ¶
func (x *AnalyzeSentimentResponse) GetDocumentSentiment() *Sentiment
func (*AnalyzeSentimentResponse) GetLanguageCode ¶
func (x *AnalyzeSentimentResponse) GetLanguageCode() string
func (*AnalyzeSentimentResponse) GetLanguageSupported ¶
func (x *AnalyzeSentimentResponse) GetLanguageSupported() bool
func (*AnalyzeSentimentResponse) GetSentences ¶
func (x *AnalyzeSentimentResponse) GetSentences() []*Sentence
func (*AnalyzeSentimentResponse) ProtoMessage ¶
func (*AnalyzeSentimentResponse) ProtoMessage()
func (*AnalyzeSentimentResponse) ProtoReflect ¶
func (x *AnalyzeSentimentResponse) ProtoReflect() protoreflect.Message
func (*AnalyzeSentimentResponse) Reset ¶
func (x *AnalyzeSentimentResponse) Reset()
func (*AnalyzeSentimentResponse) String ¶
func (x *AnalyzeSentimentResponse) String() string
type AnnotateTextRequest ¶
type AnnotateTextRequest struct { // Required. Input document. Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` // Required. The enabled features. Features *AnnotateTextRequest_Features `protobuf:"bytes,2,opt,name=features,proto3" json:"features,omitempty"` // The encoding type used by the API to calculate offsets. EncodingType EncodingType `` /* 141-byte string literal not displayed */ // contains filtered or unexported fields }
The request message for the text annotation API, which can perform multiple analysis types in one call.
func (*AnnotateTextRequest) Descriptor
deprecated
func (*AnnotateTextRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnnotateTextRequest.ProtoReflect.Descriptor instead.
func (*AnnotateTextRequest) GetDocument ¶
func (x *AnnotateTextRequest) GetDocument() *Document
func (*AnnotateTextRequest) GetEncodingType ¶
func (x *AnnotateTextRequest) GetEncodingType() EncodingType
func (*AnnotateTextRequest) GetFeatures ¶
func (x *AnnotateTextRequest) GetFeatures() *AnnotateTextRequest_Features
func (*AnnotateTextRequest) ProtoMessage ¶
func (*AnnotateTextRequest) ProtoMessage()
func (*AnnotateTextRequest) ProtoReflect ¶
func (x *AnnotateTextRequest) ProtoReflect() protoreflect.Message
func (*AnnotateTextRequest) Reset ¶
func (x *AnnotateTextRequest) Reset()
func (*AnnotateTextRequest) String ¶
func (x *AnnotateTextRequest) String() string
type AnnotateTextRequest_Features ¶
type AnnotateTextRequest_Features struct { // Optional. Extract entities. ExtractEntities bool `protobuf:"varint,1,opt,name=extract_entities,json=extractEntities,proto3" json:"extract_entities,omitempty"` // Optional. Extract document-level sentiment. ExtractDocumentSentiment bool `` /* 136-byte string literal not displayed */ // Optional. Classify the full document into categories. ClassifyText bool `protobuf:"varint,4,opt,name=classify_text,json=classifyText,proto3" json:"classify_text,omitempty"` // Optional. Moderate the document for harmful and sensitive categories. ModerateText bool `protobuf:"varint,5,opt,name=moderate_text,json=moderateText,proto3" json:"moderate_text,omitempty"` // contains filtered or unexported fields }
All available features. Setting each one to true will enable that specific analysis for the input.
func (*AnnotateTextRequest_Features) Descriptor
deprecated
func (*AnnotateTextRequest_Features) Descriptor() ([]byte, []int)
Deprecated: Use AnnotateTextRequest_Features.ProtoReflect.Descriptor instead.
func (*AnnotateTextRequest_Features) GetClassifyText ¶
func (x *AnnotateTextRequest_Features) GetClassifyText() bool
func (*AnnotateTextRequest_Features) GetExtractDocumentSentiment ¶
func (x *AnnotateTextRequest_Features) GetExtractDocumentSentiment() bool
func (*AnnotateTextRequest_Features) GetExtractEntities ¶
func (x *AnnotateTextRequest_Features) GetExtractEntities() bool
func (*AnnotateTextRequest_Features) GetModerateText ¶
func (x *AnnotateTextRequest_Features) GetModerateText() bool
func (*AnnotateTextRequest_Features) ProtoMessage ¶
func (*AnnotateTextRequest_Features) ProtoMessage()
func (*AnnotateTextRequest_Features) ProtoReflect ¶
func (x *AnnotateTextRequest_Features) ProtoReflect() protoreflect.Message
func (*AnnotateTextRequest_Features) Reset ¶
func (x *AnnotateTextRequest_Features) Reset()
func (*AnnotateTextRequest_Features) String ¶
func (x *AnnotateTextRequest_Features) String() string
type AnnotateTextResponse ¶
type AnnotateTextResponse struct { // Sentences in the input document. Populated if the user enables // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_document_sentiment]. Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences,proto3" json:"sentences,omitempty"` // Entities, along with their semantic information, in the input document. // Populated if the user enables // [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v2.AnnotateTextRequest.Features.extract_entities] // or // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment]. Entities []*Entity `protobuf:"bytes,2,rep,name=entities,proto3" json:"entities,omitempty"` // The overall sentiment for the document. Populated if the user enables // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_document_sentiment]. DocumentSentiment *Sentiment `protobuf:"bytes,3,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,4,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` // Categories identified in the input document. Categories []*ClassificationCategory `protobuf:"bytes,5,rep,name=categories,proto3" json:"categories,omitempty"` // Harmful and sensitive categories identified in the input document. ModerationCategories []*ClassificationCategory `protobuf:"bytes,6,rep,name=moderation_categories,json=moderationCategories,proto3" json:"moderation_categories,omitempty"` // Whether the language is officially supported by all requested features. // 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,7,opt,name=language_supported,json=languageSupported,proto3" json:"language_supported,omitempty"` // contains filtered or unexported fields }
The text annotations response message.
func (*AnnotateTextResponse) Descriptor
deprecated
func (*AnnotateTextResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnnotateTextResponse.ProtoReflect.Descriptor instead.
func (*AnnotateTextResponse) GetCategories ¶
func (x *AnnotateTextResponse) GetCategories() []*ClassificationCategory
func (*AnnotateTextResponse) GetDocumentSentiment ¶
func (x *AnnotateTextResponse) GetDocumentSentiment() *Sentiment
func (*AnnotateTextResponse) GetEntities ¶
func (x *AnnotateTextResponse) GetEntities() []*Entity
func (*AnnotateTextResponse) GetLanguageCode ¶
func (x *AnnotateTextResponse) GetLanguageCode() string
func (*AnnotateTextResponse) GetLanguageSupported ¶
func (x *AnnotateTextResponse) GetLanguageSupported() bool
func (*AnnotateTextResponse) GetModerationCategories ¶
func (x *AnnotateTextResponse) GetModerationCategories() []*ClassificationCategory
func (*AnnotateTextResponse) GetSentences ¶
func (x *AnnotateTextResponse) GetSentences() []*Sentence
func (*AnnotateTextResponse) ProtoMessage ¶
func (*AnnotateTextResponse) ProtoMessage()
func (*AnnotateTextResponse) ProtoReflect ¶
func (x *AnnotateTextResponse) ProtoReflect() protoreflect.Message
func (*AnnotateTextResponse) Reset ¶
func (x *AnnotateTextResponse) Reset()
func (*AnnotateTextResponse) String ¶
func (x *AnnotateTextResponse) String() string
type ClassificationCategory ¶
type ClassificationCategory struct { // 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"` // Optional. The classifier's severity of the category. This is only present // when the ModerateTextRequest.ModelVersion is set to MODEL_VERSION_2, and // the corresponding category has a severity score. Severity float32 `protobuf:"fixed32,3,opt,name=severity,proto3" json:"severity,omitempty"` // contains filtered or unexported fields }
Represents a category returned from the text classifier.
func (*ClassificationCategory) Descriptor
deprecated
func (*ClassificationCategory) Descriptor() ([]byte, []int)
Deprecated: Use ClassificationCategory.ProtoReflect.Descriptor instead.
func (*ClassificationCategory) GetConfidence ¶
func (x *ClassificationCategory) GetConfidence() float32
func (*ClassificationCategory) GetName ¶
func (x *ClassificationCategory) GetName() string
func (*ClassificationCategory) GetSeverity ¶ added in v1.13.0
func (x *ClassificationCategory) GetSeverity() float32
func (*ClassificationCategory) ProtoMessage ¶
func (*ClassificationCategory) ProtoMessage()
func (*ClassificationCategory) ProtoReflect ¶
func (x *ClassificationCategory) ProtoReflect() protoreflect.Message
func (*ClassificationCategory) Reset ¶
func (x *ClassificationCategory) Reset()
func (*ClassificationCategory) String ¶
func (x *ClassificationCategory) String() string
type ClassifyTextRequest ¶
type ClassifyTextRequest struct { // Required. Input document. Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` // contains filtered or unexported fields }
The document classification request message.
func (*ClassifyTextRequest) Descriptor
deprecated
func (*ClassifyTextRequest) Descriptor() ([]byte, []int)
Deprecated: Use ClassifyTextRequest.ProtoReflect.Descriptor instead.
func (*ClassifyTextRequest) GetDocument ¶
func (x *ClassifyTextRequest) GetDocument() *Document
func (*ClassifyTextRequest) ProtoMessage ¶
func (*ClassifyTextRequest) ProtoMessage()
func (*ClassifyTextRequest) ProtoReflect ¶
func (x *ClassifyTextRequest) ProtoReflect() protoreflect.Message
func (*ClassifyTextRequest) Reset ¶
func (x *ClassifyTextRequest) Reset()
func (*ClassifyTextRequest) String ¶
func (x *ClassifyTextRequest) String() string
type ClassifyTextResponse ¶
type ClassifyTextResponse struct { // Categories representing the input document. Categories []*ClassificationCategory `protobuf:"bytes,1,rep,name=categories,proto3" json:"categories,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"` // 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,3,opt,name=language_supported,json=languageSupported,proto3" json:"language_supported,omitempty"` // contains filtered or unexported fields }
The document classification response message.
func (*ClassifyTextResponse) Descriptor
deprecated
func (*ClassifyTextResponse) Descriptor() ([]byte, []int)
Deprecated: Use ClassifyTextResponse.ProtoReflect.Descriptor instead.
func (*ClassifyTextResponse) GetCategories ¶
func (x *ClassifyTextResponse) GetCategories() []*ClassificationCategory
func (*ClassifyTextResponse) GetLanguageCode ¶
func (x *ClassifyTextResponse) GetLanguageCode() string
func (*ClassifyTextResponse) GetLanguageSupported ¶
func (x *ClassifyTextResponse) GetLanguageSupported() bool
func (*ClassifyTextResponse) ProtoMessage ¶
func (*ClassifyTextResponse) ProtoMessage()
func (*ClassifyTextResponse) ProtoReflect ¶
func (x *ClassifyTextResponse) ProtoReflect() protoreflect.Message
func (*ClassifyTextResponse) Reset ¶
func (x *ClassifyTextResponse) Reset()
func (*ClassifyTextResponse) String ¶
func (x *ClassifyTextResponse) String() string
type Document ¶
type Document struct { // 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"` // contains filtered or unexported fields }
Represents the input to API methods.
func (*Document) Descriptor
deprecated
func (*Document) GetContent ¶
func (*Document) GetGcsContentUri ¶
func (*Document) GetLanguageCode ¶
func (*Document) GetType ¶
func (x *Document) GetType() Document_Type
func (*Document) ProtoMessage ¶
func (*Document) ProtoMessage()
func (*Document) ProtoReflect ¶
func (x *Document) ProtoReflect() protoreflect.Message
type Document_Content ¶
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 ¶
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"` }
type Document_Type ¶
type Document_Type int32
The document types enum.
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 )
func (Document_Type) Descriptor ¶
func (Document_Type) Descriptor() protoreflect.EnumDescriptor
func (Document_Type) Enum ¶
func (x Document_Type) Enum() *Document_Type
func (Document_Type) EnumDescriptor
deprecated
func (Document_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Document_Type.Descriptor instead.
func (Document_Type) Number ¶
func (x Document_Type) Number() protoreflect.EnumNumber
func (Document_Type) String ¶
func (x Document_Type) String() string
func (Document_Type) Type ¶
func (Document_Type) Type() protoreflect.EnumType
type EncodingType ¶
type EncodingType int32
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.
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 )
func (EncodingType) Descriptor ¶
func (EncodingType) Descriptor() protoreflect.EnumDescriptor
func (EncodingType) Enum ¶
func (x EncodingType) Enum() *EncodingType
func (EncodingType) EnumDescriptor
deprecated
func (EncodingType) EnumDescriptor() ([]byte, []int)
Deprecated: Use EncodingType.Descriptor instead.
func (EncodingType) Number ¶
func (x EncodingType) Number() protoreflect.EnumNumber
func (EncodingType) String ¶
func (x EncodingType) String() string
func (EncodingType) Type ¶
func (EncodingType) Type() protoreflect.EnumType
type Entity ¶
type Entity struct { // 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 the metadata // associated with other entity types, see the Type table below. Metadata map[string]string `` /* 157-byte string literal not displayed */ // 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"` // contains filtered or unexported fields }
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.
func (*Entity) Descriptor
deprecated
func (*Entity) GetMentions ¶
func (x *Entity) GetMentions() []*EntityMention
func (*Entity) GetMetadata ¶
func (*Entity) GetSentiment ¶
func (*Entity) GetType ¶
func (x *Entity) GetType() Entity_Type
func (*Entity) ProtoMessage ¶
func (*Entity) ProtoMessage()
func (*Entity) ProtoReflect ¶
func (x *Entity) ProtoReflect() protoreflect.Message
type EntityMention ¶
type EntityMention struct { // 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"` // contains filtered or unexported fields }
Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
func (*EntityMention) Descriptor
deprecated
func (*EntityMention) Descriptor() ([]byte, []int)
Deprecated: Use EntityMention.ProtoReflect.Descriptor instead.
func (*EntityMention) GetProbability ¶
func (x *EntityMention) GetProbability() float32
func (*EntityMention) GetSentiment ¶
func (x *EntityMention) GetSentiment() *Sentiment
func (*EntityMention) GetText ¶
func (x *EntityMention) GetText() *TextSpan
func (*EntityMention) GetType ¶
func (x *EntityMention) GetType() EntityMention_Type
func (*EntityMention) ProtoMessage ¶
func (*EntityMention) ProtoMessage()
func (*EntityMention) ProtoReflect ¶
func (x *EntityMention) ProtoReflect() protoreflect.Message
func (*EntityMention) Reset ¶
func (x *EntityMention) Reset()
func (*EntityMention) String ¶
func (x *EntityMention) String() string
type EntityMention_Type ¶
type EntityMention_Type int32
The supported types of mentions.
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 )
func (EntityMention_Type) Descriptor ¶
func (EntityMention_Type) Descriptor() protoreflect.EnumDescriptor
func (EntityMention_Type) Enum ¶
func (x EntityMention_Type) Enum() *EntityMention_Type
func (EntityMention_Type) EnumDescriptor
deprecated
func (EntityMention_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use EntityMention_Type.Descriptor instead.
func (EntityMention_Type) Number ¶
func (x EntityMention_Type) Number() protoreflect.EnumNumber
func (EntityMention_Type) String ¶
func (x EntityMention_Type) String() string
func (EntityMention_Type) Type ¶
func (EntityMention_Type) Type() protoreflect.EnumType
type Entity_Type ¶
type Entity_Type int32
The type of the entity. The table below lists the associated fields for entities that have different metadata.
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 )
func (Entity_Type) Descriptor ¶
func (Entity_Type) Descriptor() protoreflect.EnumDescriptor
func (Entity_Type) Enum ¶
func (x Entity_Type) Enum() *Entity_Type
func (Entity_Type) EnumDescriptor
deprecated
func (Entity_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Entity_Type.Descriptor instead.
func (Entity_Type) Number ¶
func (x Entity_Type) Number() protoreflect.EnumNumber
func (Entity_Type) String ¶
func (x Entity_Type) String() string
func (Entity_Type) Type ¶
func (Entity_Type) Type() protoreflect.EnumType
type LanguageServiceClient ¶
type LanguageServiceClient interface { // Analyzes the sentiment of the provided text. AnalyzeSentiment(ctx context.Context, in *AnalyzeSentimentRequest, opts ...grpc.CallOption) (*AnalyzeSentimentResponse, error) // Finds named entities (currently proper names and common nouns) in the text // along with entity types, probability, mentions for each entity, and // other properties. AnalyzeEntities(ctx context.Context, in *AnalyzeEntitiesRequest, opts ...grpc.CallOption) (*AnalyzeEntitiesResponse, error) // Classifies a document into categories. ClassifyText(ctx context.Context, in *ClassifyTextRequest, opts ...grpc.CallOption) (*ClassifyTextResponse, error) // Moderates a document for harmful and sensitive categories. ModerateText(ctx context.Context, in *ModerateTextRequest, opts ...grpc.CallOption) (*ModerateTextResponse, error) // A convenience method that provides all features in one call. AnnotateText(ctx context.Context, in *AnnotateTextRequest, opts ...grpc.CallOption) (*AnnotateTextResponse, error) }
LanguageServiceClient is the client API for LanguageService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewLanguageServiceClient ¶
func NewLanguageServiceClient(cc grpc.ClientConnInterface) LanguageServiceClient
type LanguageServiceServer ¶
type LanguageServiceServer interface { // Analyzes the sentiment of the provided text. AnalyzeSentiment(context.Context, *AnalyzeSentimentRequest) (*AnalyzeSentimentResponse, error) // Finds named entities (currently proper names and common nouns) in the text // along with entity types, probability, mentions for each entity, and // other properties. AnalyzeEntities(context.Context, *AnalyzeEntitiesRequest) (*AnalyzeEntitiesResponse, error) // Classifies a document into categories. ClassifyText(context.Context, *ClassifyTextRequest) (*ClassifyTextResponse, error) // Moderates a document for harmful and sensitive categories. ModerateText(context.Context, *ModerateTextRequest) (*ModerateTextResponse, error) // A convenience method that provides all features in one call. AnnotateText(context.Context, *AnnotateTextRequest) (*AnnotateTextResponse, error) }
LanguageServiceServer is the server API for LanguageService service.
type ModerateTextRequest ¶
type ModerateTextRequest struct { // Required. Input document. Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` // Optional. The model version to use for ModerateText. ModelVersion ModerateTextRequest_ModelVersion `` /* 161-byte string literal not displayed */ // contains filtered or unexported fields }
The document moderation request message.
func (*ModerateTextRequest) Descriptor
deprecated
func (*ModerateTextRequest) Descriptor() ([]byte, []int)
Deprecated: Use ModerateTextRequest.ProtoReflect.Descriptor instead.
func (*ModerateTextRequest) GetDocument ¶
func (x *ModerateTextRequest) GetDocument() *Document
func (*ModerateTextRequest) GetModelVersion ¶ added in v1.13.0
func (x *ModerateTextRequest) GetModelVersion() ModerateTextRequest_ModelVersion
func (*ModerateTextRequest) ProtoMessage ¶
func (*ModerateTextRequest) ProtoMessage()
func (*ModerateTextRequest) ProtoReflect ¶
func (x *ModerateTextRequest) ProtoReflect() protoreflect.Message
func (*ModerateTextRequest) Reset ¶
func (x *ModerateTextRequest) Reset()
func (*ModerateTextRequest) String ¶
func (x *ModerateTextRequest) String() string
type ModerateTextRequest_ModelVersion ¶ added in v1.13.0
type ModerateTextRequest_ModelVersion int32
The model version to use for ModerateText.
const ( // The default model version. ModerateTextRequest_MODEL_VERSION_UNSPECIFIED ModerateTextRequest_ModelVersion = 0 // Use the v1 model, this model is used by default when not provided. // The v1 model only returns probability (confidence) score for each // category. ModerateTextRequest_MODEL_VERSION_1 ModerateTextRequest_ModelVersion = 1 // Use the v2 model. // The v2 model only returns probability (confidence) score for each // category, and returns severity score for a subset of the categories. ModerateTextRequest_MODEL_VERSION_2 ModerateTextRequest_ModelVersion = 2 )
func (ModerateTextRequest_ModelVersion) Descriptor ¶ added in v1.13.0
func (ModerateTextRequest_ModelVersion) Descriptor() protoreflect.EnumDescriptor
func (ModerateTextRequest_ModelVersion) Enum ¶ added in v1.13.0
func (x ModerateTextRequest_ModelVersion) Enum() *ModerateTextRequest_ModelVersion
func (ModerateTextRequest_ModelVersion) EnumDescriptor
deprecated
added in
v1.13.0
func (ModerateTextRequest_ModelVersion) EnumDescriptor() ([]byte, []int)
Deprecated: Use ModerateTextRequest_ModelVersion.Descriptor instead.
func (ModerateTextRequest_ModelVersion) Number ¶ added in v1.13.0
func (x ModerateTextRequest_ModelVersion) Number() protoreflect.EnumNumber
func (ModerateTextRequest_ModelVersion) String ¶ added in v1.13.0
func (x ModerateTextRequest_ModelVersion) String() string
func (ModerateTextRequest_ModelVersion) Type ¶ added in v1.13.0
func (ModerateTextRequest_ModelVersion) Type() protoreflect.EnumType
type ModerateTextResponse ¶
type ModerateTextResponse struct { // Harmful and sensitive categories representing the input document. ModerationCategories []*ClassificationCategory `protobuf:"bytes,1,rep,name=moderation_categories,json=moderationCategories,proto3" json:"moderation_categories,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"` // 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,3,opt,name=language_supported,json=languageSupported,proto3" json:"language_supported,omitempty"` // contains filtered or unexported fields }
The document moderation response message.
func (*ModerateTextResponse) Descriptor
deprecated
func (*ModerateTextResponse) Descriptor() ([]byte, []int)
Deprecated: Use ModerateTextResponse.ProtoReflect.Descriptor instead.
func (*ModerateTextResponse) GetLanguageCode ¶
func (x *ModerateTextResponse) GetLanguageCode() string
func (*ModerateTextResponse) GetLanguageSupported ¶
func (x *ModerateTextResponse) GetLanguageSupported() bool
func (*ModerateTextResponse) GetModerationCategories ¶
func (x *ModerateTextResponse) GetModerationCategories() []*ClassificationCategory
func (*ModerateTextResponse) ProtoMessage ¶
func (*ModerateTextResponse) ProtoMessage()
func (*ModerateTextResponse) ProtoReflect ¶
func (x *ModerateTextResponse) ProtoReflect() protoreflect.Message
func (*ModerateTextResponse) Reset ¶
func (x *ModerateTextResponse) Reset()
func (*ModerateTextResponse) String ¶
func (x *ModerateTextResponse) String() string
type Sentence ¶
type Sentence struct { // 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"` // contains filtered or unexported fields }
Represents a sentence in the input document.
func (*Sentence) Descriptor
deprecated
func (*Sentence) GetSentiment ¶
func (*Sentence) ProtoMessage ¶
func (*Sentence) ProtoMessage()
func (*Sentence) ProtoReflect ¶
func (x *Sentence) ProtoReflect() protoreflect.Message
type Sentiment ¶
type Sentiment struct { // 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"` // contains filtered or unexported fields }
Represents the feeling associated with the entire text or entities in the text.
func (*Sentiment) Descriptor
deprecated
func (*Sentiment) GetMagnitude ¶
func (*Sentiment) ProtoMessage ¶
func (*Sentiment) ProtoMessage()
func (*Sentiment) ProtoReflect ¶
func (x *Sentiment) ProtoReflect() protoreflect.Message
type TextSpan ¶
type TextSpan struct { // 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"` // contains filtered or unexported fields }
Represents a text span in the input document.
func (*TextSpan) Descriptor
deprecated
func (*TextSpan) GetBeginOffset ¶
func (*TextSpan) GetContent ¶
func (*TextSpan) ProtoMessage ¶
func (*TextSpan) ProtoMessage()
func (*TextSpan) ProtoReflect ¶
func (x *TextSpan) ProtoReflect() protoreflect.Message
type UnimplementedLanguageServiceServer ¶
type UnimplementedLanguageServiceServer struct { }
UnimplementedLanguageServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedLanguageServiceServer) AnalyzeEntities ¶
func (*UnimplementedLanguageServiceServer) AnalyzeEntities(context.Context, *AnalyzeEntitiesRequest) (*AnalyzeEntitiesResponse, error)
func (*UnimplementedLanguageServiceServer) AnalyzeSentiment ¶
func (*UnimplementedLanguageServiceServer) AnalyzeSentiment(context.Context, *AnalyzeSentimentRequest) (*AnalyzeSentimentResponse, error)
func (*UnimplementedLanguageServiceServer) AnnotateText ¶
func (*UnimplementedLanguageServiceServer) AnnotateText(context.Context, *AnnotateTextRequest) (*AnnotateTextResponse, error)
func (*UnimplementedLanguageServiceServer) ClassifyText ¶
func (*UnimplementedLanguageServiceServer) ClassifyText(context.Context, *ClassifyTextRequest) (*ClassifyTextResponse, error)
func (*UnimplementedLanguageServiceServer) ModerateText ¶
func (*UnimplementedLanguageServiceServer) ModerateText(context.Context, *ModerateTextRequest) (*ModerateTextResponse, error)