experimental

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassificationModel

type ClassificationModel struct {
	// contains filtered or unexported fields
}

A model that returns classification results for a list of text strings.

NOTE: This model interface is experimental and may change in the future. It is primarily intended for use with with classification models hosted on Hypermode.

func (*ClassificationModel) CreateInput

func (m *ClassificationModel) CreateInput(content ...string) (*ClassificationModelInput, error)

Creates an input object for the classification model.

The content parameter is a list of one or more text strings to classify.

type ClassificationModelInput

type ClassificationModelInput struct {

	// A list of one or more text strings to classify.
	Instances []string `json:"instances"`
}

The input object for the classification model.

type ClassificationModelOutput

type ClassificationModelOutput struct {

	// A list of prediction results that correspond to each input text string.
	Predictions []ClassifierResult `json:"predictions"`
}

The output object for the classification model.

type ClassifierLabel

type ClassifierLabel struct {

	// The classification label.
	Label string `json:"label"`

	// The probability value.
	Probability float32 `json:"probability"`
}

A classification label with its corresponding probability.

type ClassifierResult

type ClassifierResult struct {

	// The classification label with the highest confidence.
	Label string `json:"label"`

	// The confidence score for the classification label.
	Confidence float32 `json:"confidence"`

	// The list of all classification labels with their corresponding probabilities.
	Probabilities []ClassifierLabel `json:"probabilities"`
}

A classification result for a single text string.

type EmbeddingsModel

type EmbeddingsModel struct {
	// contains filtered or unexported fields
}

A model that returns embeddings for a list of text strings.

NOTE: This model interface is experimental and may change in the future. It is primarily intended for use with with embedding models hosted on Hypermode.

func (*EmbeddingsModel) CreateInput

func (m *EmbeddingsModel) CreateInput(content ...string) (*EmbeddingsModelInput, error)

Creates an input object for the embeddings model.

The content parameter is a list of one or more text strings to create vector embeddings for.

type EmbeddingsModelInput

type EmbeddingsModelInput struct {

	// A list of one or more text strings to create vector embeddings for.
	Instances []string `json:"instances"`
}

The input object for the embeddings model.

type EmbeddingsModelOutput

type EmbeddingsModelOutput struct {

	// A list of vector embeddings that correspond to each input text string.
	Predictions [][]float32 `json:"predictions"`
}

The output object for the embeddings model.

Jump to

Keyboard shortcuts

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