classify

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package classify suggests Tags that are likely to be a match for news Items.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advisor

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

Advisor suggests Tags for Items, based on existing tagging.

func New

func New() (*Advisor, error)

New creates a new Advisor.

func (*Advisor) Learn

func (ad *Advisor) Learn(tag *model.Tag, item *model.Item) error

Learn teaches the Advisor about the link between a Tag and an Item.

func (*Advisor) Reset

func (ad *Advisor) Reset() error

Reset discards the Advisor's training state and trains it from scratch on the tagged Items in the Database.

func (*Advisor) Score

func (ad *Advisor) Score(item *model.Item) (SuggList, error)

Score calculates how strongly the Item matches different tags.

func (*Advisor) Unlearn

func (ad *Advisor) Unlearn(tag *model.Tag, item *model.Item) error

Unlearn tells the Advisor to forget about the link between a Tag and an Item.

type SuggList

type SuggList []Suggestion

SuggList is a list of Suggestions.

type Suggestion

type Suggestion struct {
	TagID int64
	Match float64
}

Suggestion is the ID of a Tag and the score calculated by the Advisor.

Jump to

Keyboard shortcuts

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