easyrec

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MULTI_SPLIT      = "|"
	HA3_MULTI_SPLIT  = "\u001D"
	FEA_LIST_MIN_LEN = 2
)

Variables

View Source
var (
	ArrayDataType_name = map[int32]string{
		0:  "DT_INVALID",
		1:  "DT_FLOAT",
		2:  "DT_DOUBLE",
		3:  "DT_INT32",
		4:  "DT_UINT8",
		5:  "DT_INT16",
		6:  "DT_INT8",
		7:  "DT_STRING",
		8:  "DT_COMPLEX64",
		9:  "DT_INT64",
		10: "DT_BOOL",
		11: "DT_QINT8",
		12: "DT_QUINT8",
		13: "DT_QINT32",
		14: "DT_BFLOAT16",
		15: "DT_QINT16",
		16: "DT_QUINT16",
		17: "DT_UINT16",
		18: "DT_COMPLEX128",
		19: "DT_HALF",
		20: "DT_RESOURCE",
		21: "DT_VARIANT",
	}
	ArrayDataType_value = map[string]int32{
		"DT_INVALID":    0,
		"DT_FLOAT":      1,
		"DT_DOUBLE":     2,
		"DT_INT32":      3,
		"DT_UINT8":      4,
		"DT_INT16":      5,
		"DT_INT8":       6,
		"DT_STRING":     7,
		"DT_COMPLEX64":  8,
		"DT_INT64":      9,
		"DT_BOOL":       10,
		"DT_QINT8":      11,
		"DT_QUINT8":     12,
		"DT_QINT32":     13,
		"DT_BFLOAT16":   14,
		"DT_QINT16":     15,
		"DT_QUINT16":    16,
		"DT_UINT16":     17,
		"DT_COMPLEX128": 18,
		"DT_HALF":       19,
		"DT_RESOURCE":   20,
		"DT_VARIANT":    21,
	}
)

Enum value maps for ArrayDataType.

View Source
var (
	StatusCode_name = map[int32]string{
		0: "OK",
		1: "INPUT_EMPTY",
		2: "EXCEPTION",
	}
	StatusCode_value = map[string]int32{
		"OK":          0,
		"INPUT_EMPTY": 1,
		"EXCEPTION":   2,
	}
)

Enum value maps for StatusCode.

View Source
var File_easyrec_predict_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ArrayDataType

type ArrayDataType int32
const (
	// Not a legal value for DataType. Used to indicate a DataType field
	// has not been set.
	ArrayDataType_DT_INVALID ArrayDataType = 0
	// Data types that all computation devices are expected to be
	// capable to support.
	ArrayDataType_DT_FLOAT      ArrayDataType = 1
	ArrayDataType_DT_DOUBLE     ArrayDataType = 2
	ArrayDataType_DT_INT32      ArrayDataType = 3
	ArrayDataType_DT_UINT8      ArrayDataType = 4
	ArrayDataType_DT_INT16      ArrayDataType = 5
	ArrayDataType_DT_INT8       ArrayDataType = 6
	ArrayDataType_DT_STRING     ArrayDataType = 7
	ArrayDataType_DT_COMPLEX64  ArrayDataType = 8 // Single-precision complex
	ArrayDataType_DT_INT64      ArrayDataType = 9
	ArrayDataType_DT_BOOL       ArrayDataType = 10
	ArrayDataType_DT_QINT8      ArrayDataType = 11 // Quantized int8
	ArrayDataType_DT_QUINT8     ArrayDataType = 12 // Quantized uint8
	ArrayDataType_DT_QINT32     ArrayDataType = 13 // Quantized int32
	ArrayDataType_DT_BFLOAT16   ArrayDataType = 14 // Float32 truncated to 16 bits.  Only for cast ops.
	ArrayDataType_DT_QINT16     ArrayDataType = 15 // Quantized int16
	ArrayDataType_DT_QUINT16    ArrayDataType = 16 // Quantized uint16
	ArrayDataType_DT_UINT16     ArrayDataType = 17
	ArrayDataType_DT_COMPLEX128 ArrayDataType = 18 // Double-precision complex
	ArrayDataType_DT_HALF       ArrayDataType = 19
	ArrayDataType_DT_RESOURCE   ArrayDataType = 20
	ArrayDataType_DT_VARIANT    ArrayDataType = 21 // Arbitrary C++ data types
)

