Documentation
¶
Index ¶
- type Model
- func (m *Model) Close() error
- func (m *Model) Compute(sentence string, addSpecialTokens bool) ([]float32, error)
- func (m *Model) ComputeBatch(sentences []string, addSpecialTokens bool) ([][]float32, error)
- func (m *Model) ComputeBatchFromEncodings(encodings []tokenizer.Encoding) ([][]float32, error)
- func (m *Model) ComputeFromEncoding(encoding tokenizer.Encoding) ([]float32, error)
- func (m *Model) EncodeDocument(documents []string) ([][]float32, error)
- func (m *Model) EncodeQuery(queries []string) ([][]float32, error)
- func (m *Model) Similarity(queryEmbeddings [][]float32, docEmbeddings [][]float32) [][]float32
- type ModelOption
- type Tokenizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModel ¶
func NewModel(opts ...ModelOption) (*Model, error)
func (*Model) ComputeBatch ¶
func (*Model) ComputeBatchFromEncodings ¶
func (*Model) ComputeFromEncoding ¶
func (*Model) EncodeDocument ¶
EncodeDocument encodes documents using SPLADE
func (*Model) EncodeQuery ¶
EncodeQuery encodes queries using SPLADE
type ModelOption ¶
type ModelOption = func(*Model)
func WithRuntimePath ¶
func WithRuntimePath(path string) ModelOption
type Tokenizer ¶
type Tokenizer struct {
// contains filtered or unexported fields
}
func NewTokenizer ¶
Click to show internal directories.
Click to hide internal directories.