Git Product home page Git Product logo

Comments (7)

AmenRa avatar AmenRa commented on May 29, 2024

I suspect your filtered_relevance_map is not valid.
Can you please post a print of it?

from ranx.

celsofranssa avatar celsofranssa commented on May 29, 2024

I suspect your filtered_relevance_map is not valid. Can you please post a print of it?
filtered_relevance_map:
image

ranking:
image

from ranx.

AmenRa avatar AmenRa commented on May 29, 2024

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.

from ranx.

AmenRa avatar AmenRa commented on May 29, 2024

PS: doc variable name in the list comprehension is probably a wrong name. It should be q or query.

from ranx.

celsofranssa avatar celsofranssa commented on May 29, 2024

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.

I can't see any problem since I just replaced doc with label and query with text and concatenated it with their ids.

from ranx.

AmenRa avatar AmenRa commented on May 29, 2024

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?

from ranx.

AmenRa avatar AmenRa commented on May 29, 2024

Closing for inactivity.

from ranx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.