Documentation ¶
Index ¶
- func NewIndexChecker(cfg moduletools.ClassConfig) *indexChecker
- type ClassIndexCheck
- type ConfigValidator
- type ErrNoUsableWords
- type IndexChecker
- type Inspector
- type InspectorClient
- type NoOpVectorizer
- func (n *NoOpVectorizer) Corpi(ctx context.Context, corpi []string) ([]float32, error)
- func (n *NoOpVectorizer) MoveAwayFrom(source []float32, target []float32, weight float32) ([]float32, error)
- func (n *NoOpVectorizer) MoveTo(source []float32, target []float32, weight float32) ([]float32, error)
- func (n *NoOpVectorizer) NormalizedDistance(a, b []float32) (float32, error)
- func (n *NoOpVectorizer) Object(ctx context.Context, concept *models.Object) ([]float32, error)
- type RemoteClient
- type Vectorizer
- func (v *Vectorizer) Corpi(ctx context.Context, corpi []string) ([]float32, error)
- func (v *Vectorizer) Object(ctx context.Context, object *models.Object, cfg moduletools.ClassConfig) ([]float32, models.AdditionalProperties, error)
- func (v *Vectorizer) Texts(ctx context.Context, inputs []string, cfg moduletools.ClassConfig) ([]float32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIndexChecker ¶
func NewIndexChecker(cfg moduletools.ClassConfig) *indexChecker
Types ¶
type ClassIndexCheck ¶
type ClassIndexCheck interface { PropertyIndexed(property string) bool VectorizeClassName() bool VectorizePropertyName(propertyName string) bool }
IndexCheck returns whether a property of a class should be indexed
type ConfigValidator ¶
type ConfigValidator struct {
// contains filtered or unexported fields
}
func NewConfigValidator ¶
func NewConfigValidator(rc RemoteClient, logger logrus.FieldLogger, ) *ConfigValidator
func (*ConfigValidator) Do ¶
func (cv *ConfigValidator) Do(ctx context.Context, class *models.Class, cfg moduletools.ClassConfig, icheck IndexChecker, ) error
type ErrNoUsableWords ¶
type ErrNoUsableWords struct {
Err error
}
func NewErrNoUsableWordsf ¶
func NewErrNoUsableWordsf(pattern string, args ...interface{}) ErrNoUsableWords
func (ErrNoUsableWords) Error ¶
func (e ErrNoUsableWords) Error() string
type IndexChecker ¶
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
func NewInspector ¶
func NewInspector(client InspectorClient) *Inspector
type InspectorClient ¶
type InspectorClient interface { VectorForWord(ctx context.Context, word string) ([]float32, error) VectorForCorpi(ctx context.Context, words []string, overrides map[string]string) ([]float32, []txt2vecmodels.InterpretationSource, error) NearestWordsByVector(ctx context.Context, vector []float32, n int, k int) ([]string, []float32, error) IsWordPresent(ctx context.Context, word string) (bool, error) }
type NoOpVectorizer ¶
type NoOpVectorizer struct{}
NoOpVectorizer is a simple stand in that does nothing. Can be used when the feature should be turned off overall
func NewNoOp ¶
func NewNoOp() *NoOpVectorizer
NewNoOp creates a new NoOpVectorizer which can be used when no vectorization is desired, i.e. the feature is turned off completely
func (*NoOpVectorizer) MoveAwayFrom ¶
func (n *NoOpVectorizer) MoveAwayFrom(source []float32, target []float32, weight float32) ([]float32, error)
MoveAwayFrom is not implemented in the NoOpVectorizer
func (*NoOpVectorizer) MoveTo ¶
func (n *NoOpVectorizer) MoveTo(source []float32, target []float32, weight float32) ([]float32, error)
MoveTo is not implemented in the NoOpVectorizer
func (*NoOpVectorizer) NormalizedDistance ¶
func (n *NoOpVectorizer) NormalizedDistance(a, b []float32) (float32, error)
NormalizedDistance is not implemented in the NoOpVectorizer
type RemoteClient ¶
type Vectorizer ¶
type Vectorizer struct {
// contains filtered or unexported fields
}
Vectorizer turns objects into vectors
func (*Vectorizer) Corpi ¶
Corpi takes any list of strings and builds a common vector for all of them
func (*Vectorizer) Object ¶
func (v *Vectorizer) Object(ctx context.Context, object *models.Object, cfg moduletools.ClassConfig, ) ([]float32, models.AdditionalProperties, error)
Object object to vector
func (*Vectorizer) Texts ¶ added in v1.23.3
func (v *Vectorizer) Texts(ctx context.Context, inputs []string, cfg moduletools.ClassConfig, ) ([]float32, error)
Click to show internal directories.
Click to hide internal directories.