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 ¶
func (qa *QuestionAnswering) Answer(_ context.Context, question string, passage string, opts *questionanswering.Options) (questionanswering.Response, error)
Answer returns the answers for the given question and passage. The options may assume default values if those are not set.
Click to show internal directories.
Click to hide internal directories.