bert

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuestionAnswering

type QuestionAnswering struct {
	// Model is the model used to answer questions.
	Model *bert.ModelForQuestionAnswering
	// Tokenizer is the tokenizer used to tokenize questions and passages.
	Tokenizer *wordpiecetokenizer.WordPieceTokenizer
	// contains filtered or unexported fields
}

QuestionAnswering is a QuestionAnswering model.

func LoadQuestionAnswering

func LoadQuestionAnswering(modelPath string) (*QuestionAnswering, error)

LoadQuestionAnswering returns a QuestionAnswering loading the model, the embeddings and the tokenizer from a directory.

func (*QuestionAnswering) Answer

Answer returns the answers for the given question and passage. The options may assume default values if those are not set.

Jump to

Keyboard shortcuts

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