Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRanker ¶
type ChatRanker struct {
// contains filtered or unexported fields
}
func NewChatRanker ¶
func NewChatRanker(cfg config.OpenAIConfig, prompt string) (*ChatRanker, error)
func (*ChatRanker) Rank ¶
func (r *ChatRanker) Rank(user *data.User, feedback []*FeedbackItem, items []*data.Item) ([]string, error)
type External ¶
type External struct {
// contains filtered or unexported fields
}
func NewExternal ¶
func NewExternal(cfg config.ExternalConfig) (*External, error)
type FeedbackItem ¶
type ItemToItem ¶
type ItemToItem interface {
Timestamp() time.Time
Items() []*data.Item
Push(item *data.Item, feedback []int32)
PopAll(i int) []cache.Score
Pool() parallel.Pool
}
func NewItemToItem ¶
func NewItemToItem(cfg config.ItemToItemConfig, n int, timestamp time.Time, opts *ItemToItemOptions) (ItemToItem, error)
type ItemToItemOptions ¶
type ItemToItemOptions struct {
TagsIDF []float32
UsersIDF []float32
OpenAIConfig config.OpenAIConfig
}
type MatrixFactorizationItems ¶
type MatrixFactorizationItems struct {
// contains filtered or unexported fields
}
func NewMatrixFactorizationItems ¶
func NewMatrixFactorizationItems(timestamp time.Time) *MatrixFactorizationItems
func (*MatrixFactorizationItems) Add ¶
func (items *MatrixFactorizationItems) Add(itemId string, v []float32)
func (*MatrixFactorizationItems) Marshal ¶
func (items *MatrixFactorizationItems) Marshal(w io.Writer) error
type MatrixFactorizationUsers ¶
type MatrixFactorizationUsers struct {
// contains filtered or unexported fields
}
func NewMatrixFactorizationUsers ¶
func NewMatrixFactorizationUsers() *MatrixFactorizationUsers
func (*MatrixFactorizationUsers) Add ¶
func (users *MatrixFactorizationUsers) Add(userId string, v []float32)
func (*MatrixFactorizationUsers) Get ¶
func (users *MatrixFactorizationUsers) Get(userId string) ([]float32, bool)
type NonPersonalized ¶
func NewNonPersonalized ¶
func NewNonPersonalized(cfg config.NonPersonalizedConfig, n int, timestamp time.Time) (*NonPersonalized, error)
func (*NonPersonalized) Name ¶
func (l *NonPersonalized) Name() string
func (*NonPersonalized) PopAll ¶
func (l *NonPersonalized) PopAll() []cache.Score
func (*NonPersonalized) Push ¶
func (l *NonPersonalized) Push(item data.Item, feedback []data.Feedback)
func (*NonPersonalized) Timestamp ¶
func (l *NonPersonalized) Timestamp() time.Time
type UserToUser ¶
type UserToUser interface {
Users() []*data.User
Push(user *data.User, feedback []int32)
PopAll(i int) []cache.Score
Timestamp() time.Time
}
func NewUserToUser ¶
func NewUserToUser(cfg config.UserToUserConfig, n int, timestamp time.Time, opts *UserToUserOptions) (UserToUser, error)
type UserToUserOptions ¶
Click to show internal directories.
Click to hide internal directories.