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) Train ¶
func (c *ContentBased) Train() error
type SimilarItem ¶
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
Click to show internal directories.
Click to hide internal directories.