bert

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexScorePair

type IndexScorePair struct {
	Index int
	Score float64
}

type LanguageModel

type LanguageModel struct {
	// Model is the model used to answer questions.
	Model *bert.ModelForMaskedLM

	// Tokenizer is the tokenizer used to tokenize questions and passages.
	Tokenizer *wordpiecetokenizer.WordPieceTokenizer
	// contains filtered or unexported fields
}

LanguageModel is a masked language model.

func LoadMaskedLanguageModel

func LoadMaskedLanguageModel(modelPath string) (*LanguageModel, error)

LoadMaskedLanguageModel returns a LanguageModel loading the model, the embeddings and the tokenizer from a directory.

func (*LanguageModel) Predict

Predict returns the predicted tokens

Jump to

Keyboard shortcuts

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