Closed celsofranssa closed 1 year ago
I suspect your filtered_relevance_map
is not valid.
Can you please post a print of it?
I suspect your
filtered_relevance_map
is not valid. Can you please post a print of it?filtered_relevance_map
:
ranking
:
What the code does is simply this:
doc_ids = [list(doc.keys()) for doc in qrels.values()]
max_len = max(len(y) for x in doc_ids for y in x)
The code finds the max string length of the doc ids in the dictionary to reduce memory consumption.
You should be able to find the issue by checking what happens with your filtered_relevance_map
in place of qrels
.
Please, let me what you find out.
PS: doc
variable name in the list comprehension is probably a wrong name. It should be q
or query
.
What the code does is simply this:
doc_ids = [list(doc.keys()) for doc in qrels.values()] max_len = max(len(y) for x in doc_ids for y in x)
The code finds the max string length of the doc ids in the dictionary to reduce memory consumption.
You should be able to find the issue by checking what happens with your
filtered_relevance_map
in place ofqrels
.Please, let me what you find out.
I can't see any problem since I just replaced doc
with label
and query
with text
and concatenated it with their ids.
I can't help you without reproducible code. The best I can do is guessing. I never encountered such a problem.
The problem should lay in this line:
doc_ids = [list(doc.keys()) for doc in qrels.values()]
doc.keys()
is probably empty. That should be why the next line throws the exception:
ValueError: max() arg is an empty sequence
Have you checked if those two lines of code (isolated from ranx
) raise the exception?
Closing for inactivity.
Hello, I'd like to determine what query is causing the following error and how to get around it:
My evaluation code is shown in the code snippet below.