retrieve

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	I2iRecall      = "I2iRecall"
	I2Zone2iRecall = "I2Zone2iRecall"
	I2tag2iRecall  = "I2tag2iRecall"
)

召回策略

View Source
const (
	SourceTagIDs = "SourceTagIDs"
	SourceZoneID = "SourceZoneID"
	SourceUpMID  = "SourceUpMID"
)

Source Video Info

View Source
const (
	Hot       = "hot"
	Selection = "selection"
	Relevant  = "relevant"
	Tag       = "tag"
)

召回策略

View Source
const (
	//recall class
	HotRecall       = "HotRecall"
	RandomRecall    = "RandomRecall"
	SelectionRecall = "SelectionRecall"
	UserProfileBili = "UserProfileBili"
	UserProfileBBQ  = "UserProfileBBQ"
	LikeI2IRecall   = "LikeI2IRecall"
	LikeTagRecall   = "LikeTagRecall"
	LikeUPRecall    = "LikeUPRecall"
	PosI2IRecall    = "PosI2IRecall"
	PosTagRecall    = "PosTagRecall"
	FollowRecall    = "FollowRecall"
)

召回策略

View Source
const (
	RecallKeyI2IPrefix   = "RECALL:I2I"
	RecallKeyTagIDPrefix = "RECALL:HOT_T"
	RecallKeyUpIDPrefix  = "RECALL:HOT_UP"
)

RecallKey Prefixes

View Source
const (
	RecallOpVideoKey = "job:bbq:rec:op"
	RecallHotDefault = "RECALL:HOT_DEFAULT:0"
)

Recall redis key

View Source
const BiliFollowsRecall = "BiliFollowsRecall"

Variables

This section is empty.

Functions

func DefaultRetrieveFunc

func DefaultRetrieveFunc(c context.Context, r Retriever, searchClient searchv1.SearchClient, request rpc.RecsysRequest, userProfile *model.UserProfile, response chan rpc.RecsysResponse)

DefaultRetrieveFunc is default retrieve function

Types

type Calc

type Calc struct {
	Open       int64   `json:"open"`
	PlayRatio  float64 `json:"play_ratio"`
	FavRatio   float64 `json:"fav_ratio"`
	LikeRatio  float64 `json:"like_ratio"`
	PubRatio   float64 `json:"pub_ratio"`
	CoinRatio  float64 `json:"coin_ratio"`
	ReplyRatio float64 `json:"reply_ratio"`
	ShareRatio float64 `json:"share_ratio"`
}

Calc .

type ColdStartRetriever

type ColdStartRetriever struct {
	Retrievers
}

ColdStartRetriever ...

type Query

type Query struct {
	Calc   *Calc                  `json:"calc"`
	Where  *Where                 `json:"where"`
	Filter map[string]interface{} `json:"filter"`
	From   int                    `json:"from"`
	Size   int                    `json:"size"`
}

Query .

type RecallManager

type RecallManager struct {
	Retrievers []Retriever2
}

RecallManager manages multiple retrieve functions

func NewRecallManager

func NewRecallManager() (m *RecallManager)

NewRecallManager ...

func (*RecallManager) RelatedRec

func (m *RecallManager) RelatedRec(c context.Context, request *recsys.RecsysRequest, recallClient recallv1.RecsysRecallClient) (response *recsys.RecsysResponse, err error)

RelatedRec is retrieve function

func (*RecallManager) UpsRec

func (m *RecallManager) UpsRec(c context.Context, request *recsys.RecsysRequest, userProfile *model.UserProfile, recallClient recallv1.RecsysRecallClient, relationClient api.RelationClient) (response *recsys.RecsysResponse, err error)

func (*RecallManager) V2RetrieveFunc

func (m *RecallManager) V2RetrieveFunc(c context.Context, request *recsys.RecsysRequest, userProfile *model.UserProfile, recallClient recallv1.RecsysRecallClient) (response *recsys.RecsysResponse, err error)

V2RetrieveFunc is default retrieve function

type Retriever

type Retriever interface {
	// contains filtered or unexported methods
}

Retriever .

type Retriever2

type Retriever2 interface {
	// contains filtered or unexported methods
}

Retriever2 ...

type RetrieverFunc

type RetrieverFunc func(c context.Context, r Retriever, searchClient searchv1.SearchClient, request rpc.RecsysRequest, userProfile *model.UserProfile, response chan rpc.RecsysResponse)

RetrieverFunc ...

type RetrieverFuncV2

type RetrieverFuncV2 func(c context.Context, request *recsys.RecsysRequest, userProfile *model.UserProfile, recallClient recallv1.RecsysRecallClient) (response *recsys.RecsysResponse, err error)

RetrieverFuncV2 ...

type RetrieverManager

type RetrieverManager struct {
	Retrievers     []Retriever
	PreRetrievers  []Retriever
	PostRetrievers []Retriever
	RetrieveFunc   RetrieverFunc
}

RetrieverManager manages multiple retrieve functions

func NewRetrieverManager

func NewRetrieverManager() (m *RetrieverManager)

NewRetrieverManager ...

func (*RetrieverManager) Merge

func (m *RetrieverManager) Merge(response *rpc.RecsysResponse)

Merge ...

type Retrievers

type Retrievers struct {
	MethodName string
	Retrieve   RetrieverFunc
}

Retrievers ...

type Where

type Where struct {
	In    map[string][]interface{} `json:"in"`
	NotIn map[string][]interface{} `json:"not_in"`
}

Where .

Jump to

Keyboard shortcuts

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