Service for (re)ranking documents.
Reranking is the process in which a relatively small number of (say a thousand) documents are ranked in order of their relevance to a query. The small number of documents are typically obtained by a coarse but fast searching technique from a large corpus. Reranking techniques are more accurate in terms of relevance judgement but not scalable for millions of documents.
For more detailed information, please refer to PQAI Wiki.
Method | Endpoint | Comments |
---|---|---|
POST |
/rerank |
Sort given documents w.r.t. their relevance to a given query |
POST |
/score |
Return a similarity score for a query/doc pair |
- Clone this repository
- Download required assets and extract them to
/assets
directory - Create a
.env
file using/env
template and set environment variable values - Create a virtual environment and install dependencies:
pip install -r requirements.txt
- Make sure the encoder service is running and properly configured in
.env
file - Run the service:
python3 main.py
- Clone this repository
- Create a
.env
file using/env
template and set environment variable values - Give execution permission to the deployment script:
chmod +x deploy.sh
- Run deployment script:
bash deploy.sh
The project is open-source under the MIT license.
We welcome contributions.
To make a contribution, please follow these steps:
- Fork this repository.
- Create a new branch with a descriptive name
- Make the changes you want and add new tests, if needed
- Make sure all tests are passing
- Commit your changes
- Submit a pull request
Please create an issue if you need help.