Documentation ¶
Index ¶
- func IdempotentID(created time.Time, query string) string
- type BestMatches
- func (bm *BestMatches) At(idx int) MatchItem
- func (bm *BestMatches) AvgBenchTime() float64
- func (bm *BestMatches) Items() []MatchItem
- func (bm *BestMatches) Print()
- func (bm *BestMatches) SmartBenchTime() float64
- func (bm *BestMatches) TryAdd(rec *DBRecord, dist int) bool
- func (bm *BestMatches) WorstBenchTime() float64
- type DBRecord
- type Database
- func (database *Database) AddBenchmarkResult(id string, dur time.Duration) error
- func (database *Database) AddRecord(rec DBRecord) (int64, error)
- func (database *Database) CommitTx() error
- func (database *Database) CreateNewTraining(threshold float64) (int, error)
- func (database *Database) GetAllRecords(filter ListFilter) ([]DBRecord, error)
- func (database *Database) GetCorpusSize(corpname string) int
- func (database *Database) GetCzechBenchmarkedRecords() ([]DBRecord, error)
- func (database *Database) GetLatestTrainingID() (int, error)
- func (database *Database) GetQueryAvgBenchTime(q string) (float64, error)
- func (database *Database) GetTrainingData(trainingId int) ([]DBRecord, error)
- func (database *Database) GetTrainingThreshold(trainingId int) (float64, error)
- func (database *Database) GetTrainingValidationData(trainingID int) ([]TrainingResult, error)
- func (database *Database) ImportCorpusSizesFromCSV(path string) error
- func (database *Database) Init() error
- func (database *Database) MixBiasedTrainingList(threshold float64, ratioOfTrues float64, syn2020Compat bool) ([]DBRecord, error)
- func (database *Database) RollbackTx() error
- func (database *Database) SetTrainingQuery(training_id int, qid string) error
- func (database *Database) SetValidationQuery(training_id int, qid string, result bool) error
- func (database *Database) StartTx() error
- func (database *Database) UpdateRecord(rec DBRecord) error
- type ListFilter
- type MatchItem
- type TrainingResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BestMatches ¶ added in v0.0.2
type BestMatches struct {
// contains filtered or unexported fields
}
func NewBestMatches ¶ added in v0.0.2
func NewBestMatches(size int) *BestMatches
func (*BestMatches) At ¶ added in v0.0.2
func (bm *BestMatches) At(idx int) MatchItem
func (*BestMatches) AvgBenchTime ¶ added in v0.0.2
func (bm *BestMatches) AvgBenchTime() float64
func (*BestMatches) Items ¶ added in v0.0.2
func (bm *BestMatches) Items() []MatchItem
func (*BestMatches) Print ¶ added in v0.0.2
func (bm *BestMatches) Print()
func (*BestMatches) SmartBenchTime ¶ added in v0.0.2
func (bm *BestMatches) SmartBenchTime() float64
func (*BestMatches) TryAdd ¶ added in v0.0.2
func (bm *BestMatches) TryAdd(rec *DBRecord, dist int) bool
func (*BestMatches) WorstBenchTime ¶ added in v0.0.2
func (bm *BestMatches) WorstBenchTime() float64
type DBRecord ¶ added in v0.0.2
type DBRecord struct { // ID is a idempotent identifier derived from other attributes // (typically date and query). // Please note that the value should not be derived just from // the query because we want some variance with repeated queries. // (with a single query try, the result can be affected by (bad)luck). ID string // Datetime specifies date and time when the record was imported // (i.e. not benchmarked) Datetime int64 // Query contains the original version of imported query Query string // QueryNormalized contains the original version of imported query QueryNormalized string // Corpname is the original corpus query was run with Corpname string // ProcTime is a procTime reported by KonText in its log. // Please note that this time cannot be reliably used to measure // queries complexity as most KonText queries run in an async. // mode and the query_submit response may occur even if there are // no data yet. // We store this for further analysis - e.g. if there is at least // some correlation between those times and benchmark times. ProcTime float64 // BenchTime is a time of a query measured in a controlled environment. // This means running it on MQuery on a computer not doing much other // work. BenchTime float64 // TrainingExclude excluded the record from training. Typically, this // is for additional validation of the model. TrainingExclude bool }
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func (*Database) AddBenchmarkResult ¶ added in v0.0.2
func (*Database) CreateNewTraining ¶ added in v0.0.2
func (*Database) GetAllRecords ¶ added in v0.0.2
func (database *Database) GetAllRecords(filter ListFilter) ([]DBRecord, error)
GetAllRecords loads stats records containing imported queries with their benchmark times (if already benchmarked).
func (*Database) GetCorpusSize ¶ added in v0.0.2
func (*Database) GetCzechBenchmarkedRecords ¶ added in v0.0.2
func (*Database) GetLatestTrainingID ¶ added in v0.0.2
func (*Database) GetQueryAvgBenchTime ¶ added in v0.0.2
func (*Database) GetTrainingData ¶ added in v0.0.2
func (*Database) GetTrainingThreshold ¶ added in v0.0.2
func (*Database) GetTrainingValidationData ¶ added in v0.0.2
func (database *Database) GetTrainingValidationData(trainingID int) ([]TrainingResult, error)
func (*Database) ImportCorpusSizesFromCSV ¶ added in v0.0.2
func (*Database) MixBiasedTrainingList ¶ added in v0.0.2
func (*Database) RollbackTx ¶ added in v0.0.2
func (*Database) SetTrainingQuery ¶ added in v0.0.2
func (*Database) SetValidationQuery ¶ added in v0.0.2
func (*Database) UpdateRecord ¶ added in v0.0.2
type ListFilter ¶ added in v0.0.2
type ListFilter struct { Benchmarked *bool TrainingExcluded *bool WithNormalizedQuery *bool AnyCorpus *bool }
func (ListFilter) SetAnyCorpus ¶ added in v0.0.2
func (filter ListFilter) SetAnyCorpus(v bool) ListFilter
func (ListFilter) SetBenchmarked ¶ added in v0.0.2
func (filter ListFilter) SetBenchmarked(v bool) ListFilter
func (ListFilter) SetTrainingExcluded ¶ added in v0.0.2
func (filter ListFilter) SetTrainingExcluded(v bool) ListFilter
func (ListFilter) SetWithNormalizedQuery ¶ added in v0.0.2
func (filter ListFilter) SetWithNormalizedQuery(v bool) ListFilter
Click to show internal directories.
Click to hide internal directories.