eas

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: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Eas_Processor_FM        = "ALINK_FM"
	Eas_Processor_PMML      = "PMML"
	Eas_Processor_TF        = "TensorFlow"
	Eas_Processor_TFServing = "TFServing"
	Eas_Processor_EASYREC   = "EasyRec"
	Eas_Processor_LINUCB    = "Linucb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EasModel

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

func NewEasModel

func NewEasModel(name string) *EasModel

func (*EasModel) Init

func (m *EasModel) Init(conf *recconf.AlgoConfig) error

func (*EasModel) Run

func (m *EasModel) Run(algoData interface{}) (interface{}, error)

type EasRequest

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

func (*EasRequest) GetResponseFunc

func (r *EasRequest) GetResponseFunc() response.ResponseFunc

func (*EasRequest) SetAuth

func (r *EasRequest) SetAuth(auth string)

func (*EasRequest) SetResponseFunc

func (r *EasRequest) SetResponseFunc(name string)

func (*EasRequest) SetServiceName

func (r *EasRequest) SetServiceName(name string)

func (*EasRequest) SetTimeout

func (r *EasRequest) SetTimeout(timeout int)

func (*EasRequest) SetUrl

func (r *EasRequest) SetUrl(url string)

type EasyrecRequest

type EasyrecRequest struct {
	EasRequest
	EasClient *eas.PredictClient
}

func (*EasyrecRequest) Invoke

func (r *EasyrecRequest) Invoke(requestData interface{}) (response interface{}, err error)

type EasyrecResponse

type EasyrecResponse struct {
	RawFeatures      string
	GenerateFeatures *bytes.Buffer
	ContextFeatures  string
	// contains filtered or unexported fields
}

func (*EasyrecResponse) GetModuleType

func (r *EasyrecResponse) GetModuleType() bool

func (*EasyrecResponse) GetScore

func (r *EasyrecResponse) GetScore() float64

func (*EasyrecResponse) GetScoreMap

func (r *EasyrecResponse) GetScoreMap() map[string]float64

type EasyrecUserEmbResponse

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

func (*EasyrecUserEmbResponse) GetModuleType

func (r *EasyrecUserEmbResponse) GetModuleType() bool

func (*EasyrecUserEmbResponse) GetScore

func (r *EasyrecUserEmbResponse) GetScore() float64

func (*EasyrecUserEmbResponse) GetScoreMap

func (r *EasyrecUserEmbResponse) GetScoreMap() map[string]float64

func (*EasyrecUserEmbResponse) GetUserEmb

func (r *EasyrecUserEmbResponse) GetUserEmb() string

type EasyrecUserRealtimeEmbeddingMindResponse

type EasyrecUserRealtimeEmbeddingMindResponse struct {
	DimSize          int
	DimLength        int
	UserEmbedding    string
	EmbeddingList    []*EmbeddingInfo
	GenerateFeatures *bytes.Buffer
}

func (*EasyrecUserRealtimeEmbeddingMindResponse) GetDimLength

func (*EasyrecUserRealtimeEmbeddingMindResponse) GetDimSize

func (*EasyrecUserRealtimeEmbeddingMindResponse) GetEmbeddingList

func (*EasyrecUserRealtimeEmbeddingMindResponse) GetModuleType

func (*EasyrecUserRealtimeEmbeddingMindResponse) GetScore

func (*EasyrecUserRealtimeEmbeddingMindResponse) GetScoreMap

func (*EasyrecUserRealtimeEmbeddingMindResponse) GetUserEmbedding

func (r *EasyrecUserRealtimeEmbeddingMindResponse) GetUserEmbedding() string

type EasyrecUserRealtimeEmbeddingResponse

type EasyrecUserRealtimeEmbeddingResponse struct {
	EmbeddingList    []*EmbeddingInfo
	UserEmbedding    string
	GenerateFeatures *bytes.Buffer
}

func (*EasyrecUserRealtimeEmbeddingResponse) GetEmbeddingList

func (r *EasyrecUserRealtimeEmbeddingResponse) GetEmbeddingList() []*EmbeddingInfo

