Documentation ¶
Index ¶
- Variables
- func NewSentimentEndpoints() []*api.Endpoint
- func RegisterSentimentHandler(s server.Server, hdlr SentimentHandler, opts ...server.HandlerOption) error
- type AnalyzeRequest
- func (*AnalyzeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AnalyzeRequest) GetLang() string
- func (x *AnalyzeRequest) GetText() string
- func (*AnalyzeRequest) ProtoMessage()
- func (x *AnalyzeRequest) ProtoReflect() protoreflect.Message
- func (x *AnalyzeRequest) Reset()
- func (x *AnalyzeRequest) String() string
- type AnalyzeResponse
- type SentimentHandler
- type SentimentService
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_sentiment_proto protoreflect.FileDescriptor
Functions ¶
func NewSentimentEndpoints ¶
func RegisterSentimentHandler ¶
func RegisterSentimentHandler(s server.Server, hdlr SentimentHandler, opts ...server.HandlerOption) error
Types ¶
type AnalyzeRequest ¶
type AnalyzeRequest struct { // The text to analyze Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // The language. Defaults to english. Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"` // contains filtered or unexported fields }
Analyze and score a piece of text
func (*AnalyzeRequest) Descriptor
deprecated
func (*AnalyzeRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnalyzeRequest.ProtoReflect.Descriptor instead.
func (*AnalyzeRequest) GetLang ¶
func (x *AnalyzeRequest) GetLang() string
func (*AnalyzeRequest) GetText ¶
func (x *AnalyzeRequest) GetText() string
func (*AnalyzeRequest) ProtoMessage ¶
func (*AnalyzeRequest) ProtoMessage()
func (*AnalyzeRequest) ProtoReflect ¶
func (x *AnalyzeRequest) ProtoReflect() protoreflect.Message
func (*AnalyzeRequest) Reset ¶
func (x *AnalyzeRequest) Reset()
func (*AnalyzeRequest) String ¶
func (x *AnalyzeRequest) String() string
type AnalyzeResponse ¶
type AnalyzeResponse struct { // The score of the text {positive is 1, negative is 0} Score float64 `protobuf:"fixed64,1,opt,name=score,proto3" json:"score,omitempty"` // contains filtered or unexported fields }
func (*AnalyzeResponse) Descriptor
deprecated
func (*AnalyzeResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnalyzeResponse.ProtoReflect.Descriptor instead.
func (*AnalyzeResponse) GetScore ¶
func (x *AnalyzeResponse) GetScore() float64
func (*AnalyzeResponse) ProtoMessage ¶
func (*AnalyzeResponse) ProtoMessage()
func (*AnalyzeResponse) ProtoReflect ¶
func (x *AnalyzeResponse) ProtoReflect() protoreflect.Message
func (*AnalyzeResponse) Reset ¶
func (x *AnalyzeResponse) Reset()
func (*AnalyzeResponse) String ¶
func (x *AnalyzeResponse) String() string
type SentimentHandler ¶
type SentimentHandler interface {
Analyze(context.Context, *AnalyzeRequest, *AnalyzeResponse) error
}
type SentimentService ¶
type SentimentService interface {
Analyze(ctx context.Context, in *AnalyzeRequest, opts ...client.CallOption) (*AnalyzeResponse, error)
}
func NewSentimentService ¶
func NewSentimentService(name string, c client.Client) SentimentService
Click to show internal directories.
Click to hide internal directories.