sentiment

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_sentiment_proto protoreflect.FileDescriptor

Functions

func NewSentimentEndpoints

func NewSentimentEndpoints() []*api.Endpoint

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL