castorini / pygaggle

a gaggle of deep neural architectures for text ranking and question answering, designed for Pyserini
http://pygaggle.ai/
Apache License 2.0
340 stars 100 forks source link

ImportError: cannot import name 'JLuceneSearcherResult' from 'pyserini.search' (/usr/local/lib/python3.10/dist-packages/pyserini/search/__init__.py) #332

Open SamiKhan-cse19 opened 9 months ago

SamiKhan-cse19 commented 9 months ago

Error upon installation from git repo.

Installation:

git clone --recursive https://github.com/castorini/pygaggle.git
cd pygaggle/
pip install -r requirements.txt
pip install -e /content/pygaggle

Code:

from pygaggle.rerank.base import Query, Text
from pygaggle.rerank.transformer import MonoT5

reranker =  MonoT5()

Output: image

I managed to run by install pyserini==0.23.0. It seems the requirements.txt does not list an upper bound for pyserini and the latest version 0.24.0 causes this problem. Please provide an upper bound or change the imports in the source code.