Class TrecJudge
Judge if given document is relevant to given quality query, based on Trec format for judgements.
Implements
Inherited Members
Namespace: Lucene.Net.Benchmarks.Quality.Trec
Assembly: Lucene.Net.Benchmark.dll
Syntax
public class TrecJudge : IJudge
Constructors
TrecJudge(TextReader)
Constructor from a reader.
Declaration
public TrecJudge(TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
TextReader | reader | Where judgments are read from. |
Remarks
Expected input format:
qnum 0 doc-name is-relevant
Two sample lines:
19 0 doc303 1
19 0 doc7295 0
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error. |
Methods
IsRelevant(string, QualityQuery)
Judge if document docName
is relevant for the given quality query.
Declaration
public virtual bool IsRelevant(string docName, QualityQuery query)
Parameters
Type | Name | Description |
---|---|---|
string | docName | Name of doc tested for relevancy. |
QualityQuery | query | Tested quality query. |
Returns
Type | Description |
---|---|
bool |
|
MaxRecall(QualityQuery)
Return the maximal recall for the input quality query. It is the number of relevant docs this IJudge "knows" for the query.
Declaration
public virtual int MaxRecall(QualityQuery query)
Parameters
Type | Name | Description |
---|---|---|
QualityQuery | query | The query whose maximal recall is needed. |
Returns
Type | Description |
---|---|
int |
ValidateData(QualityQuery[], TextWriter)
Validate that queries and this IJudge match each other. To be perfectly valid, this Judge must have some data for each and every input quality query, and must not have any data on any other quality query. Note: the quality benchmark run would not fail in case of imperfect validity, just a warning message would be logged.
Declaration
public virtual bool ValidateData(QualityQuery[] qq, TextWriter logger)
Parameters
Type | Name | Description |
---|---|---|
QualityQuery[] | Quality queries to be validated. |
|
TextWriter | logger | If not |
Returns
Type | Description |
---|---|
bool |
|