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 ¶
func (m *ZeroShotClassifier) Classify(_ context.Context, text string, parameters zeroshotclassifier.Parameters) (zeroshotclassifier.Response, error)
Classify classifies the input.
func (*ZeroShotClassifier) Close ¶
func (m *ZeroShotClassifier) Close() error
Close finalizes the ZeroShotClassifier resources. It satisfies the interface io.Closer.
Click to show internal directories.
Click to hide internal directories.