Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseExtractor ¶
type BaseExtractor[Opts any, Feature db.Table] struct { // Options to pass via yaml to this step. libconf.JsonOpts[Opts] // Database connection where the datasources are stored. DB *db.DB RecencySeconds int UpdatedAt *time.Time // contains filtered or unexported fields }
Common base for all extractors that provides some functionality that would otherwise be duplicated across all extractors.
func (*BaseExtractor[Opts, F]) ExtractSQL ¶
func (e *BaseExtractor[Opts, F]) ExtractSQL(query string) ([]Feature, error)
Extract the features directly from an sql query.
func (*BaseExtractor[Opts, F]) Extracted ¶
func (e *BaseExtractor[Opts, F]) Extracted(fs []F) ([]Feature, error)
Return the extracted features as a slice of generic features for counting.
func (*BaseExtractor[Opts, Feature]) Init ¶
func (e *BaseExtractor[Opts, Feature]) Init(datasourceDB, extractorDB *db.DB, spec v1alpha1.KnowledgeSpec) error
Init the extractor with the database and options.
type FeatureExtractor ¶
type FeatureExtractor interface {
// Configure the feature extractor with a spec and (optional) databases.
Init(datasourceDB *db.DB, extractorDB *db.DB, spec v1alpha1.KnowledgeSpec) error
// Extract features from the given data.
Extract() ([]Feature, error)
}
Each feature extractor must conform to this interface.
Click to show internal directories.
Click to hide internal directories.