OpenBMB / VisRAG

Parsing-free RAG supported by VLMs
Apache License 2.0
379 stars 29 forks source link

A question about computing similarity score during retrievaling. #15

Closed chenbuhuu closed 2 weeks ago

chenbuhuu commented 2 weeks ago

In ur paper,the similarity score during retrievaling is calculated by the cosine similarity.While when I read the class DRTrainer in "dense_trainer.py",it is calculated by dot product.If I understand the code correctly, I hope you to pay attention to this.

tcy6 commented 2 weeks ago

@chenbuhuu Good question! Actually, during the training of VisRAG-Ret, we apply weighted mean pooling on the last_hidden_states, followed by normalization. Under this condition, cosine similarity and dot product become equivalent.