Documentation ¶
Index ¶
- Constants
- Variables
- func CopyConfig(src, dst *RecommendConfig, filters ...func(string) bool)
- func LoadConfig(filePath string) error
- func ParseUserDefineConfs[T any](ops ...ParseOp) (T, error)
- func Subscribe() <-chan *RecommendConfig
- func UpdateConf(conf *RecommendConfig)
- type ABTestConfig
- type ActionConfig
- type AdjustCountConfig
- type AlgoConfig
- type BEConfig
- type BeConfig
- type BeFilterConfig
- type BeRTCntFieldConfig
- type BeRecallParam
- type BeTriggerParam
- type BeVectorConfig
- type BoostScoreByWeightDaoConfig
- type BoostScoreCondition
- type CallBackConfig
- type CategoryConfig
- type ClickHouseConfig
- type ColdStartDaoConfig
- type ColdStartGeneralRankConfig
- type ColdStartRankConfig
- type DPPSortConfig
- type DaoConfig
- type DataSourceConfig
- type DatahubConfig
- type DatahubTopicSchema
- type DebugConfig
- type DistinctIdCondition
- type DiversityDaoConfig
- type DiversityRuleConfig
- type EasConfig
- type FeatureConfig
- type FeatureDaoConfig
- type FeatureLoadConfig
- type FeatureStoreConfig
- type FilterConfig
- type FilterParamConfig
- type FilterValue
- type GeneralRankConfig
- type GraphConf
- type GraphConfig
- type HBaseConfig
- type HBaseThriftConfig
- type Ha3EngineConfig
- type HologresConfig
- type HologresVectorConfig
- type ItemCollaborativeDaoConfig
- type ItemStateDaoConfig
- type KafkaConfig
- type LindormConfig
- type ListenConfig
- type LogConfig
- type LookupConfig
- type MilvusConfig
- type MilvusVectorConfig
- type MixSortConfig
- type MysqlConfig
- type OperatorValueConfig
- type PIDControllerConfig
- type ParseOp
- type PipelineConfig
- type PrometheusConfig
- type RankConfig
- type RealTimeUser2ItemDaoConfig
- type RecallConfig
- type RecallNameMappingConfig
- type RecommendConfig
- type RedisConfig
- type SceneConfig
- type SceneFeatureConfig
- type SeldonConfig
- type SlsConfig
- type SortConfig
- type SqlDaoConfig
- type TFservingConfig
- type TableStoreConfig
- type TriggerConfig
- type TriggerDiversityRuleConfig
- type User2ItemDaoConfig
- type UserCollaborativeDaoConfig
- type UserEmbeddingO2OTriggerConfig
- type UserRealtimeEmbeddingTriggerConfig
- type UserTopicDaoConfig
- type UserTriggerDaoConfig
- type UserTriggerRulesConfig
- type UserVectorTriggerConfig
- type VectorConfig
- type VectorDaoConfig
Constants ¶
View Source
const ( DaoConf_Adapter_Mysql = "mysql" DaoConf_Adapter_Redis = "redis" DaoConf_Adapter_TableStore = "tablestore" DaoConf_Adapter_HBase = "hbase" DaoConf_Adapter_Hologres = "hologres" DataSource_Type_Kafka = "kafka" DataSource_Type_Datahub = "datahub" DataSource_Type_ClickHouse = "clickhouse" DataSource_Type_BE = "be" DataSource_Type_Lindorm = "lindorm" DataSource_Type_HBase_Thrift = "hbase_thrift" DataSource_Type_FeatureStore = "featurestore" Datasource_Type_Graph = "graph" BE_RecallType_X2I = "x2i_recall" BE_RecallType_Vector = "vector_recall" BE_RecallType_MultiMerge = "multi_merge_recall" )
Variables ¶
View Source
var WithKey = func(key string) ParseOp {
return func(setting *parseSetting) {
setting.Key = key
}
}
Functions ¶
func CopyConfig ¶
func CopyConfig(src, dst *RecommendConfig, filters ...func(string) bool)
func LoadConfig ¶
LoadConfig load config from file or pairec config server First check the environment CONFIG_NAME, if exist, load config data from pairec config server
func ParseUserDefineConfs ¶
func Subscribe ¶
func Subscribe() <-chan *RecommendConfig
func UpdateConf ¶
func UpdateConf(conf *RecommendConfig)
Types ¶
type ABTestConfig ¶
type ActionConfig ¶
type AdjustCountConfig ¶
type AlgoConfig ¶
type AlgoConfig struct { Name string Type string EasConf EasConfig VectorConf VectorConfig MilvusConf MilvusConfig LookupConf LookupConfig SeldonConf SeldonConfig TFservingConf TFservingConfig }
type BeConfig ¶
type BeConfig struct { Count int BeName string BizName string BeRecallType string RecallNameMapping map[string]RecallNameMappingConfig BeRecallParams []BeRecallParam BeFilterNames []string BeABParams map[string]interface{} }
type BeFilterConfig ¶
type BeFilterConfig struct {
FilterConfig
}
type BeRTCntFieldConfig ¶
type BeRecallParam ¶
type BeRecallParam struct { Count int Priority int RecallType string RecallName string ScorerClause string TriggerType string // user or be or fixvalue or user_vector UserTriggers []TriggerConfig TriggerValue string // TriggerParam BeTriggerParam //RecallParamName string UserVectorTrigger UserVectorTriggerConfig UserTriggerDaoConf UserTriggerDaoConfig // online table for u2i UserTriggerRulesConf UserTriggerRulesConfig // be recall diversity trigger, trigger have diff recall count UserCollaborativeDaoConf UserCollaborativeDaoConfig // offline table for u2i UserRealtimeEmbeddingTrigger UserRealtimeEmbeddingTriggerConfig // get user feature and invoke eas model, get item embedding sink to be UserEmbeddingO2OTrigger UserEmbeddingO2OTriggerConfig ItemIdName string TriggerIdName string RecallTableName string DiversityParam string CustomParams map[string]interface{} }
type BeTriggerParam ¶
type BeVectorConfig ¶
type BoostScoreCondition ¶
type BoostScoreCondition struct { Expression string Conditions []FilterParamConfig }
type CallBackConfig ¶
type CallBackConfig struct { DataSource DataSourceConfig RankConf RankConfig RawFeatures bool RawFeaturesRate int }
type CategoryConfig ¶
type CategoryConfig struct {
RecallNames []string
}
type ClickHouseConfig ¶
type ClickHouseConfig struct {
DSN string
}
type ColdStartDaoConfig ¶
type ColdStartDaoConfig struct { SqlDaoConfig TimeInterval int // second }
type ColdStartGeneralRankConfig ¶
type ColdStartGeneralRankConfig struct { GeneralRankConfig RecallNames []string }
type ColdStartRankConfig ¶
type DPPSortConfig ¶
type DPPSortConfig struct { Name string DaoConf DaoConfig TableName string TableSuffixParam string TablePKey string EmbeddingColumn string EmbeddingSeparator string Alpha float64 CacheTimeInMinutes int EmbeddingHookNames []string NormalizeEmb string WindowSize int EmbMissedThreshold float64 FilterRetrieveIds []string EnsurePositiveSim string }
type DaoConfig ¶
type DaoConfig struct { Adapter string AdapterType string RedisName string RedisPrefix string RedisDataType string RedisFieldType string RedisDefaultKey string RedisValueDelimeter string MysqlName string MysqlTable string Config string TableStoreName string TableStoreTableName string HBasePrefix string HBaseName string HBaseTable string ColumnFamily string Qualifier string // hologres HologresName string HologresTableName string // clickhouse ClickHouseName string ClickHouseTableName string // be engine BeName string BizName string BeRecallName string BeTableName string BeExposureUserIdName string BeExposureItemIdName string // feature store FeatureStoreName string FeatureStoreModelName string FeatureStoreEntityName string // graph GraphName string InstanceId string TableName string UserNode string ItemNode string Edge string // lindorm LindormTableName string LindormName string }
type DataSourceConfig ¶
type DatahubConfig ¶
type DatahubTopicSchema ¶
type DebugConfig ¶
type DistinctIdCondition ¶
type DistinctIdCondition struct { DistinctId int Conditions []FilterParamConfig }
type DiversityDaoConfig ¶
type DiversityRuleConfig ¶
type FeatureConfig ¶
type FeatureDaoConfig ¶
type FeatureDaoConfig struct { DaoConfig NoUsePlayTimeField bool FeatureKey string FeatureStore string // user or item UserFeatureKeyName string ItemFeatureKeyName string TimestampFeatureKeyName string EventFeatureKeyName string PlayTimeFeatureKeyName string TsFeatureKeyName string UserSelectFields string ItemSelectFields string // FeatureAsyncLoad use async goroutine to load feature FeatureAsyncLoad bool FeatureType string // per feature type has different way of build SequenceLength int SequenceName string SequenceEvent string SequenceDelim string // SequencePlayTime filter event by as least play time // like play event need to large than 10s, so set value is "play:10000", timeunit is ms // if has more than one event to filter, use ';' as delim , like "play:10000;read:50000" SequencePlayTime string SequenceOfflineTableName string // SequenceDimFields fetch other dimension fields from db SequenceDimFields string BeItemFeatureKeyName string BeTimestampFeatureKeyName string BeEventFeatureKeyName string BePlayTimeFeatureKeyName string BeIsHomeField string // separate by , if combined by multiple fields separate by : // [depreciated], please set BeRTCntFieldInfo.FieldNames instead BeRTCntFields string BeRTCntFieldInfo []BeRTCntFieldConfig BeRTTable string RTCntWins string RTCntMaxKey int RTCntWinDelay int OutRTCntFeaPattern string OutHomeRTCntFeaPattern string // [depreciated], please set BeRTCntFieldInfo.Alias instead OutRTCntFieldAlias string OutRTCntWinNames string OutEventName string // CacheFeaturesName When use UserFeatureConfs, can cache load features to the user cacheFeatures map. // Only valid when FeatureStore = user CacheFeaturesName string // LoadFromCacheFeaturesName load features from user cacheFeatures map // Only valid when FeatureStore = user LoadFromCacheFeaturesName string }
type FeatureLoadConfig ¶
type FeatureLoadConfig struct { FeatureDaoConf FeatureDaoConfig Features []FeatureConfig }
type FeatureStoreConfig ¶
type FilterConfig ¶
type FilterConfig struct { Name string FilterType string DaoConf DaoConfig MaxItems int TimeInterval int // second RetainNum int ShuffleItem bool WriteLog bool ClearLogIfNotEnoughScene string Dimension string ScoreWeight float64 GroupMinNum int GroupMaxNum int GroupWeightStrategy string GroupWeightDimensionLimit map[string]int WriteLogExcludeScenes []string GenerateItemDataFuncName string AdjustCountConfs []AdjustCountConfig ItemStateDaoConf ItemStateDaoConfig FilterEvaluableExpression string FilterParams []FilterParamConfig DiversityDaoConf DiversityDaoConfig DiversityMinCount int EnsureDiversity bool FilterVal FilterValue }
type FilterParamConfig ¶
type FilterValue ¶
type GeneralRankConfig ¶
type GeneralRankConfig struct { FeatureLoadConfs []FeatureLoadConfig RankConf RankConfig ActionConfs []ActionConfig }
type GraphConfig ¶
type HBaseConfig ¶
type HBaseConfig struct {
ZKQuorum string
}
type HBaseThriftConfig ¶
type Ha3EngineConfig ¶
type HologresConfig ¶
type HologresConfig struct {
DSN string
}
type HologresVectorConfig ¶
type ItemStateDaoConfig ¶
type KafkaConfig ¶
type LindormConfig ¶
type ListenConfig ¶
type LookupConfig ¶
type LookupConfig struct {
FieldName string
}
type MilvusConfig ¶
type MilvusVectorConfig ¶
type MixSortConfig ¶
type MysqlConfig ¶
type MysqlConfig struct {
DSN string
}
type OperatorValueConfig ¶
type PIDControllerConfig ¶
type PIDControllerConfig struct { SyncPIDStatus bool HologresName string LoadItemFeature bool PreloadItemFeature bool AllocateExperimentWise bool MaxItemCacheSize int MaxItemCacheTime int RedisName string RedisKeyPrefix string SampleTime float32 DefaultKp float32 DefaultKi float32 DefaultKd float32 TestTimestamp int64 BoostScoreConditions []BoostScoreCondition }
type PipelineConfig ¶
type PipelineConfig struct { Name string RecallNames []string FilterNames []string GeneralRankConf GeneralRankConfig FeatureLoadConfs []FeatureLoadConfig RankConf RankConfig ColdStartRankConf ColdStartRankConfig SortNames []string }
type PrometheusConfig ¶
type RankConfig ¶
type RealTimeUser2ItemDaoConfig ¶
type RealTimeUser2ItemDaoConfig struct { UserTriggerDaoConf UserTriggerDaoConfig Item2ItemTable string }
type RecallConfig ¶
type RecallConfig struct { Name string RecallType string RecallCount int RecallAlgo string ItemType string CacheAdapter string CacheConfig string CachePrefix string CacheTime int // cache time by seconds Triggers []TriggerConfig HologresVectorConf HologresVectorConfig BeVectorConf BeVectorConfig MilvusVectorConf MilvusVectorConfig UserCollaborativeDaoConf UserCollaborativeDaoConfig ItemCollaborativeDaoConf ItemCollaborativeDaoConfig User2ItemDaoConf User2ItemDaoConfig UserTopicDaoConf UserTopicDaoConfig DaoConf DaoConfig VectorDaoConf VectorDaoConfig ColdStartDaoConf ColdStartDaoConfig RealTimeUser2ItemDaoConf RealTimeUser2ItemDaoConfig UserFeatureConfs []FeatureLoadConfig // get user features // be recall config BeConf BeConfig GraphConf GraphConf }
type RecallNameMappingConfig ¶
type RecommendConfig ¶
type RecommendConfig struct { RunMode string // Run Mode: daily | product Region string ListenConf ListenConfig UserFeatureConfs map[string]SceneFeatureConfig FeatureConfs map[string]SceneFeatureConfig SortNames map[string][]string FilterNames map[string][]string AlgoConfs []AlgoConfig RecallConfs []RecallConfig FilterConfs []FilterConfig BeFilterConfs []BeFilterConfig SortConfs []SortConfig RedisConfs map[string]RedisConfig MysqlConfs map[string]MysqlConfig ClickHouseConfs map[string]ClickHouseConfig HologresConfs map[string]HologresConfig LindormConfs map[string]LindormConfig GraphConfs map[string]GraphConfig FeatureStoreConfs map[string]FeatureStoreConfig KafkaConfs map[string]KafkaConfig SlsConfs map[string]SlsConfig DatahubConfs map[string]DatahubConfig BEConfs map[string]BEConfig Ha3EngineConfs map[string]Ha3EngineConfig HBaseConfs map[string]HBaseConfig HBaseThriftConfs map[string]HBaseThriftConfig TableStoreConfs map[string]TableStoreConfig SceneConfs map[string]map[string]CategoryConfig RankConf map[string]RankConfig LogConf LogConfig ABTestConf ABTestConfig CallBackConfs map[string]CallBackConfig GeneralRankConfs map[string]GeneralRankConfig ColdStartGeneralRankConfs map[string]ColdStartGeneralRankConfig ColdStartRankConfs map[string]ColdStartRankConfig DPPConf []DPPSortConfig DebugConfs map[string]DebugConfig PipelineConfs map[string][]PipelineConfig PrometheusConfig PrometheusConfig UserDefineConfs json.RawMessage }
var (
Config *RecommendConfig
)
type RedisConfig ¶
type SceneConfig ¶
type SceneConfig struct {
Categories []string
}
type SceneFeatureConfig ¶
type SceneFeatureConfig struct { FeatureLoadConfs []FeatureLoadConfig AsynLoadFeature bool }
type SeldonConfig ¶
type SortConfig ¶
type SortConfig struct { Debug bool RemainItem bool Name string SortType string SortByField string SwitchThreshold float64 DiversitySize int Size int DPPConf DPPSortConfig PIDConf PIDControllerConfig MixSortRules []MixSortConfig BoostScoreConditionsFilterAll bool BoostScoreConditions []BoostScoreCondition DistinctIdConditions []DistinctIdCondition Conditions []FilterParamConfig ExcludeRecalls []string DiversityRules []DiversityRuleConfig TimeInterval int BoostScoreByWeightDao BoostScoreByWeightDaoConfig }
type SqlDaoConfig ¶
type TFservingConfig ¶
type TableStoreConfig ¶
type TriggerConfig ¶
type User2ItemDaoConfig ¶
type UserTopicDaoConfig ¶
type UserTriggerDaoConfig ¶
type UserTriggerDaoConfig struct { SqlDaoConfig NoUsePlayTimeField bool ItemCount int TriggerCount int EventPlayTime string EventWeight string WeightExpression string WeightMode string PropertyFields []string DiversityRules []TriggerDiversityRuleConfig BeItemFeatureKeyName string BeTimestampFeatureKeyName string BeEventFeatureKeyName string BePlayTimeFeatureKeyName string }
type UserTriggerRulesConfig ¶
type UserVectorTriggerConfig ¶
type UserVectorTriggerConfig struct { CacheTime int CachePrefix string RecallAlgo string UserFeatureConfs []FeatureLoadConfig // get user features }
type VectorConfig ¶
Click to show internal directories.
Click to hide internal directories.