ClassContentRecommend

package
v5.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentBased

type ContentBased struct {
	// contains filtered or unexported fields
}

func NewContentBased

func NewContentBased() *ContentBased

func (*ContentBased) AddItem

func (c *ContentBased) AddItem(id string, orgID string, conditions []string, stringArray []string)

func (*ContentBased) FindItems

func (c *ContentBased) FindItems(orgID string, conditions []string) []*Item

FindItems 根据条件过滤数据 * # 查找OrgID为"org1"且包含condition1和condition2条件的项目 items := cb.FindItems("org1", []string{"condition1", "condition2"}) fmt.Println("Filtered items:", items)

# 如果需要忽略,给与-1或空切片即可 // 忽略 OrgID,仅根据 Conditions 检索 items = cb.FindItems("-1", []string{"condition1", "condition2"}) // 忽略 Conditions,仅根据 OrgID 检索 items = cb.FindItems("org1", []string{}) // 忽略 OrgID 和 Conditions,检索所有项目 items = cb.FindItems("-1", []string{})

func (*ContentBased) Recommend

func (c *ContentBased) Recommend(id string) ([]string, error)

func (*ContentBased) Train

func (c *ContentBased) Train() error

type Item

type Item struct {
	ID          string
	OrgID       string
	Conditions  []string
	StringArray []string
}

type SimilarItem

type SimilarItem struct {
	ItemID     string
	Similarity float64
}

type TfidfVectorizer

type TfidfVectorizer struct {
	// contains filtered or unexported fields
}

func NewTfidfVectorizer

func NewTfidfVectorizer(contentConditions []string) *TfidfVectorizer

func (*TfidfVectorizer) Fit

func (t *TfidfVectorizer) Fit()

func (*TfidfVectorizer) IDF

func (t *TfidfVectorizer) IDF(condition string) float64

Jump to

Keyboard shortcuts

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