advisor

package
v0.0.0-...-c8b2685 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package advisor provides suggestions on what Tags one might want to attach to 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 can suggest Tags for News Items.

func NewAdvisor

func NewAdvisor() (*Advisor, error)

NewAdvisor returns a new Advisor, but it does not train it, yet.

func (*Advisor) Learn

func (adv *Advisor) Learn(t *tag.Tag, i *feed.Item) error

Learn adds a single item to the Advisor's training corpus.

func (*Advisor) Suggest

func (adv *Advisor) Suggest(item *feed.Item, n int) map[string]SuggestedTag

Suggest returns a map Tags and how likely they apply to the given Item.

func (*Advisor) Train

func (adv *Advisor) Train() error

Train trains the Advisor based on the Tags that have been attached to Items previously.

func (*Advisor) Unlearn

func (adv *Advisor) Unlearn(t *tag.Tag, i *feed.Item) error

type SuggestedTag

type SuggestedTag struct {
	tag.Tag
	Score float64
}

SuggestedTag is a suggestion to attach a specific Tag to a specific Item.

Jump to

Keyboard shortcuts

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