func (ArrayDataType) Descriptor

func (ArrayDataType) Enum

func (x ArrayDataType) Enum() *ArrayDataType

func (ArrayDataType) EnumDescriptor deprecated

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

Deprecated: Use ArrayDataType.Descriptor instead.

func (ArrayDataType) Number

func (ArrayDataType) String

func (x ArrayDataType) String() string

func (ArrayDataType) Type

type ArrayProto

type ArrayProto struct {

	// Data Type.
	Dtype ArrayDataType `protobuf:"varint,1,opt,name=dtype,proto3,enum=easyrec.ArrayDataType" json:"dtype,omitempty"`
	// Shape of the array.
	ArrayShape *ArrayShape `protobuf:"bytes,2,opt,name=array_shape,json=arrayShape,proto3" json:"array_shape,omitempty"`
	// DT_FLOAT.
	FloatVal []float32 `protobuf:"fixed32,3,rep,packed,name=float_val,json=floatVal,proto3" json:"float_val,omitempty"`
	// DT_DOUBLE.
	DoubleVal []float64 `protobuf:"fixed64,4,rep,packed,name=double_val,json=doubleVal,proto3" json:"double_val,omitempty"`
	// DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
	IntVal []int32 `protobuf:"varint,5,rep,packed,name=int_val,json=intVal,proto3" json:"int_val,omitempty"`
	// DT_STRING.
	StringVal [][]byte `protobuf:"bytes,6,rep,name=string_val,json=stringVal,proto3" json:"string_val,omitempty"`
	// DT_INT64.
	Int64Val []int64 `protobuf:"varint,7,rep,packed,name=int64_val,json=int64Val,proto3" json:"int64_val,omitempty"`
	// DT_BOOL.
	BoolVal []bool `protobuf:"varint,8,rep,packed,name=bool_val,json=boolVal,proto3" json:"bool_val,omitempty"`
	// contains filtered or unexported fields
}

Protocol buffer representing an array

func (*ArrayProto) Descriptor deprecated

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

Deprecated: Use ArrayProto.ProtoReflect.Descriptor instead.

func (*ArrayProto) GetArrayShape

func (x *ArrayProto) GetArrayShape() *ArrayShape

func (*ArrayProto) GetBoolVal

func (x *ArrayProto) GetBoolVal() []bool

func (*ArrayProto) GetDoubleVal

func (x *ArrayProto) GetDoubleVal() []float64

func (*ArrayProto) GetDtype

func (x *ArrayProto) GetDtype() ArrayDataType

func (*ArrayProto) GetFloatVal

func (x *ArrayProto) GetFloatVal() []float32

func (*ArrayProto) GetInt64Val

func (x *ArrayProto) GetInt64Val() []int64

func (*ArrayProto) GetIntVal

func (x *ArrayProto) GetIntVal() []int32

func (*ArrayProto) GetStringVal

func (x *ArrayProto) GetStringVal() [][]byte

func (*ArrayProto) ProtoMessage

func (*ArrayProto) ProtoMessage()

func (*ArrayProto) ProtoReflect

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

func (*ArrayProto) Reset

func (x *ArrayProto) Reset()

func (*ArrayProto) String

func (x *ArrayProto) String() string

type ArrayShape

type ArrayShape struct {
	Dim []int64 `protobuf:"varint,1,rep,packed,name=dim,proto3" json:"dim,omitempty"`
	// contains filtered or unexported fields
}

Dimensions of an array

func (*ArrayShape) Descriptor deprecated

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

Deprecated: Use ArrayShape.ProtoReflect.Descriptor instead.

func (*ArrayShape) GetDim

func (x *ArrayShape) GetDim() []int64

