Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexScorePair ¶
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 ¶
func (m *LanguageModel) Predict(_ context.Context, text string, parameters languagemodeling.Parameters) (languagemodeling.Response, error)
Predict returns the predicted tokens
Click to show internal directories.
Click to hide internal directories.