textencoding

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2022 License: BSD-2-Clause Imports: 2 Imported by: 60 modules, 56 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DefaultModel is a sentence-transformers model:
	// It maps sentences & paragraphs to dense vector space and can be used for tasks like clustering or semantic search.
	// Model card: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2
	DefaultModel = "sentence-transformers/all-MiniLM-L6-v2"

	// DefaultModelMulti it's like the model before but multilingual:
	// it can be used to map 109 languages to a shared vector space.
	// It works well for finding translation pairs in multiple languages.
	// It doesn't perform so well for assessing the similarity of sentence pairs that are not translations of each other.
	// Model card: https://huggingface.co/sentence-transformers/LaBSE
	DefaultModelMulti = "sentence-transformers/LaBSE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Encode returns the encoded representation of the given example.
	Encode(ctx context.Context, text string, poolingStrategy int) (Response, error)
}

Interface defines the main functions for text encoding task.

type Response

type Response struct {
	// the encoded representation
	Vector mat.Matrix
}

Response contains the response from text classification.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL