classification

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(vectorizer vectorizer) modulecapabilities.Classifier

Types

type Classifier

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

func (*Classifier) Name

func (c *Classifier) Name() string

func (*Classifier) ParseClassifierSettings

func (c *Classifier) ParseClassifierSettings(params *models.Classification) error

type ParamsContextual

type ParamsContextual struct {
	MinimumUsableWords              *int32 `json:"minimumUsableWords"`
	InformationGainCutoffPercentile *int32 `json:"informationGainCutoffPercentile"`
	InformationGainMaximumBoost     *int32 `json:"informationGainMaximumBoost"`
	TfidfCutoffPercentile           *int32 `json:"tfidfCutoffPercentile"`
}

func (*ParamsContextual) SetDefaults

func (params *ParamsContextual) SetDefaults()

type TermWithTfIdf

type TermWithTfIdf struct {
	Term          string
	TfIdf         float32
	RelativeScore float32
}

type TfIdfCalculator

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

func NewTfIdfCalculator

func NewTfIdfCalculator(size int) *TfIdfCalculator

func (*TfIdfCalculator) AddDoc

func (c *TfIdfCalculator) AddDoc(doc string) error

func (*TfIdfCalculator) Calculate

func (c *TfIdfCalculator) Calculate()

func (*TfIdfCalculator) Get

func (c *TfIdfCalculator) Get(term string, doc int) float32

func (*TfIdfCalculator) GetAllTerms

func (c *TfIdfCalculator) GetAllTerms(docIndex int) []TermWithTfIdf

Jump to

Keyboard shortcuts

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