func (*ArrayShape) ProtoMessage

func (*ArrayShape) ProtoMessage()

func (*ArrayShape) ProtoReflect

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

func (*ArrayShape) Reset

func (x *ArrayShape) Reset()

func (*ArrayShape) String

func (x *ArrayShape) String() string

type ContextFeatures

type ContextFeatures struct {
	Features []*PBFeature `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"`
	// contains filtered or unexported fields
}

context features

func (*ContextFeatures) Descriptor deprecated

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

Deprecated: Use ContextFeatures.ProtoReflect.Descriptor instead.

func (*ContextFeatures) GetFeatures

func (x *ContextFeatures) GetFeatures() []*PBFeature

func (*ContextFeatures) ProtoMessage

func (*ContextFeatures) ProtoMessage()

func (*ContextFeatures) ProtoReflect

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

func (*ContextFeatures) Reset

func (x *ContextFeatures) Reset()

func (*ContextFeatures) String

func (x *ContextFeatures) String() string

type EasyrecRequestBuilder

type EasyrecRequestBuilder struct {
	// contains filtered or unexported fields
}

func NewEasyrecRequestBuilder

func NewEasyrecRequestBuilder() *EasyrecRequestBuilder

func NewEasyrecRequestBuilderDebug

func NewEasyrecRequestBuilderDebug() *EasyrecRequestBuilder

func NewEasyrecRequestBuilderDebugWithLevel

func NewEasyrecRequestBuilderDebugWithLevel(level int) *EasyrecRequestBuilder

func (*EasyrecRequestBuilder) AddContextFeature

func (b *EasyrecRequestBuilder) AddContextFeature(key string, features []interface{})

func (*EasyrecRequestBuilder) AddItemId

func (b *EasyrecRequestBuilder) AddItemId(itemId string)

func (*EasyrecRequestBuilder) AddItemIds

func (b *EasyrecRequestBuilder) AddItemIds(itemIdsStr string)

func (*EasyrecRequestBuilder) AddUserFeature

func (b *EasyrecRequestBuilder) AddUserFeature(k string, v interface{})

func (*EasyrecRequestBuilder) AddUserFeatureStr

func (b *EasyrecRequestBuilder) AddUserFeatureStr(featureStr string)

func (*EasyrecRequestBuilder) EasyrecRequest

func (b *EasyrecRequestBuilder) EasyrecRequest() *PBRequest

type PBFeature

