tokenclassificationv1

package
v0.0.0-...-53a6fda Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package tokenclassificationv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TokenClassificationService_Classify_FullMethodName = "/tokenclassification.v1.TokenClassificationService/Classify"
)

Variables

View Source
var (
	ClassifyRequest_AggregationStrategy_name = map[int32]string{
		0: "NONE",
		1: "SIMPLE",
	}
	ClassifyRequest_AggregationStrategy_value = map[string]int32{
		"NONE":   0,
		"SIMPLE": 1,
	}
)

Enum value maps for ClassifyRequest_AggregationStrategy.

View Source
var File_tokenclassification_v1_tokenclassification_proto protoreflect.FileDescriptor
View Source
var TokenClassificationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tokenclassification.v1.TokenClassificationService",
	HandlerType: (*TokenClassificationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Classify",
			Handler:    _TokenClassificationService_Classify_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tokenclassification/v1/tokenclassification.proto",
}

TokenClassificationService_ServiceDesc is the grpc.ServiceDesc for TokenClassificationService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTokenClassificationServiceHandler

func RegisterTokenClassificationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTokenClassificationServiceHandler registers the http handlers for service TokenClassificationService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTokenClassificationServiceHandlerClient

func RegisterTokenClassificationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TokenClassificationServiceClient) error

RegisterTokenClassificationServiceHandlerClient registers the http handlers for service TokenClassificationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TokenClassificationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TokenClassificationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TokenClassificationServiceClient" to call the correct interceptors.

func RegisterTokenClassificationServiceHandlerFromEndpoint

func RegisterTokenClassificationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTokenClassificationServiceHandlerFromEndpoint is same as RegisterTokenClassificationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTokenClassificationServiceHandlerServer

func RegisterTokenClassificationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TokenClassificationServiceServer) error

RegisterTokenClassificationServiceHandlerServer registers the http handlers for service TokenClassificationService to "mux". UnaryRPC :call TokenClassificationServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTokenClassificationServiceHandlerFromEndpoint instead.

func RegisterTokenClassificationServiceServer

func RegisterTokenClassificationServiceServer(s grpc.ServiceRegistrar, srv TokenClassificationServiceServer)

Types

type ClassifyRequest

type ClassifyRequest struct {
	Input               string                              `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	AggregationStrategy ClassifyRequest_AggregationStrategy `` /* 183-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ClassifyRequest) Descriptor deprecated

func (*ClassifyRequest) Descriptor() ([]byte, []int)

Deprecated: Use ClassifyRequest.ProtoReflect.Descriptor instead.

func (*ClassifyRequest) GetAggregationStrategy

func (x *ClassifyRequest) GetAggregationStrategy() ClassifyRequest_AggregationStrategy

func (*ClassifyRequest) GetInput

func (x *ClassifyRequest) GetInput() 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 ClassifyRequest_AggregationStrategy

type ClassifyRequest_AggregationStrategy int32
const (
	// Every token gets classified without further aggregation (default)
	ClassifyRequest_NONE ClassifyRequest_AggregationStrategy = 0
	// Entities are grouped according to the IOB annotation schema
	ClassifyRequest_SIMPLE ClassifyRequest_AggregationStrategy = 1
)

func (ClassifyRequest_AggregationStrategy) Descriptor

func (ClassifyRequest_AggregationStrategy) Enum

func (ClassifyRequest_AggregationStrategy) EnumDescriptor deprecated

func (ClassifyRequest_AggregationStrategy) EnumDescriptor() ([]byte, []int)

Deprecated: Use ClassifyRequest_AggregationStrategy.Descriptor instead.

func (ClassifyRequest_AggregationStrategy) Number

func (ClassifyRequest_AggregationStrategy) String

func (ClassifyRequest_AggregationStrategy) Type

type ClassifyResponse

type ClassifyResponse struct {
	Tokens []*Token `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"`
	// contains filtered or unexported fields
}

func (*ClassifyResponse) Descriptor deprecated

func (*ClassifyResponse) Descriptor() ([]byte, []int)

Deprecated: Use ClassifyResponse.ProtoReflect.Descriptor instead.

func (*ClassifyResponse) GetTokens

func (x *ClassifyResponse) GetTokens() []*Token

func (*ClassifyResponse) ProtoMessage

func (*ClassifyResponse) ProtoMessage()

func (*ClassifyResponse) ProtoReflect

func (x *ClassifyResponse) ProtoReflect() protoreflect.Message

func (*ClassifyResponse) Reset

func (x *ClassifyResponse) Reset()

func (*ClassifyResponse) String

func (x *ClassifyResponse) String() string

type Token

type Token struct {
	Text  string  `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Start int32   `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"`
	End   int32   `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
	Label string  `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	Score float64 `protobuf:"fixed64,5,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*Token) Descriptor deprecated

func (*Token) Descriptor() ([]byte, []int)

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetEnd

func (x *Token) GetEnd() int32

func (*Token) GetLabel

func (x *Token) GetLabel() string

func (*Token) GetScore

func (x *Token) GetScore() float64

func (*Token) GetStart

func (x *Token) GetStart() int32

func (*Token) GetText

func (x *Token) GetText() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

func (x *Token) ProtoReflect() protoreflect.Message

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type TokenClassificationServiceClient

type TokenClassificationServiceClient interface {
	Classify(ctx context.Context, in *ClassifyRequest, opts ...grpc.CallOption) (*ClassifyResponse, error)
}

TokenClassificationServiceClient is the client API for TokenClassificationService 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.

type TokenClassificationServiceServer

type TokenClassificationServiceServer interface {
	Classify(context.Context, *ClassifyRequest) (*ClassifyResponse, error)
	// contains filtered or unexported methods
}

TokenClassificationServiceServer is the server API for TokenClassificationService service. All implementations must embed UnimplementedTokenClassificationServiceServer for forward compatibility

type UnimplementedTokenClassificationServiceServer

type UnimplementedTokenClassificationServiceServer struct {
}

UnimplementedTokenClassificationServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTokenClassificationServiceServer) Classify

type UnsafeTokenClassificationServiceServer

type UnsafeTokenClassificationServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeTokenClassificationServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TokenClassificationServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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