Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TextClassification ¶
type TextClassification struct {
// Model is the model used to answer questions.
Model *bert.ModelForSequenceClassification
// Tokenizer is the tokenizer used to tokenize questions and passages.
Tokenizer *wordpiecetokenizer.WordPieceTokenizer
// Labels is the list of labels used for classification.
Labels []string
// contains filtered or unexported fields
}
TextClassification is a text classification model.
func LoadTextClassification ¶
func LoadTextClassification(modelPath string) (*TextClassification, error)
LoadTextClassification returns a TextClassification loading the model, the embeddings and the tokenizer from a directory.
func (*TextClassification) Classify ¶
func (m *TextClassification) Classify(_ context.Context, text string) (textclassification.Response, error)
Classify returns the classification of the given text.
Click to show internal directories.
Click to hide internal directories.