Documentation ¶
Index ¶
- Constants
- func UnmarshalTransaction(txType cluster.TransactionType, payload json.RawMessage) (interface{}, error)
- type Classifier
- type ClassifyItemFn
- type Filters
- type ModulesProvider
- type NeighborRef
- type NeighborRefDistances
- type ParamsKNN
- type Repo
- type TransactionPutPayload
- type Validator
- type VectorRepo
- type Writer
- type WriterResults
Constants ¶
View Source
const ( TypeKNN = "knn" TypeContextual = "text2vec-contextionary-contextual" TypeZeroShot = "zeroshot" )
View Source
const TransactionPut cluster.TransactionType = "put_single"
Variables ¶
This section is empty.
Functions ¶
func UnmarshalTransaction ¶
func UnmarshalTransaction(txType cluster.TransactionType, payload json.RawMessage, ) (interface{}, error)
Types ¶
type Classifier ¶
type Classifier struct {
// contains filtered or unexported fields
}
func New ¶
func New(sg schemaUC.SchemaGetter, cr Repo, vr vectorRepo, authorizer authorizer, logger logrus.FieldLogger, modulesProvider ModulesProvider, ) *Classifier
func (*Classifier) Get ¶
func (c *Classifier) Get(ctx context.Context, principal *models.Principal, id strfmt.UUID) (*models.Classification, error)
func (*Classifier) Schedule ¶
func (c *Classifier) Schedule(ctx context.Context, principal *models.Principal, params models.Classification) (*models.Classification, error)
type ClassifyItemFn ¶
type Filters ¶
type Filters interface { Source() *libfilters.LocalFilter Target() *libfilters.LocalFilter TrainingSet() *libfilters.LocalFilter }
type ModulesProvider ¶
type ModulesProvider interface { ParseClassifierSettings(name string, params *models.Classification) error GetClassificationFn(className, name string, params modulecapabilities.ClassifyParams) (modulecapabilities.ClassifyItemFn, error) }
type NeighborRef ¶
type NeighborRef struct { // Property indicates which property was aggregated Property string // The beacon of the most common (kNN) reference Beacon strfmt.URI OverallCount int WinningCount int LosingCount int Distances NeighborRefDistances }
NeighborRef is the result of an aggregation of the ref properties of k neighbors
func (NeighborRef) Meta ¶
func (r NeighborRef) Meta() *models.ReferenceMetaClassification
type NeighborRefDistances ¶
type NeighborRefDistances struct { ClosestOverallDistance float32 // Winning ClosestWinningDistance float32 MeanWinningDistance float32 // Losing (optional) MeanLosingDistance *float32 ClosestLosingDistance *float32 }
NeighborRefDistances include various distances about the winning and losing groups (knn)
type ParamsKNN ¶
type ParamsKNN struct {
K *int32 `json:"k"`
}
func (*ParamsKNN) SetDefaults ¶
func (params *ParamsKNN) SetDefaults()
type Repo ¶
type Repo interface { Put(ctx context.Context, classification models.Classification) error Get(ctx context.Context, id strfmt.UUID) (*models.Classification, error) }
Repo to manage classification state, should be consistent, not used to store actual data object vectors, see VectorRepo
type TransactionPutPayload ¶
type TransactionPutPayload struct {
Classification models.Classification `json:"classification"`
}
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator(sg schemaUC.SchemaGetter, subject models.Classification) *Validator
type VectorRepo ¶
type VectorRepo interface { GetUnclassified(ctx context.Context, class string, properties []string, filter *libfilters.LocalFilter) ([]search.Result, error) AggregateNeighbors(ctx context.Context, vector []float32, class string, properties []string, k int, filter *libfilters.LocalFilter) ([]NeighborRef, error) VectorSearch(ctx context.Context, params dto.GetParams) ([]search.Result, error) ZeroShotSearch(ctx context.Context, vector []float32, class string, properties []string, filter *libfilters.LocalFilter) ([]search.Result, error) }
type Writer ¶
type Writer interface { Start() Store(item search.Result) error Stop() WriterResults }
type WriterResults ¶
Click to show internal directories.
Click to hide internal directories.