capreolus-ir / capreolus

A toolkit for end-to-end neural ad hoc retrieval
https://capreolus.ai
Apache License 2.0
95 stars 32 forks source link

how to properly output reranker scores? #155

Closed ali-abz closed 3 years ago

ali-abz commented 3 years ago

Hi there. Using Capreolus, I was able to train a Bert-based reranker in a "pair-wise manner" and it was sound. Now I want to do the same but this time I want it to be "point-wise". I have some troubles to do it and I don't know what am I doing wrong. I believe my problem lies in how my reranker outputs its score but I am not certain. In order to create this reranker:

andrewyates commented 3 years ago

Hey, this is a good question. I think most of this approach makes sense, but it's been a while since I've looked into this scenario. One thing I'm confused about is what your forward function is doing and returning. The list error comes from the fact that this is returning a list rather than a tensor (typically with the shape (batch size, 1)). Are you using this function to create a batch within the model, rather than having the trainer (and sampler) create a batch from the available training instances?

ali-abz commented 3 years ago

Hi Andrew, Unfortunately, at the current time I am unable to test my code again. I will close this issue for now and I will seek help later. Thanks for your comment.