Documentation
¶
Overview ¶
Package analysis provides measurements and analysis tools for queries.
Index ¶
- Variables
- func ConceptMatchReachability(queries []pipeline.Query, protocols guru.Protocols, conceptsBinFile string, ...) (conceptReachabilityMapping map[string][]ConceptReachability, ...)
- func ContainsMeshField(kw cqr.Keyword) bool
- func ExplodedKeywords(r cqr.CommonQueryRepresentation) (exploded []cqr.Keyword)
- func KeywordsWithField(r cqr.CommonQueryRepresentation, f string) (k []cqr.Keyword)
- func MeshExplodedKeywords(r cqr.CommonQueryRepresentation) (exploded []cqr.Keyword)
- func MeshNonExplodedKeywords(r cqr.CommonQueryRepresentation) (exploded []cqr.Keyword)
- func MetaMapScoreDistributions(queries []pipeline.Query, protocols guru.Protocols, client metawrap.HTTPClient) (inQuery map[string][]float64, notInQuery map[string][]float64, err error)
- func QueryBooleanClauseCount(r cqr.CommonQueryRepresentation, operator string) (n int)
- func QueryBooleanClauses(r cqr.CommonQueryRepresentation) (children []cqr.BooleanQuery)
- func QueryBooleanQueries(r cqr.CommonQueryRepresentation) (children []cqr.BooleanQuery)
- func QueryFields(r cqr.CommonQueryRepresentation) (fields []string)
- func QueryFieldsOfField(r cqr.CommonQueryRepresentation, field string) (fields int)
- func QueryKeywords(r cqr.CommonQueryRepresentation) (keywords []cqr.Keyword)
- func QueryTerms(r cqr.CommonQueryRepresentation) (terms []string)
- func TruncatedKeywords(r cqr.CommonQueryRepresentation) (truncated []cqr.Keyword)
- type ConceptReachability
- type DocumentOverlap
- type KeywordReachability
- type Measurement
- type MeasurementCacher
- type MeasurementExecutor
- type MemoryMeasurementCache
- type QueryComplexity
Constants ¶
This section is empty.
Variables ¶
var ( BooleanFields booleanFields BooleanKeywords booleanKeywords BooleanClauses booleanClauses BooleanNonAtomicClauses booleanNonAtomicClauses BooleanTruncated booleanTruncated BooleanFieldsTitle booleanFieldsTitle BooleanFieldsAbstract booleanFieldsAbstract BooleanFieldsMeSH booleanFieldsMeSH BooleanFieldsOther booleanFieldsOther BooleanAndCount booleanAndCount BooleanOrCount booleanOrCount BooleanNotCount booleanNotCount )
var ( MeshKeywordCount = meshKeywordCount{} MeshExplodedCount = meshExplodedCount{} MeshNonExplodedCount = meshNonExplodedCount{} MeshAvgDepth = meshAvgDepth{} MeshMaxDepth = meshMaxDepth{} )
var MeSHTree, _ = meshexp.Default()
var (
// TermCount is a measurement that counts the number of terms in the query.
TermCount = termCount{}
)
Functions ¶
func ContainsMeshField ¶
ContainsMeshField returns if a keyword query contains a mesh heading field.
func ExplodedKeywords ¶
func ExplodedKeywords(r cqr.CommonQueryRepresentation) (exploded []cqr.Keyword)
ExplodedKeywords gets the keywords in the query that are exploded.
func KeywordsWithField ¶
func KeywordsWithField(r cqr.CommonQueryRepresentation, f string) (k []cqr.Keyword)
MeshKeywords extracts all keywords which have a particular field.
func MeshExplodedKeywords ¶
func MeshExplodedKeywords(r cqr.CommonQueryRepresentation) (exploded []cqr.Keyword)
MeshExplodedKeywords extracts all mesh heading keywords that are exploded.
func MeshNonExplodedKeywords ¶
func MeshNonExplodedKeywords(r cqr.CommonQueryRepresentation) (exploded []cqr.Keyword)
MeshExplodedKeywords extracts all mesh heading keywords that are not exploded.
func QueryBooleanClauseCount ¶
func QueryBooleanClauseCount(r cqr.CommonQueryRepresentation, operator string) (n int)
QueryBooleanClauses extracts all of the clauses from a Boolean query, recursively.
func QueryBooleanClauses ¶
func QueryBooleanClauses(r cqr.CommonQueryRepresentation) (children []cqr.BooleanQuery)
QueryBooleanClauses extracts all of the clauses from a Boolean query, recursively.
func QueryBooleanQueries ¶
func QueryBooleanQueries(r cqr.CommonQueryRepresentation) (children []cqr.BooleanQuery)
QueryBooleanQueries extracts all of the sub-queries from a Boolean query, recursively.
func QueryFields ¶
func QueryFields(r cqr.CommonQueryRepresentation) (fields []string)
QueryFields extracts the fields from a query.
func QueryFieldsOfField ¶
func QueryFieldsOfField(r cqr.CommonQueryRepresentation, field string) (fields int)
QueryFields extracts the fields from a query.
func QueryKeywords ¶
func QueryKeywords(r cqr.CommonQueryRepresentation) (keywords []cqr.Keyword)
QueryKeywords extracts the keywords from a query.
func QueryTerms ¶
func QueryTerms(r cqr.CommonQueryRepresentation) (terms []string)
QueryTerms extracts the terms from a query.
func TruncatedKeywords ¶
func TruncatedKeywords(r cqr.CommonQueryRepresentation) (truncated []cqr.Keyword)
TruncatedKeywords gets the keywords in the query that are exploded.
Types ¶
type ConceptReachability ¶
type DocumentOverlap ¶
type DocumentOverlap struct {
// contains filtered or unexported fields
}
DocumentOverlap computes term overlap betweent the document and query.
func NewDocumentOverlapMeasurement ¶
func NewDocumentOverlapMeasurement(document []string) DocumentOverlap
NewDocumentOverlapMeasurement creates an overlap measurement.
func (DocumentOverlap) Execute ¶
func (d DocumentOverlap) Execute(q pipeline.Query, s stats.StatisticsSource) (float64, error)
Execute computes document overlap between query and document.
func (DocumentOverlap) Name ¶
func (DocumentOverlap) Name() string
Name is the name for the document overlap measurement.
type KeywordReachability ¶
type KeywordReachability struct {
Title, Objectives, TypeOfStudy, Participants, IndexTests,
TargetConditions, ReferenceStandards, Concepts int
Topic string
}
func StringMatchReachability ¶
func StringMatchReachability(queries []pipeline.Query, protocols guru.Protocols) []KeywordReachability
type Measurement ¶
type Measurement interface { // Name is the name of the measurement in the output. It should not contain any spaces. Name() string // Execute computes the implemented measurement for a query and optionally using the specified statistics. Execute(q pipeline.Query, s stats.StatisticsSource) (float64, error) }
Measurement is a representation for how a measurement fits into the pipeline.
type MeasurementCacher ¶
type MeasurementCacher interface { Read(key string) ([]byte, error) Write(key string, val []byte) error }
MeasurementCacher is a cache that can store the measurements for queries.
type MeasurementExecutor ¶
type MeasurementExecutor struct {
// contains filtered or unexported fields
}
MeasurementExecutor executes measurements while caching the results to improve performance.
func NewDiskMeasurementExecutor ¶
func NewDiskMeasurementExecutor(d *diskv.Diskv) MeasurementExecutor
NewDiskMeasurementExecutor creates a measurement executor that caches to disk.
func NewMemoryMeasurementExecutor ¶
func NewMemoryMeasurementExecutor() MeasurementExecutor
NewMemoryMeasurementExecutor creates a measurement executor that caches to memory.
func (MeasurementExecutor) Execute ¶
func (m MeasurementExecutor) Execute(query pipeline.Query, ss stats.StatisticsSource, measurements ...Measurement) ([]float64, error)
Execute executes the specified measurements on the query using the statistics source.
type MemoryMeasurementCache ¶
MemoryMeasurementCache caches measurement results in memory.
type QueryComplexity ¶
type QueryComplexity struct{}
QueryComplexity is a measure of how "complex" a Boolean query is. It takes into account the number of keywords and Boolean queries in each of the top-level sub-contexts, with relation to the number of sub-contexts, and the size of the context (or query as a whole).
func (QueryComplexity) Execute ¶
func (qc QueryComplexity) Execute(q cqr.CommonQueryRepresentation, s stats.StatisticsSource) (float64, error)
Execute computes query complexity.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package postqpp implements post-retrieval query performance predictors, reproducing the Java API from https://github.com/lucene4ir/lucene4ir (where applicable)
|
Package postqpp implements post-retrieval query performance predictors, reproducing the Java API from https://github.com/lucene4ir/lucene4ir (where applicable) |
Package preqpp implements pre-retrieval query performance predictors, reproducing the Java API from https://github.com/lucene4ir/lucene4ir (where applicable)
|
Package preqpp implements pre-retrieval query performance predictors, reproducing the Java API from https://github.com/lucene4ir/lucene4ir (where applicable) |
Package probability provides abstractions for how to compute how precision and recall is affected by measurements.
|
Package probability provides abstractions for how to compute how precision and recall is affected by measurements. |