Documentation
¶
Index ¶
- Variables
- func RegisterBARTServer(s grpc.ServiceRegistrar, srv BARTServer)
- type BARTClient
- type BARTServer
- type ClassConfidencePair
- func (*ClassConfidencePair) Descriptor() ([]byte, []int)deprecated
- func (x *ClassConfidencePair) GetClass() string
- func (x *ClassConfidencePair) GetConfidence() float64
- func (*ClassConfidencePair) ProtoMessage()
- func (x *ClassConfidencePair) ProtoReflect() protoreflect.Message
- func (x *ClassConfidencePair) Reset()
- func (x *ClassConfidencePair) String() string
- type ClassifyNLIRequest
- func (*ClassifyNLIRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ClassifyNLIRequest) GetHypothesisTemplate() string
- func (x *ClassifyNLIRequest) GetMultiClass() bool
- func (x *ClassifyNLIRequest) GetPossibleLabels() []string
- func (x *ClassifyNLIRequest) GetText() string
- func (*ClassifyNLIRequest) ProtoMessage()
- func (x *ClassifyNLIRequest) ProtoReflect() protoreflect.Message
- func (x *ClassifyNLIRequest) Reset()
- func (x *ClassifyNLIRequest) String() string
- type ClassifyReply
- func (*ClassifyReply) Descriptor() ([]byte, []int)deprecated
- func (x *ClassifyReply) GetClass() string
- func (x *ClassifyReply) GetConfidence() float64
- func (x *ClassifyReply) GetDistribution() []*ClassConfidencePair
- func (x *ClassifyReply) GetTook() int64
- func (*ClassifyReply) ProtoMessage()
- func (x *ClassifyReply) ProtoReflect() protoreflect.Message
- func (x *ClassifyReply) Reset()
- func (x *ClassifyReply) String() string
- type ClassifyRequest
- func (*ClassifyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ClassifyRequest) GetHasText2() bool
- func (x *ClassifyRequest) GetText() string
- func (x *ClassifyRequest) GetText2() string
- func (*ClassifyRequest) ProtoMessage()
- func (x *ClassifyRequest) ProtoReflect() protoreflect.Message
- func (x *ClassifyRequest) Reset()
- func (x *ClassifyRequest) String() string
- type UnimplementedBARTServer
- type UnsafeBARTServer
Constants ¶
This section is empty.
Variables ¶
var File_bart_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBARTServer ¶
func RegisterBARTServer(s grpc.ServiceRegistrar, srv BARTServer)
Types ¶
type BARTClient ¶
type BARTClient interface { // Sends a request to classify. Classify(ctx context.Context, in *ClassifyRequest, opts ...grpc.CallOption) (*ClassifyReply, error) // Sends a request to classify-nli. ClassifyNLI(ctx context.Context, in *ClassifyNLIRequest, opts ...grpc.CallOption) (*ClassifyReply, error) }
BARTClient is the client API for BART service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewBARTClient ¶
func NewBARTClient(cc grpc.ClientConnInterface) BARTClient
type BARTServer ¶
type BARTServer interface { // Sends a request to classify. Classify(context.Context, *ClassifyRequest) (*ClassifyReply, error) // Sends a request to classify-nli. ClassifyNLI(context.Context, *ClassifyNLIRequest) (*ClassifyReply, error) // contains filtered or unexported methods }
BARTServer is the server API for BART service. All implementations must embed UnimplementedBARTServer for forward compatibility
type ClassConfidencePair ¶
type ClassConfidencePair struct { Class string `protobuf:"bytes,1,opt,name=class,proto3" json:"class,omitempty"` Confidence float64 `protobuf:"fixed64,2,opt,name=confidence,proto3" json:"confidence,omitempty"` // contains filtered or unexported fields }
The pair of class and confidence.
func (*ClassConfidencePair) Descriptor
deprecated
func (*ClassConfidencePair) Descriptor() ([]byte, []int)
Deprecated: Use ClassConfidencePair.ProtoReflect.Descriptor instead.
func (*ClassConfidencePair) GetClass ¶
func (x *ClassConfidencePair) GetClass() string
func (*ClassConfidencePair) GetConfidence ¶
func (x *ClassConfidencePair) GetConfidence() float64
func (*ClassConfidencePair) ProtoMessage ¶
func (*ClassConfidencePair) ProtoMessage()
func (*ClassConfidencePair) ProtoReflect ¶
func (x *ClassConfidencePair) ProtoReflect() protoreflect.Message
func (*ClassConfidencePair) Reset ¶
func (x *ClassConfidencePair) Reset()
func (*ClassConfidencePair) String ¶
func (x *ClassConfidencePair) String() string
type ClassifyNLIRequest ¶
type ClassifyNLIRequest struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` HypothesisTemplate string `protobuf:"bytes,2,opt,name=hypothesis_template,json=hypothesisTemplate,proto3" json:"hypothesis_template,omitempty"` PossibleLabels []string `protobuf:"bytes,3,rep,name=possible_labels,json=possibleLabels,proto3" json:"possible_labels,omitempty"` MultiClass bool `protobuf:"varint,4,opt,name=multi_class,json=multiClass,proto3" json:"multi_class,omitempty"` // contains filtered or unexported fields }
The classify-nli request message containing the text to classify using natural language inference
func (*ClassifyNLIRequest) Descriptor
deprecated
func (*ClassifyNLIRequest) Descriptor() ([]byte, []int)
Deprecated: Use ClassifyNLIRequest.ProtoReflect.Descriptor instead.
func (*ClassifyNLIRequest) GetHypothesisTemplate ¶
func (x *ClassifyNLIRequest) GetHypothesisTemplate() string
func (*ClassifyNLIRequest) GetMultiClass ¶
func (x *ClassifyNLIRequest) GetMultiClass() bool
func (*ClassifyNLIRequest) GetPossibleLabels ¶
func (x *ClassifyNLIRequest) GetPossibleLabels() []string
func (*ClassifyNLIRequest) GetText ¶
func (x *ClassifyNLIRequest) GetText() string
func (*ClassifyNLIRequest) ProtoMessage ¶
func (*ClassifyNLIRequest) ProtoMessage()
func (*ClassifyNLIRequest) ProtoReflect ¶
func (x *ClassifyNLIRequest) ProtoReflect() protoreflect.Message
func (*ClassifyNLIRequest) Reset ¶
func (x *ClassifyNLIRequest) Reset()
func (*ClassifyNLIRequest) String ¶
func (x *ClassifyNLIRequest) String() string
type ClassifyReply ¶
type ClassifyReply struct { Class string `protobuf:"bytes,1,opt,name=class,proto3" json:"class,omitempty"` Confidence float64 `protobuf:"fixed64,2,opt,name=confidence,proto3" json:"confidence,omitempty"` Distribution []*ClassConfidencePair `protobuf:"bytes,3,rep,name=distribution,proto3" json:"distribution,omitempty"` // Took is the number of milliseconds it took the server to execute the request. Took int64 `protobuf:"varint,4,opt,name=took,proto3" json:"took,omitempty"` // contains filtered or unexported fields }
The response message containing the classification.
func (*ClassifyReply) Descriptor
deprecated
func (*ClassifyReply) Descriptor() ([]byte, []int)
Deprecated: Use ClassifyReply.ProtoReflect.Descriptor instead.
func (*ClassifyReply) GetClass ¶
func (x *ClassifyReply) GetClass() string
func (*ClassifyReply) GetConfidence ¶
func (x *ClassifyReply) GetConfidence() float64
func (*ClassifyReply) GetDistribution ¶
func (x *ClassifyReply) GetDistribution() []*ClassConfidencePair
func (*ClassifyReply) GetTook ¶
func (x *ClassifyReply) GetTook() int64
func (*ClassifyReply) ProtoMessage ¶
func (*ClassifyReply) ProtoMessage()
func (*ClassifyReply) ProtoReflect ¶
func (x *ClassifyReply) ProtoReflect() protoreflect.Message
func (*ClassifyReply) Reset ¶
func (x *ClassifyReply) Reset()
func (*ClassifyReply) String ¶
func (x *ClassifyReply) String() string
type ClassifyRequest ¶
type ClassifyRequest struct { HasText2 bool `protobuf:"varint,1,opt,name=has_text2,json=hasText2,proto3" json:"has_text2,omitempty"` // always set this to "true" when using text2 Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` Text2 string `protobuf:"bytes,3,opt,name=text2,proto3" json:"text2,omitempty"` // contains filtered or unexported fields }
The classify request message containing the text to classify
func (*ClassifyRequest) Descriptor
deprecated
func (*ClassifyRequest) Descriptor() ([]byte, []int)
Deprecated: Use ClassifyRequest.ProtoReflect.Descriptor instead.
func (*ClassifyRequest) GetHasText2 ¶
func (x *ClassifyRequest) GetHasText2() bool
func (*ClassifyRequest) GetText ¶
func (x *ClassifyRequest) GetText() string
func (*ClassifyRequest) GetText2 ¶
func (x *ClassifyRequest) GetText2() string
func (*ClassifyRequest) ProtoMessage ¶
func (*ClassifyRequest) ProtoMessage()
func (*ClassifyRequest) ProtoReflect ¶
func (x *ClassifyRequest) ProtoReflect() protoreflect.Message
func (*ClassifyRequest) Reset ¶
func (x *ClassifyRequest) Reset()
func (*ClassifyRequest) String ¶
func (x *ClassifyRequest) String() string
type UnimplementedBARTServer ¶
type UnimplementedBARTServer struct { }
UnimplementedBARTServer must be embedded to have forward compatible implementations.
func (UnimplementedBARTServer) Classify ¶
func (UnimplementedBARTServer) Classify(context.Context, *ClassifyRequest) (*ClassifyReply, error)
func (UnimplementedBARTServer) ClassifyNLI ¶
func (UnimplementedBARTServer) ClassifyNLI(context.Context, *ClassifyNLIRequest) (*ClassifyReply, error)
type UnsafeBARTServer ¶
type UnsafeBARTServer interface {
// contains filtered or unexported methods
}
UnsafeBARTServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BARTServer will result in compilation errors.