sequenceclassification

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classifier

type Classifier struct {
	Config ClassifierConfig
	*stack.Model
}

Classifier is a model for BART head for sentence-level classification tasks.

func NewClassifier

func NewClassifier(config ClassifierConfig) *Classifier

NewClassifier returns a new Classifier.

type ClassifierConfig

type ClassifierConfig struct {
	InputSize     int
	HiddenSize    int
	OutputSize    int
	PoolerDropout mat.Float
}

ClassifierConfig provides configuration settings for a BART head for sentence-level Classifier model.

type Model

type Model struct {
	nn.BaseModel
	BART       *bart.Model
	Classifier *Classifier
}

Model is a model for sentence-level classification tasks which embeds a BART pre-trained model.

func New

func New(config config.Config, embeddingsPath string) *Model

New returns a new Model for sentence-level classification.

func (*Model) Classify

func (m *Model) Classify(inputIds []int) ag.Node

Classify performs the classification using the last transformed state.

func (*Model) Close

func (m *Model) Close()

Close closes the BART model's embeddings DB.

Jump to

Keyboard shortcuts

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