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: 15 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
}

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) ExtractAnswer added in v0.2.1

func (qa *QuestionAnswering) ExtractAnswer(_ context.Context, question string, passage string, opts *questionanswering.Options) (questionanswering.Response, error)

ExtractAnswer 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