strategy

package
v0.0.0-...-05931ac Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

README

Strategy Module

Strategy is responsible of executing the correct recomendation procedure given an initial input assessment.

The main element, the Workflow, is an ordered list of (Condition,Procedure) pairs. It will run through all entries in order, and the first Condition that holds true will trigger the execution of the Procedure. This Procedure produces the final recommendation and only a single Procedure will be triggered per request.

It is possible to customize their own strategy via code, or use one of the preset strategies.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition func(*assessment.Instance) bool

Condition : Evaluates is a given strategy entry should run.

func MakeAboveThresholdCondition

func MakeAboveThresholdCondition(threshold int) Condition

Not needed anylonger Helper method to create the above-threshold condition.

func MakeAlwaysCondition

func MakeAlwaysCondition() Condition

Helper method to create a condition that always evaluates to true.

func MakeBelowThresholdCondition

func MakeBelowThresholdCondition(threshold int) Condition

func MakeTooFewRecommendationsCondition

func MakeTooFewRecommendationsCondition(threshold int) Condition

Helper Method to create too-few-recommendations-condition: When the standard recommender returns less than count many recommendations the condition is true, else false

func MakeTooManyRecommendationsCondition

func MakeTooManyRecommendationsCondition(threshold int) Condition

Not needed anylonger Helper Method to create too-many-recommendations-condition: When the standard recommender returns more than count many recommendations the condition is true, else false

func MakeTooUnlikelyRecommendationsCondition

func MakeTooUnlikelyRecommendationsCondition(threshold float32) Condition

Helper Method to create too-unlikely-recommendations-condition: When the standard recommender returns a recommendation where the top 10 has lower probability than threshhold (in decimal percentage eg 0.5)

type Procedure

Procedure : Procedure to run as a strategy entry.

func MakeAssessmentAwareDirectProcedure

func MakeAssessmentAwareDirectProcedure() Procedure

Helper method to create the direct SchemaTree procedure call.

func MakeDeleteLowFrequencyProcedure

func MakeDeleteLowFrequencyProcedure(tree *schematree.SchemaTree, parExecs int, stepsize backoff.StepsizeFunc, condition backoff.InternalCondition) Procedure

Helper method to create the 'deletelowfrequency' backoff procedure.

func MakeSplitPropertyProcedure

func MakeSplitPropertyProcedure(tree *schematree.SchemaTree, splitter backoff.SplitterFunc, merger backoff.MergerFunc) Procedure

Helper method to create the 'splitproperty' backoff procedure.

func MakeWikidataRecommender

func MakeWikidataRecommender(useTypes, useProperties bool) Procedure

Helper method to create Recommenders using the wikidata recommender

type Workflow

type Workflow []entry

Workflow : Workflow to execute in order to get best recommendation given the input.

func MakePresetWorkflow

func MakePresetWorkflow(name string, tree *schematree.SchemaTree) *Workflow

MakePresetWorkflow : Build a preset strategy that is hard-coded.

func (*Workflow) Push

func (wf *Workflow) Push(cond Condition, proc Procedure, desc string)

Push : Add a new strategy entry with less priority than all other existing entries.

func (*Workflow) Recommend

Recommend : Run the workflow and return the recommended properties. Go through the workflow and execute the first procedure that has a valid condition. That procedure will return the list of recommended properties.

Jump to

Keyboard shortcuts

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