This is an implementation of the positional relevance model for automatic query expansion. Please refer to the following references for the derivation of the algorithm:
 Yuanhua Lv and ChengXiang Zhai. "Positional Relevance Model for Pseudo-Relevance Feedback". In Proceedings of the 33rd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR'10), pages 579-586, 2010.
 Yuanhua Lv and ChengXiang Zhai. "Positional Language Models for Information Retrieval". In Proceedings of the 32nd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR'09), pages 299-306, 2009.
The algorithm is implemented in C++ and works with the Lemur toolkit and Indri search engine. The algorithm has only been tested on Lemur 4.10 in a Linux environment, where the index is in an indri format built using the IndriBuildIndex application. The current version of the algorithm only supports bag-of-word queries and does not accept Indri's complex query languages.
A sample query file is shown below:
<text>falkland petroleum exploration</text>
<text>british chunnel impact</text>
(Please note that you do not need to stem or remove stopwords from query terms, as Indri will do it automatically.)
Instructions for using the algorithms are as follows:
0. Download and uncompress the Lemur toolkit.
1. Copy PositionalRelevanceModell.cpp, QueryEnvironment.cpp, and RMExpander.cpp to ../lemur/retrieval/src/
(note that the original QueryEnvironment.cpp and RMExpander.cpp will be replaced)
2. Copy PositionalRelevanceModel.hpp and QueryEnvironment.hpp to ../lemur/retrieval/include/indri/
(note that the original QueryEnvironment.hpp will be replaced)
3. Go to ../lemur/ to compile and install the modified Lemur toolkit. See http://sourceforge.net/apps/trac/lemur/wiki/Compiling and Installing on Linux and Mac OS X for more details regarding compiling and installing Lemur toolkit.
4. Copy demon.cpp file to some place and compile it
5. Modify the prm.param file to adapt it to your parameter setting, e.g., change index, query file, result file, etc.
6. Run the positional relevance feedback algorithm: ./demo prm.param
If you have more questions, please email me (Yuanhua Lv, firstname.lastname@example.org)