|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iglu.ir.PrecisionRecall
A class that performs Precision/Recall testing. Returns results consistent with _Modern_Information_Retrieval_ by Baeza-Yates and Ribeiro-Neto, chapter 3. You pass it a DocumentSet, a set of queries, and a mapping from query to document, and a VectorCreator for indexing. The class will then conduct an indexing/querying activity to determing the precision/recall characteristics achieved by using the given vector creator.
This class creates vectors for the documents, put them into the SearchEngine, runs the queries, and produces precision/recall information. It's designed to compare vector creators, but it can also be used to experiment with results generated by changing any of the above.
By default it uses the Ryan Scherle's RAMSearchEngine. However, this is only good for small document sets. For larger document sets, you should create your own search engine and pass it it.
Field Summary | |
(package private) IRPacket |
irPacket
|
(package private) boolean |
noisy
|
(package private) SearchEngine |
searchEngine
|
(package private) VectorCreator |
vc
|
Constructor Summary | |
PrecisionRecall(IRPacket irPacket,
VectorCreator vc,
boolean index)
Create a new PrecisionRecall object, using the RAMSearchEngine. |
|
PrecisionRecall(SearchEngine searchEngine,
IRPacket irPacket)
|
|
PrecisionRecall(SearchEngine searchEngine,
IRPacket irPacket,
VectorCreator vc,
boolean index)
|
Method Summary | |
protected void |
loadSearchEngine()
Index the documents, insering them into the database |
static void |
main(java.lang.String[] argv)
A simple test of the PrecisionRecall class |
int[] |
relatedDocs(int docNum)
Find all the documents related to the given document. |
void |
setNoisy(boolean n)
Whether or not this class should print out its progress while running. |
PRResult[] |
testDocs(int[] docNums)
Create vectors for the indicated documents in the document set and run those vectors as queries, returning results. |
PRResult[] |
testQueries()
Test all the queries named in the constructor. |
PRResult |
testQuery(int queryID)
Test a given query. |
protected PRResult |
testVector(TermVector v,
int[] goodDocs,
java.io.Serializable qid)
Test a vector, assuming that goodDocs contain references to the relevant documents in the document set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
IRPacket irPacket
SearchEngine searchEngine
VectorCreator vc
boolean noisy
Constructor Detail |
public PrecisionRecall(IRPacket irPacket, VectorCreator vc, boolean index)
vc
- A vector creator for indexing documents.index
- Whether or not to index and add docs to the database.
This should normally be true, except in situations where you have
persistent serach engines, have already indexed the data, and just
want to run the queries.public PrecisionRecall(SearchEngine searchEngine, IRPacket irPacket, VectorCreator vc, boolean index)
public PrecisionRecall(SearchEngine searchEngine, IRPacket irPacket)
Method Detail |
protected void loadSearchEngine()
public PRResult testQuery(int queryID)
queryID
is an index into queries
protected PRResult testVector(TermVector v, int[] goodDocs, java.io.Serializable qid)
public PRResult[] testQueries()
public PRResult[] testDocs(int[] docNums)
public int[] relatedDocs(int docNum)
docNum
matches as well.
public void setNoisy(boolean n)
public static void main(java.lang.String[] argv)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |