Class LETOROutputFormat
- java.lang.Object
-
- org.terrier.structures.outputformat.LETOROutputFormat
-
- All Implemented Interfaces:
OutputFormat
- Direct Known Subclasses:
Normalised2LETOROutputFormat
,NormalisedLETOROutputFormat
public class LETOROutputFormat extends java.lang.Object implements OutputFormat
Outputs a featured result set in the LETOR format. If the resultset is not featured, then only the score (and docid) are output as features. NB: This class uses Double.toString() to render document scores and feature values, as this canonical output is easier to obtain and more precise than %f without any decimal places noted. Moreover, it will not display unnecessary ending zeros.- Since:
- 4.0
- Author:
- Rodrygo Santos
- See Also:
- http://research.microsoft.com/en-us/um/beijing/projects/letor/
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
display_docids
protected boolean
display_docnos
protected boolean
display_scores
protected boolean
feature_docids
protected int
fOffset
protected java.util.HashSet<java.lang.String>
seenQueries
protected boolean
test
-
Constructor Summary
Constructors Constructor Description LETOROutputFormat(Index index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
printHeader(java.io.PrintWriter pw, FeaturedResultSet rs)
void
printResults(java.io.PrintWriter pw, SearchRequest q, java.lang.String method, java.lang.String iteration, int numberOfResults)
Outputs the results of query q to PrintWriter pw, described by the method, iteration, and the specified limit on the number of results (0 means no limit).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terrier.structures.outputformat.OutputFormat
contentType
-
-
-
-
Field Detail
-
seenQueries
protected java.util.HashSet<java.lang.String> seenQueries
-
test
protected boolean test
-
display_scores
protected boolean display_scores
-
feature_docids
protected boolean feature_docids
-
display_docids
protected boolean display_docids
-
display_docnos
protected boolean display_docnos
-
fOffset
protected int fOffset
-
-
Constructor Detail
-
LETOROutputFormat
public LETOROutputFormat(Index index)
-
-
Method Detail
-
printResults
public void printResults(java.io.PrintWriter pw, SearchRequest q, java.lang.String method, java.lang.String iteration, int numberOfResults) throws java.io.IOException
Description copied from interface:OutputFormat
Outputs the results of query q to PrintWriter pw, described by the method, iteration, and the specified limit on the number of results (0 means no limit).- Specified by:
printResults
in interfaceOutputFormat
- Throws:
java.io.IOException
-
printHeader
protected void printHeader(java.io.PrintWriter pw, FeaturedResultSet rs)
-
-