Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultModel is a BERT pretrained model on English language using a masked language modeling (MLM) objective. // Model card: https://huggingface.co/bert-base-cased DefaultModel = "bert-base-cased" // DefaultItalianModel is a BERT pretrained model on Italian language using a masked language modeling (MLM) objective. // Model card: https://huggingface.co/dbmdz/bert-base-italian-cased DefaultItalianModel = "dbmdz/bert-base-italian-cased" )
Variables ¶
View Source
var ErrInputSequenceTooLong = errors.New("input sequence too long")
ErrInputSequenceTooLong means that pre-processing the input text produced a sequence that exceeds the maximum allowed length.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // Predict returns the prediction of the given example. Predict(ctx context.Context, text string, parameters Parameters) (Response, error) }
Interface defines the main functions for language modelling.
type Parameters ¶
type Parameters struct { // K is the number of returned predictions per token K int }
Parameters contains the parameters for language modeling.
Click to show internal directories.
Click to hide internal directories.