func (*EasyrecUserRealtimeEmbeddingResponse) GetModuleType

func (r *EasyrecUserRealtimeEmbeddingResponse) GetModuleType() bool

func (*EasyrecUserRealtimeEmbeddingResponse) GetScore

func (*EasyrecUserRealtimeEmbeddingResponse) GetScoreMap

func (*EasyrecUserRealtimeEmbeddingResponse) GetUserEmbedding

func (r *EasyrecUserRealtimeEmbeddingResponse) GetUserEmbedding() string

type EmbeddingInfo

type EmbeddingInfo struct {
	ItemId string
	Score  float64
}

type FMRequest

type FMRequest struct {
	EasRequest
	// contains filtered or unexported fields
}

func NewFMRequest

func NewFMRequest() *FMRequest

func (*FMRequest) Invoke

func (r *FMRequest) Invoke(requestData interface{}) (body interface{}, err error)

type HttpEasyrecRequest

type HttpEasyrecRequest struct {
	EasRequest
}

func (*HttpEasyrecRequest) Invoke

func (r *HttpEasyrecRequest) Invoke(requestData interface{}) (response interface{}, err error)

type IEasRequest

type IEasRequest interface {
	Invoke(requestData interface{}) (body interface{}, err error)
	GetResponseFunc() response.ResponseFunc
}

type LincubRequest

type LincubRequest struct {
	EasRequest
}

func (*LincubRequest) Invoke

func (r *LincubRequest) Invoke(requestData interface{}) (body interface{}, err error)

type LincubRequestData

type LincubRequestData struct {
	RequestId    string                   `json:"request_id"`
	Scene        string                   `json:"scene"`
	AlgoName     string                   `json:"algo"`
	UserId       string                   `json:"user_id"`
	Items        []string                 `json:"items"`
	Limit        int                      `json:"limit"`
	UserFeature  map[string]interface{}   `json:"user_feature"`
	ItemFeatures []map[string]interface{} `json:"item_features"`
}

type LinucbResponse

type LinucbResponse struct {
	ErrorCode    int                   `json:"error_code"`
	ErrorMessage string                `json:"error_message"`
	Data         []*LinucbResponseItem `json:"data"`
}

type LinucbResponseItem

type LinucbResponseItem struct {
	ItemId string  `json:"id"`
	Score  float64 `json:"score"`
}

func LinucbResponseFunc

func LinucbResponseFunc(data interface{}) (ret []*LinucbResponseItem, err error)

func (*LinucbResponseItem) GetModuleType

func (r *LinucbResponseItem) GetModuleType() bool

func (*LinucbResponseItem) GetScore

func (r *LinucbResponseItem) GetScore() float64

func (*LinucbResponseItem) GetScoreMap

func (r *LinucbResponseItem) GetScoreMap() map[string]float64

type PMMLRequest

type PMMLRequest struct {
	EasRequest
}

func (*PMMLRequest) Invoke

func (r *PMMLRequest) Invoke(requestData interface{}) (body interface{}, err error)

type TFRequest

type TFRequest struct {
	EasRequest
	SignatureName string
	Outputs       []string
}

func (*TFRequest) Invoke

func (r *TFRequest) Invoke(requestData interface{}) (response interface{}, err error)

func (*TFRequest) SetOutputs

func (r *TFRequest) SetOutputs(outputs []string)

func (*TFRequest) SetSignatureName

func (r *TFRequest) SetSignatureName(name string)

type TFServingRequest

type TFServingRequest struct {
	EasRequest
	SignatureName string
	ModelName     string
	Outputs       []string
	Client        tensorflow_serving.PredictionServiceClient
}

func (*TFServingRequest) Invoke

func (r *TFServingRequest) Invoke(requestData interface{}) (response interface{}, err error)

func (*TFServingRequest) SetModelName

func (r *TFServingRequest) SetModelName(name string)

func (*TFServingRequest) SetOutputs

func (r *TFServingRequest) SetOutputs(outputs []string)

func (*TFServingRequest) SetSignatureName

func (r *TFServingRequest) SetSignatureName(name string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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