type PBFeature struct {

	// Types that are assignable to Value:
	//
	//	*PBFeature_IntFeature
	//	*PBFeature_LongFeature
	//	*PBFeature_StringFeature
	//	*PBFeature_FloatFeature
	Value isPBFeature_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

func (*PBFeature) Descriptor deprecated

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

Deprecated: Use PBFeature.ProtoReflect.Descriptor instead.

func (*PBFeature) GetFloatFeature

func (x *PBFeature) GetFloatFeature() float32

func (*PBFeature) GetIntFeature

func (x *PBFeature) GetIntFeature() int32

func (*PBFeature) GetLongFeature

func (x *PBFeature) GetLongFeature() int64

func (*PBFeature) GetStringFeature

func (x *PBFeature) GetStringFeature() string

func (*PBFeature) GetValue

func (m *PBFeature) GetValue() isPBFeature_Value

func (*PBFeature) ProtoMessage

func (*PBFeature) ProtoMessage()

func (*PBFeature) ProtoReflect

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

func (*PBFeature) Reset

func (x *PBFeature) Reset()

func (*PBFeature) String

func (x *PBFeature) String() string

type PBFeature_FloatFeature

type PBFeature_FloatFeature struct {
	FloatFeature float32 `protobuf:"fixed32,4,opt,name=float_feature,json=floatFeature,proto3,oneof"`
}

type PBFeature_IntFeature

type PBFeature_IntFeature struct {
	IntFeature int32 `protobuf:"varint,1,opt,name=int_feature,json=intFeature,proto3,oneof"`
}

type PBFeature_LongFeature

type PBFeature_LongFeature struct {
	LongFeature int64 `protobuf:"varint,2,opt,name=long_feature,json=longFeature,proto3,oneof"`
}

type PBFeature_StringFeature

type PBFeature_StringFeature struct {
	StringFeature string `protobuf:"bytes,3,opt,name=string_feature,json=stringFeature,proto3,oneof"`
}

type PBRequest

type PBRequest struct {

	// debug mode
	DebugLevel int32 `protobuf:"varint,1,opt,name=debug_level,json=debugLevel,proto3" json:"debug_level,omitempty"`
	// user features
	UserFeatures map[string]*PBFeature `` /* 185-byte string literal not displayed */
	// item ids
	ItemIds []string `protobuf:"bytes,3,rep,name=item_ids,json=itemIds,proto3" json:"item_ids,omitempty"`
	// context features for each item
	ContextFeatures map[string]*ContextFeatures `` /* 194-byte string literal not displayed */
	// user realtime embedding return num
	FaissNeighNum int32 `protobuf:"varint,5,opt,name=faiss_neigh_num,json=faissNeighNum,proto3" json:"faiss_neigh_num,omitempty"`
	// contains filtered or unexported fields
}

PBRequest specifies the request for aggregator

func (*PBRequest) Descriptor deprecated

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

Deprecated: Use PBRequest.ProtoReflect.Descriptor instead.

func (*PBRequest) GetContextFeatures

func (x *PBRequest) GetContextFeatures() map[string]*ContextFeatures

func (*PBRequest) GetDebugLevel

func (x *PBRequest) GetDebugLevel() int32

func (*PBRequest) GetFaissNeighNum

func (x *PBRequest) GetFaissNeighNum() int32

func (*PBRequest) GetItemIds

func (x *PBRequest) GetItemIds() []string

func (*PBRequest) GetUserFeatures

func (x *PBRequest) GetUserFeatures() map[string]*PBFeature

func (*PBRequest) ProtoMessage

func (*PBRequest) ProtoMessage()

func (*PBRequest) ProtoReflect

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

func (*PBRequest) Reset

func (x *PBRequest) Reset()

func (*PBRequest) String

func (x *PBRequest) String() string

type PBResponse

type PBResponse struct {

	// results
	Results map[string]*Results `` /* 155-byte string literal not displayed */
	// item features
	ItemFeatures map[string]string `` /* 185-byte string literal not displayed */
	// generate features
	GenerateFeatures map[string]string `` /* 197-byte string literal not displayed */
	// context features
	ContextFeatures map[string]*ContextFeatures `` /* 194-byte string literal not displayed */
	ErrorMsg        string                      `protobuf:"bytes,5,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
	StatusCode      StatusCode                  `protobuf:"varint,6,opt,name=status_code,json=statusCode,proto3,enum=easyrec.StatusCode" json:"status_code,omitempty"`
	// item ids
	ItemIds []string `protobuf:"bytes,7,rep,name=item_ids,json=itemIds,proto3" json:"item_ids,omitempty"`
	Outputs []string `protobuf:"bytes,8,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// all fg input features
	RawFeatures map[string]string      `` /* 182-byte string literal not displayed */
	TfOutputs   map[string]*ArrayProto `` /* 177-byte string literal not displayed */
	// contains filtered or unexported fields
}

PBResponse specifies the response for aggregator

func (*PBResponse) Descriptor deprecated

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

Deprecated: Use PBResponse.ProtoReflect.Descriptor instead.

func (*PBResponse) GetContextFeatures

func (x *PBResponse) GetContextFeatures() map[string]*ContextFeatures

func (*PBResponse) GetErrorMsg

func (x *PBResponse) GetErrorMsg() string

func (*PBResponse) GetGenerateFeatures

func (x *PBResponse) GetGenerateFeatures() map[string]string

func (*PBResponse) GetItemFeatures

func (x *PBResponse) GetItemFeatures() map[string]string

func (*PBResponse) GetItemIds

func (x *PBResponse) GetItemIds() []string

func (*PBResponse) GetOutputs

func (x *PBResponse) GetOutputs() []string

func (*PBResponse) GetRawFeatures

func (x *PBResponse) GetRawFeatures() map[string]string

func (*PBResponse) GetResults

func (x *PBResponse) GetResults() map[string]*Results

func (*PBResponse) GetStatusCode

func (x *PBResponse) GetStatusCode() StatusCode

func (*PBResponse) GetTfOutputs

func (x *PBResponse) GetTfOutputs() map[string]*ArrayProto

func (*PBResponse) ProtoMessage

func (*PBResponse) ProtoMessage()

func (*PBResponse) ProtoReflect

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

func (*PBResponse) Reset

func (x *PBResponse) Reset()

func (*PBResponse) String

func (x *PBResponse) String() string

type Results

type Results struct {
	Scores []float64 `protobuf:"fixed64,1,rep,packed,name=scores,proto3" json:"scores,omitempty"`
	// contains filtered or unexported fields
}

return results

func (*Results) Descriptor deprecated

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

Deprecated: Use Results.ProtoReflect.Descriptor instead.

func (*Results) GetScores

func (x *Results) GetScores() []float64

func (*Results) ProtoMessage

func (*Results) ProtoMessage()

func (*Results) ProtoReflect

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

func (*Results) Reset

func (x *Results) Reset()

func (*Results) String

func (x *Results) String() string

type StatusCode

type StatusCode int32
const (
	StatusCode_OK          StatusCode = 0
	StatusCode_INPUT_EMPTY StatusCode = 1
	StatusCode_EXCEPTION   StatusCode = 2
)

func (StatusCode) Descriptor

func (StatusCode) Descriptor() protoreflect.EnumDescriptor

func (StatusCode) Enum

func (x StatusCode) Enum() *StatusCode

func (StatusCode) EnumDescriptor deprecated

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

Deprecated: Use StatusCode.Descriptor instead.

func (StatusCode) Number

func (x StatusCode) Number() protoreflect.EnumNumber

func (StatusCode) String

func (x StatusCode) String() string

func (StatusCode) Type

type TorchRecPBResponse added in v2.1.6

type TorchRecPBResponse struct {

	// torch output tensors
	MapOutputs map[string]*ArrayProto `` /* 179-byte string literal not displayed */
	// fg ouput features
	GenerateFeatures map[string]string `` /* 197-byte string literal not displayed */
	// all fg input features
	RawFeatures map[string]string `` /* 182-byte string literal not displayed */
	// item ids
	ItemIds []string `protobuf:"bytes,4,rep,name=item_ids,json=itemIds,proto3" json:"item_ids,omitempty"`
	// contains filtered or unexported fields
}

TorchRecPBResponse specifies the response for aggregator

func (*TorchRecPBResponse) Descriptor deprecated added in v2.1.6

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

Deprecated: Use TorchRecPBResponse.ProtoReflect.Descriptor instead.

func (*TorchRecPBResponse) GetGenerateFeatures added in v2.1.6

func (x *TorchRecPBResponse) GetGenerateFeatures() map[string]string

func (*TorchRecPBResponse) GetItemIds added in v2.1.6

func (x *TorchRecPBResponse) GetItemIds() []string

func (*TorchRecPBResponse) GetMapOutputs added in v2.1.6

func (x *TorchRecPBResponse) GetMapOutputs() map[string]*ArrayProto

func (*TorchRecPBResponse) GetRawFeatures added in v2.1.6

func (x *TorchRecPBResponse) GetRawFeatures() map[string]string

func (*TorchRecPBResponse) ProtoMessage added in v2.1.6

func (*TorchRecPBResponse) ProtoMessage()

func (*TorchRecPBResponse) ProtoReflect added in v2.1.6

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

func (*TorchRecPBResponse) Reset added in v2.1.6

func (x *TorchRecPBResponse) Reset()

func (*TorchRecPBResponse) String added in v2.1.6

func (x *TorchRecPBResponse) String() string

Jump to

Keyboard shortcuts

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