bert

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: BSD-2-Clause Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

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