Documentation ¶
Index ¶
- func LoadGeneralRankWithConfig(config *recconf.RecommendConfig)
- func RegisterColdStartGeneralRank(rankId string, rank *ColdStartGeneralRank)
- func RegisterGeneralRank(rankId string, rank *GeneralRank)
- type Action
- type ActionType
- type BaseGeneralRank
- type ColdStartGeneralRank
- type FeatureConsistencyJobService
- type GeneralRank
- type GeneralRankService
- func (r *GeneralRankService) AddColdStartGeneralRank(rankId string, rank *ColdStartGeneralRank)
- func (r *GeneralRankService) AddGeneralRank(rankId string, rank *GeneralRank)
- func (r *GeneralRankService) Clear()
- func (r *GeneralRankService) GetColdStartGeneralRank(rankId string) (*ColdStartGeneralRank, bool)
- func (r *GeneralRankService) GetColdStartGeneralRankByContext(context *context.RecommendContext) *ColdStartGeneralRank
- func (r *GeneralRankService) GetGeneralRank(rankId string) (*GeneralRank, bool)
- func (r *GeneralRankService) GetGeneralRankByContext(context *context.RecommendContext) *GeneralRank
- func (r *GeneralRankService) Rank(user *module.User, items []*module.Item, context *context.RecommendContext) (ret []*module.Item)
- type IGeneralRank
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadGeneralRankWithConfig ¶
func LoadGeneralRankWithConfig(config *recconf.RecommendConfig)
LoadGeneralRankWithConfig load general rank config by the recconf config When the function invoked, shows a new config reload, avoid using old filter or sort in the actions, we will clear the rank map, because when request come, GetColdStartGeneralRankByContext or GetGeneralRankByContext will get the new config and regiter the rank in the map.
func RegisterColdStartGeneralRank ¶
func RegisterColdStartGeneralRank(rankId string, rank *ColdStartGeneralRank)
func RegisterGeneralRank ¶
func RegisterGeneralRank(rankId string, rank *GeneralRank)
Types ¶
type ActionType ¶
type ActionType int
const ( UnknownAction ActionType = 0 SortAction ActionType = 1 FilterAction ActionType = 2 )
func CreateActionType ¶
func CreateActionType(str string) ActionType
type BaseGeneralRank ¶
type BaseGeneralRank struct {
// contains filtered or unexported fields
}
func NewBaseGeneralRankWithConfig ¶
func NewBaseGeneralRankWithConfig(scene string, config recconf.GeneralRankConfig) *BaseGeneralRank
func (*BaseGeneralRank) DoRank ¶
func (r *BaseGeneralRank) DoRank(user *module.User, items []*module.Item, context *context.RecommendContext, pipeline string) (ret []*module.Item)
Rank GeneralRank for items , return the items for Rank 1. first load user features 2. construct data use AlgoDataGenerator, if processor is easyrec, create easyrecRequest 3. use goroutines to invoke eas module 4. iterator actions invoke Do function to apply items
type ColdStartGeneralRank ¶
type ColdStartGeneralRank struct { *BaseGeneralRank // contains filtered or unexported fields }
func NewColdStartGeneralRankWithConfig ¶
func NewColdStartGeneralRankWithConfig(scene string, config recconf.ColdStartGeneralRankConfig) (*ColdStartGeneralRank, error)
func (*ColdStartGeneralRank) Filter ¶
func (r *ColdStartGeneralRank) Filter(User *module.User, item *module.Item, context *context.RecommendContext) 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)
type GeneralRank ¶
type GeneralRank struct {
*BaseGeneralRank
}
func NewGeneralRankWithConfig ¶
func NewGeneralRankWithConfig(scene string, config recconf.GeneralRankConfig) (*GeneralRank, error)
type GeneralRankService ¶
type GeneralRankService struct {
// contains filtered or unexported fields
}
func DefaultGeneralRankService ¶
func DefaultGeneralRankService() *GeneralRankService
func NewGeneralRankService ¶
func NewGeneralRankService() *GeneralRankService
func (*GeneralRankService) AddColdStartGeneralRank ¶
func (r *GeneralRankService) AddColdStartGeneralRank(rankId string, rank *ColdStartGeneralRank)
func (*GeneralRankService) AddGeneralRank ¶
func (r *GeneralRankService) AddGeneralRank(rankId string, rank *GeneralRank)
func (*GeneralRankService) Clear ¶
func (r *GeneralRankService) Clear()
func (*GeneralRankService) GetColdStartGeneralRank ¶
func (r *GeneralRankService) GetColdStartGeneralRank(rankId string) (*ColdStartGeneralRank, bool)
func (*GeneralRankService) GetColdStartGeneralRankByContext ¶
func (r *GeneralRankService) GetColdStartGeneralRankByContext(context *context.RecommendContext) *ColdStartGeneralRank
func (*GeneralRankService) GetGeneralRank ¶
func (r *GeneralRankService) GetGeneralRank(rankId string) (*GeneralRank, bool)
func (*GeneralRankService) GetGeneralRankByContext ¶
func (r *GeneralRankService) GetGeneralRankByContext(context *context.RecommendContext) *GeneralRank
GetGeneralRank return the GeneralRank by the context If not found, return nil