bart

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZeroShotClassifier

type ZeroShotClassifier struct {
	// Model is the model used for zero-shot classification.
	Model *bart.ModelForSequenceClassification
	// Tokenizer is the tokenizer.
	Tokenizer *bpetokenizer.BPETokenizer
	// contains filtered or unexported fields
}

ZeroShotClassifier contains the ModelForSequenceClassification and the Tokenizer used for zero-shot classification tasks.

func LoadZeroShotClassifier

func LoadZeroShotClassifier(modelPath string) (*ZeroShotClassifier, error)

LoadZeroShotClassifier loads a ZeroShotClassifier from a directory.

func (*ZeroShotClassifier) Classify

Classify classifies the input.

func (*ZeroShotClassifier) Close

func (m *ZeroShotClassifier) Close() error

Close finalizes the ZeroShotClassifier resources. It satisfies the interface io.Closer.

Jump to

Keyboard shortcuts

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