zsc

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BartForZeroShotClassification

type BartForZeroShotClassification struct {
	*sequenceclassification.Model
	Tokenizer *bpetokenizer.BPETokenizer
}

BartForZeroShotClassification combines a sequence classification BART model with a BPE tokenizer to perform Zero-Shot Text Classification.

func LoadModel

func LoadModel(modelPath string) (*BartForZeroShotClassification, error)

LoadModel loads a BartForZeroShotClassification from file.

func (*BartForZeroShotClassification) Classify

func (t *BartForZeroShotClassification) Classify(
	text string,
	hypothesisTemplate string,
	candidateLabels []string,
	multiClass bool,
) (*tasks.ClassifyResponse, error)

Classify performs a text classification using the zero-shot technique.

Jump to

Keyboard shortcuts

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