Documentation ¶
Index ¶
- Constants
- func DefaultAdjustNewItemsFunc(filterData *FilterData, retainNum int) []*module.Item
- func Filter(filterData *FilterData, tag string)
- func Load(config *recconf.RecommendConfig)
- func RegisterAdjustNewItemsFunc(f AdjustNewItemsFunc)
- func RegisterFilter(name string, filter IFilter)
- func RegisterFilterWithConfig(config *recconf.RecommendConfig)
- type AdjustCountFilter
- type AdjustNewItemsFunc
- type AvgGroupWeightStrategy
- type CompletelyFairCountFilter
- type DimensionFieldUniqueFilter
- type FilterData
- type FilterService
- type GenerateFilterKey
- type GenerateFilterValue
- type GroupWeightCountFilter
- type GroupWeightStrategy
- type IFilter
- type ItemCustomFilter
- type ItemStateFilter
- type PriorityAdjustCountFilter
- type SoftmaxGroupWeightStrategy
- type UniqueFilter
- type User2ItemCustomFilter
- type User2ItemExposureBloomFilter
- type User2ItemExposureFilter
Constants ¶
View Source
const ( Fix_Count_Type = "fix" Accumulate_Count_Type = "accumulator" )
Variables ¶
This section is empty.
Functions ¶
func DefaultAdjustNewItemsFunc ¶
func DefaultAdjustNewItemsFunc(filterData *FilterData, retainNum int) []*module.Item
func Filter ¶
func Filter(filterData *FilterData, tag string)
func Load ¶
func Load(config *recconf.RecommendConfig)
func RegisterAdjustNewItemsFunc ¶
func RegisterAdjustNewItemsFunc(f AdjustNewItemsFunc)
func RegisterFilter ¶
func RegisterFilterWithConfig ¶
func RegisterFilterWithConfig(config *recconf.RecommendConfig)
Types ¶
type AdjustCountFilter ¶
type AdjustCountFilter struct {
// contains filtered or unexported fields
}
func NewAdjustCountFilter ¶
func NewAdjustCountFilter(config recconf.FilterConfig) *AdjustCountFilter
func (*AdjustCountFilter) Filter ¶
func (f *AdjustCountFilter) Filter(filterData *FilterData) error
type AdjustNewItemsFunc ¶
type AdjustNewItemsFunc func(filterData *FilterData, retainNum int) []*module.Item
type AvgGroupWeightStrategy ¶
type AvgGroupWeightStrategy struct {
// contains filtered or unexported fields
}
func (*AvgGroupWeightStrategy) DimensionCount ¶
func (s *AvgGroupWeightStrategy) DimensionCount(dimension string, retainNum int) (count int, exceedNum bool)
func (*AvgGroupWeightStrategy) SetDimensionScoreMap ¶
func (s *AvgGroupWeightStrategy) SetDimensionScoreMap(dimensionScoreMap map[string]float64)
func (*AvgGroupWeightStrategy) TotalScore ¶
func (s *AvgGroupWeightStrategy) TotalScore()
type CompletelyFairCountFilter ¶
type CompletelyFairCountFilter struct {
// contains filtered or unexported fields
}
func NewCompletelyFairCountFilter ¶
func NewCompletelyFairCountFilter(config recconf.FilterConfig) *CompletelyFairCountFilter
func (*CompletelyFairCountFilter) Filter ¶
func (f *CompletelyFairCountFilter) Filter(filterData *FilterData) error
type DimensionFieldUniqueFilter ¶
type DimensionFieldUniqueFilter struct {
// contains filtered or unexported fields
}
remove duplicate item
func NewDimensionFieldUniqueFilter ¶
func NewDimensionFieldUniqueFilter(config recconf.FilterConfig) *DimensionFieldUniqueFilter
func (*DimensionFieldUniqueFilter) Filter ¶
func (f *DimensionFieldUniqueFilter) Filter(filterData *FilterData) error
func (*DimensionFieldUniqueFilter) MatchTag ¶
func (f *DimensionFieldUniqueFilter) MatchTag(tag string) bool
type FilterData ¶
type FilterService ¶
func (*FilterService) AddFilter ¶
func (fs *FilterService) AddFilter(scene string, filter IFilter)
func (*FilterService) AddFilters ¶
func (fs *FilterService) AddFilters(scene string, filters []IFilter)
func (*FilterService) Filter ¶
func (fs *FilterService) Filter(filterData *FilterData, tag string)
type GenerateFilterKey ¶
type GenerateFilterKey func(uid module.UID, context *context.RecommendContext) string
function for generate bloom filter key
type GenerateFilterValue ¶
type GenerateFilterValue func(uid module.UID, items []*module.Item, context *context.RecommendContext) [][]byte
function for generate bloom filter values
type GroupWeightCountFilter ¶
type GroupWeightCountFilter struct {
// contains filtered or unexported fields
}
func NewGroupWeightCountFilter ¶
func NewGroupWeightCountFilter(config recconf.FilterConfig) *GroupWeightCountFilter
func (*GroupWeightCountFilter) Filter ¶
func (f *GroupWeightCountFilter) Filter(filterData *FilterData) error
type GroupWeightStrategy ¶
type IFilter ¶
type IFilter interface {
Filter(filterData *FilterData) error
}
func GetFiltersBySceneName ¶
type ItemCustomFilter ¶
type ItemCustomFilter struct {
// contains filtered or unexported fields
}
user exposure history filter
func NewItemCustomFilter ¶
func NewItemCustomFilter(config recconf.FilterConfig) *ItemCustomFilter
func (*ItemCustomFilter) Filter ¶
func (f *ItemCustomFilter) Filter(filterData *FilterData) error
type ItemStateFilter ¶
type ItemStateFilter struct {
// contains filtered or unexported fields
}
func NewItemStateFilter ¶
func NewItemStateFilter(config recconf.FilterConfig) *ItemStateFilter
func (*ItemStateFilter) Filter ¶
func (f *ItemStateFilter) Filter(filterData *FilterData) error
type PriorityAdjustCountFilter ¶
type PriorityAdjustCountFilter struct {
// contains filtered or unexported fields
}
func NewPriorityAdjustCountFilter ¶
func NewPriorityAdjustCountFilter(config recconf.FilterConfig) *PriorityAdjustCountFilter
func (*PriorityAdjustCountFilter) Filter ¶
func (f *PriorityAdjustCountFilter) Filter(filterData *FilterData) error
type SoftmaxGroupWeightStrategy ¶
type SoftmaxGroupWeightStrategy struct {
// contains filtered or unexported fields
}
func (*SoftmaxGroupWeightStrategy) DimensionCount ¶
func (s *SoftmaxGroupWeightStrategy) DimensionCount(dimension string, retainNum int) (count int, exceedNum bool)
func (*SoftmaxGroupWeightStrategy) SetDimensionScoreMap ¶
func (s *SoftmaxGroupWeightStrategy) SetDimensionScoreMap(dimensionScoreMap map[string]float64)
func (*SoftmaxGroupWeightStrategy) TotalScore ¶
func (s *SoftmaxGroupWeightStrategy) TotalScore()
type UniqueFilter ¶
type UniqueFilter struct { }
remove duplicate item
func NewUniqueFilter ¶
func NewUniqueFilter() *UniqueFilter
func (*UniqueFilter) Filter ¶
func (f *UniqueFilter) Filter(filterData *FilterData) error
func (*UniqueFilter) MatchTag ¶
func (f *UniqueFilter) MatchTag(tag string) bool
type User2ItemCustomFilter ¶
type User2ItemCustomFilter struct {
// contains filtered or unexported fields
}
user exposure history filter
func NewUser2ItemCustomFilter ¶
func NewUser2ItemCustomFilter(config recconf.FilterConfig) *User2ItemCustomFilter
func (*User2ItemCustomFilter) Filter ¶
func (f *User2ItemCustomFilter) Filter(filterData *FilterData) error
func (*User2ItemCustomFilter) MatchTag ¶
func (f *User2ItemCustomFilter) MatchTag(tag string) bool
type User2ItemExposureBloomFilter ¶
type User2ItemExposureBloomFilter struct {
// contains filtered or unexported fields
}
user exposure history filter
func NewUser2ItemExposureBloomFilter ¶
func NewUser2ItemExposureBloomFilter(bloom bloomfilter.BloomFilterInterface, fkey GenerateFilterKey, fvalue GenerateFilterValue) *User2ItemExposureBloomFilter
func (*User2ItemExposureBloomFilter) Filter ¶
func (f *User2ItemExposureBloomFilter) Filter(filterData *FilterData) error
func (*User2ItemExposureBloomFilter) MatchTag ¶
func (f *User2ItemExposureBloomFilter) MatchTag(tag string) bool
func (*User2ItemExposureBloomFilter) SetFilterActive ¶
func (f *User2ItemExposureBloomFilter) SetFilterActive(flag bool)
func (*User2ItemExposureBloomFilter) SetLogHistoryActive ¶
func (f *User2ItemExposureBloomFilter) SetLogHistoryActive(flag bool)
type User2ItemExposureFilter ¶
type User2ItemExposureFilter struct {
// contains filtered or unexported fields
}
user exposure history filter
func NewUser2ItemExposureFilter ¶
func NewUser2ItemExposureFilter(config recconf.FilterConfig) *User2ItemExposureFilter
func (*User2ItemExposureFilter) Filter ¶
func (f *User2ItemExposureFilter) Filter(filterData *FilterData) error
func (*User2ItemExposureFilter) MatchTag ¶
func (f *User2ItemExposureFilter) MatchTag(tag string) bool
Source Files ¶
- adjust_count_filter.go
- completely_fair_count_filter.go
- dimension_field_unique_filter.go
- filter.go
- group_weight_count_filter.go
- item_custom_filter.go
- item_state_filter.go
- priority_adjust_count_filter.go
- unique_filter.go
- user_item_custom_filter.go
- user_item_exposure_bloom_filter.go
- user_item_exposure_filter.go
Click to show internal directories.
Click to hide internal directories.