recall

package
v2.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(config *recconf.RecommendConfig)

func RegisterRecall

func RegisterRecall(name string, recall Recall)

Types

type BaseRecall

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

func NewBaseRecall

func NewBaseRecall(config recconf.RecallConfig) *BaseRecall

type BeBaseRecall

type BeBaseRecall interface {
	GetItems(user *module.User, context *context.RecommendContext) ([]*module.Item, error)
	//BuildRecallParam(user *module.User, context *context.RecommendContext) *be.RecallParam
	BuildQueryParams(user *module.User, context *context.RecommendContext) (ret map[string]string)
	CloneWithConfig(params map[string]interface{}) BeBaseRecall
}

type BeMultiBizRecall

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

func NewBeMultiBizRecall

func NewBeMultiBizRecall(client *beengine.BeClient, conf recconf.BeConfig, modelName string) *BeMultiBizRecall

func (*BeMultiBizRecall) BuildQueryParams

func (r *BeMultiBizRecall) BuildQueryParams(user *module.User, context *context.RecommendContext) (ret map[string]string)

func (*BeMultiBizRecall) CloneWithConfig

func (r *BeMultiBizRecall) CloneWithConfig(params map[string]interface{}) BeBaseRecall

func (*BeMultiBizRecall) GetItems

func (r *BeMultiBizRecall) GetItems(user *module.User, context *context.RecommendContext) (ret []*module.Item, err error)

type BeRecall

type BeRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewBeRecall

func NewBeRecall(config recconf.RecallConfig) *BeRecall

func (*BeRecall) GetCandidateItems

