rank

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DssmO2o = "dssm_o2o"
	MindO2o = "mind_o2o"
)

Variables

This section is empty.

Functions

func LoadColdStartRankConfig

func LoadColdStartRankConfig(config *recconf.RecommendConfig)

func RegisterRank

func RegisterRank(sceneName string, ranks ...IRank)

func SetBoostFunc

func SetBoostFunc(bf boostFunc)

Types

type AlgoData

type AlgoData struct {
	*AlgoDataBase
	RequestData []map[string]interface{}
}

func (*AlgoData) GetFeatures

func (d *AlgoData) GetFeatures() interface{}

type AlgoDataBase

type AlgoDataBase struct {
	Items []*module.Item
	// RequestData []map[string]interface{}
	AlgoResult map[string][]response.AlgoResponse
	Err        error
	Mutex      sync.Mutex
}

func (*AlgoDataBase) Error

func (a *AlgoDataBase) Error() error

func (*AlgoDataBase) GetAlgoResult

func (a *AlgoDataBase) GetAlgoResult() map[string][]response.AlgoResponse

func (*AlgoDataBase) GetItems

func (a *AlgoDataBase) GetItems() []*module.Item

func (*AlgoDataBase) SetAlgoResult

func (a *AlgoDataBase) SetAlgoResult(algoName string, results []response.AlgoResponse)

func (*AlgoDataBase) SetError

func (a *AlgoDataBase) SetError(err error)

type AlgoDataGenerator

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

func NewAlgoDataGenerator

func NewAlgoDataGenerator() *AlgoDataGenerator

func (*AlgoDataGenerator) AddFeatures

func (g *AlgoDataGenerator) AddFeatures(item *module.Item, itemFeatures map[string]interface{}, userFeatures map[string]interface{})

func (*AlgoDataGenerator) GeneratorAlgoData

func (g *AlgoDataGenerator) GeneratorAlgoData() IAlgoData

func (*AlgoDataGenerator) GeneratorAlgoDataDebug

func (g *AlgoDataGenerator) GeneratorAlgoDataDebug() IAlgoData

func (*AlgoDataGenerator) GeneratorAlgoDataDebugWithLevel

func (g *AlgoDataGenerator) GeneratorAlgoDataDebugWithLevel(level int) IAlgoData

func (*AlgoDataGenerator) HasFeatures

func (g *AlgoDataGenerator) HasFeatures() bool

type ColdStartRank

type ColdStartRank struct {
	RecallName           string
	AlgoName             string
	OnlyEmbeddingFeature bool
}

func NewColdStartRank

func NewColdStartRank(conf *recconf.ColdStartRankConfig) *ColdStartRank

func (*ColdStartRank) Filter

func (r *ColdStartRank) Filter(User *module.User, item *module.Item, context *context.RecommendContext) bool

func (*ColdStartRank) Rank

func (r *ColdStartRank) Rank(user *module.User, items []*module.Item, requestData []map[string]interface{}, context *context.RecommendContext)

type EasyrecAlgoData

type EasyrecAlgoData struct {
	*AlgoDataBase
	// contains filtered or unexported fields
}

func (*EasyrecAlgoData) GetFeatures

func (d *EasyrecAlgoData) GetFeatures() interface{}

type EasyrecAlgoDataGenerator

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

func NewEasyrecAlgoDataGenerator

func NewEasyrecAlgoDataGenerator(contextFeatures []string) *EasyrecAlgoDataGenerator

func (*EasyrecAlgoDataGenerator) AddFeatures

func (g *EasyrecAlgoDataGenerator) AddFeatures(item *module.Item, itemFeatures map[string]interface{}, userFeatures map[string]interface{})

func (*EasyrecAlgoDataGenerator) GeneratorAlgoData

func (g *EasyrecAlgoDataGenerator) GeneratorAlgoData() IAlgoData

func (*EasyrecAlgoDataGenerator) GeneratorAlgoDataDebug

func (g *EasyrecAlgoDataGenerator) GeneratorAlgoDataDebug() IAlgoData

func (*EasyrecAlgoDataGenerator) GeneratorAlgoDataDebugWithLevel

func (g *EasyrecAlgoDataGenerator) GeneratorAlgoDataDebugWithLevel(level int) IAlgoData

func (*EasyrecAlgoDataGenerator) HasFeatures

func (g *EasyrecAlgoDataGenerator) HasFeatures() bool

type FeatureConsistencyJobService

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

func (*FeatureConsistencyJobService) LogRankResult

func (r *FeatureConsistencyJobService) LogRankResult(user *module.User, items []*module.Item, context *context.RecommendContext)

func (*FeatureConsistencyJobService) LogRecallResult

func (r *FeatureConsistencyJobService) LogRecallResult(user *module.User, items []*module.Item, context *context.RecommendContext, triggerType, userEmbedding, triggerItem, recallAlgo, recallAlgoType, beName, bizName, recallName string)

type IAlgoData

type IAlgoData interface {
	GetFeatures() interface{}
	SetError(err error)
	Error() error
	GetItems() []*module.Item
	GetAlgoResult() map[string][]response.AlgoResponse
	SetAlgoResult(algoName string, results []response.AlgoResponse)
}

type IAlgoDataGenerator

type IAlgoDataGenerator interface {
	AddFeatures(item *module.Item, itemFeatures map[string]interface{}, userFeatures map[string]interface{})
	GeneratorAlgoData() IAlgoData
	// GeneratorAlgoDataDebug generator algo data with debug mode
	GeneratorAlgoDataDebug() IAlgoData
	GeneratorAlgoDataDebugWithLevel(level int) IAlgoData
	HasFeatures() bool
}

func CreateAlgoDataGenerator

func CreateAlgoDataGenerator(processor string, contextFeatures []string) IAlgoDataGenerator

type IRank

type IRank interface {
	// Filter the custom rank of item
	Filter(User *module.User, item *module.Item, context *context.RecommendContext) bool

	Rank(User *module.User, items []*module.Item, requestData []map[string]interface{}, context *context.RecommendContext)
}

type RankService

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

func DefaultRankService

func DefaultRankService() *RankService

func NewRankService

func NewRankService() *RankService

func (*RankService) AddRanks

func (r *RankService) AddRanks(sceneName string, ranks ...IRank)

func (*RankService) GetRanks

func (r *RankService) GetRanks(sceneName string, context *context.RecommendContext) (ret []IRank)

func (*RankService) Rank

func (r *RankService) Rank(user *module.User, items []*module.Item, context *context.RecommendContext)

Jump to

Keyboard shortcuts

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