Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TextEncoding ¶
type TextEncoding struct { // Model is the model used to answer questions. Model *bert.ModelForSequenceEncoding // Tokenizer is the tokenizer used to tokenize questions and passages. Tokenizer *wordpiecetokenizer.WordPieceTokenizer // contains filtered or unexported fields }
TextEncoding is a text encoding model.
func LoadTextEncoding ¶
func LoadTextEncoding(modelPath string) (*TextEncoding, error)
LoadTextEncoding returns a TextEncoding loading the model, the embeddings and the tokenizer from a directory.
func (*TextEncoding) Encode ¶
func (m *TextEncoding) Encode(_ context.Context, text string, poolingStrategy int) (textencoding.Response, error)
Encode returns the dense encoded representation of the given text.
Click to show internal directories.
Click to hide internal directories.