func (r *BeRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type BeVectorRecall

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

func NewBeVectorRecall

func NewBeVectorRecall(client *beengine.BeClient, conf recconf.BeConfig) *BeVectorRecall

func (*BeVectorRecall) BuildQueryParams

func (r *BeVectorRecall) BuildQueryParams(user *module.User, context *context.RecommendContext) (ret map[string]string)
func (r *BeVectorRecall) BuildRecallParam(user *module.User, context *context.RecommendContext) *be.RecallParam {
	triggerResult := r.triggerKey.GetTriggerKey(user, context)
	if triggerResult.TriggerItem == "" {
		return nil
	}
	vectorRecallParams := be.NewRecallParam().
		SetTriggerItems([]string{triggerResult.TriggerItem}).
		SetRecallType(be.RecallTypeVector)
	vectorRecallParams.ReturnCount = r.returnCount

	if r.scorerClause != "" {
		vectorRecallParams.SetScorerClause(be.NewScorerClause(r.scorerClause))
	}

	if r.recallName != "" {
		vectorRecallParams.SetRecallName(r.recallName)
	}

	return vectorRecallParams
}

func (*BeVectorRecall) CloneWithConfig

func (r *BeVectorRecall) CloneWithConfig(params map[string]interface{}) BeBaseRecall

func (*BeVectorRecall) GetItems

func (r *BeVectorRecall) GetItems(user *module.User, context *context.RecommendContext) (ret []*module.Item, err error)

type BeX2IRecall

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

func NewBeX2IRecall

func NewBeX2IRecall(client *beengine.BeClient, conf recconf.BeConfig) *BeX2IRecall

func (*BeX2IRecall) BuildQueryParams

func (r *BeX2IRecall) BuildQueryParams(user *module.User, context *context.RecommendContext) (ret map[string]string)

func (*BeX2IRecall) CloneWithConfig

func (r *BeX2IRecall) CloneWithConfig(params map[string]interface{}) BeBaseRecall

func (*BeX2IRecall) GetItems

func (r *BeX2IRecall) GetItems(user *module.User, context *context.RecommendContext) (ret []*module.Item, err error)

type ColdStartRecall

type ColdStartRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewColdStartRecall

func NewColdStartRecall(config recconf.RecallConfig) *ColdStartRecall

func (*ColdStartRecall) GetCandidateItems

func (r *ColdStartRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

func (*ColdStartRecall) LoopLoadItems

func (r *ColdStartRecall) LoopLoadItems()

type ContextItemRecall added in v2.0.2

type ContextItemRecall struct {
	*BaseRecall
}

func NewContextItemRecall added in v2.0.2

func NewContextItemRecall(config recconf.RecallConfig) *ContextItemRecall

func (*ContextItemRecall) GetCandidateItems added in v2.0.2

func (r *ContextItemRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type GraphRecall

type GraphRecall struct {
	*BaseRecall

	ItemId      string
	QueryString string
	Params      []string
	// contains filtered or unexported fields
}

func NewGraphRecall

func NewGraphRecall(config recconf.RecallConfig) *GraphRecall

func (*GraphRecall) GetCandidateItems

func (i *GraphRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type HologresVectorRecall

type HologresVectorRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewHologresVectorRecall

func NewHologresVectorRecall(config recconf.RecallConfig) *HologresVectorRecall

func (*HologresVectorRecall) GetCandidateItems

func (r *HologresVectorRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type I2IVectorRecall

type I2IVectorRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewI2IVectorRecall

func NewI2IVectorRecall(config recconf.RecallConfig) *I2IVectorRecall

func (*I2IVectorRecall) GetCandidateItems

func (r *I2IVectorRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type ItemCollaborativeFilterRecall

type ItemCollaborativeFilterRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewItemCollaborativeFilterRecall

func NewItemCollaborativeFilterRecall(config recconf.RecallConfig) *ItemCollaborativeFilterRecall

func (*ItemCollaborativeFilterRecall) GetCandidateItems

func (r *ItemCollaborativeFilterRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type MockRecall

type MockRecall struct {
	*BaseRecall
}

func NewMockRecall

func NewMockRecall(config recconf.RecallConfig) *MockRecall

func (*MockRecall) GetCandidateItems

func (r *MockRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type OnlineHologresVectorRecall

type OnlineHologresVectorRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewOnlineHologresVectorRecall

func NewOnlineHologresVectorRecall(config recconf.RecallConfig) *OnlineHologresVectorRecall

func (*OnlineHologresVectorRecall) GetCandidateItems

func (r *OnlineHologresVectorRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type OpenSearchRecall added in v2.0.9

type OpenSearchRecall struct {
	*BaseRecall

	AppName       string
	ItemId        string
	RequestParams map[string]any
	Params        []string
	// contains filtered or unexported fields
}

func NewOpenSearchRecall added in v2.0.9

func NewOpenSearchRecall(config recconf.RecallConfig) *OpenSearchRecall

func (*OpenSearchRecall) GetCandidateItems added in v2.0.9

func (i *OpenSearchRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type RealTimeU2IRecall

type RealTimeU2IRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewRealTimeU2IRecall

func NewRealTimeU2IRecall(config recconf.RecallConfig) *RealTimeU2IRecall

func (*RealTimeU2IRecall) GetCandidateItems

func (r *RealTimeU2IRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type Recall

type Recall interface {
	GetCandidateItems(user *module.User, context *context.RecommendContext) []*module.Item
}

func GetRecall

func GetRecall(name string) (Recall, error)

type UserCollaborativeFilterRecall

type UserCollaborativeFilterRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewUserCollaborativeFilterRecall

func NewUserCollaborativeFilterRecall(config recconf.RecallConfig) *UserCollaborativeFilterRecall

func (*UserCollaborativeFilterRecall) GetCandidateItems

func (r *UserCollaborativeFilterRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type UserCustomRecall

type UserCustomRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewUserCustomRecall

func NewUserCustomRecall(config recconf.RecallConfig) *UserCustomRecall

func (*UserCustomRecall) GetCandidateItems

func (r *UserCustomRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type UserGlobalHotRecall

type UserGlobalHotRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewUserGlobalHotRecall

func NewUserGlobalHotRecall(config recconf.RecallConfig) *UserGlobalHotRecall

func (*UserGlobalHotRecall) GetCandidateItems

func (r *UserGlobalHotRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type UserGroupHotRecall

type UserGroupHotRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewUserGroupHotRecall

func NewUserGroupHotRecall(config recconf.RecallConfig) *UserGroupHotRecall

func (*UserGroupHotRecall) GetCandidateItems

func (r *UserGroupHotRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type UserTopicRecall

type UserTopicRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewUserTopicRecall

func NewUserTopicRecall(config recconf.RecallConfig) *UserTopicRecall

func (*UserTopicRecall) GetCandidateItems

func (r *UserTopicRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

type VectorRecall

type VectorRecall struct {
	*BaseRecall
	// contains filtered or unexported fields
}

func NewVectorRecall

func NewVectorRecall(config recconf.RecallConfig) *VectorRecall

func (*VectorRecall) GetCandidateItems

func (r *VectorRecall) GetCandidateItems(user *module.User, context *context.RecommendContext) (ret []*module.Item)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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