facebookresearch / DPR

Dense Passage Retriever - is a set of tools and models for open domain Q&A task.
Other
1.73k stars 305 forks source link

Possibly a bug on hard_neg_ctx_indices #181

Closed thongnt99 closed 3 years ago

thongnt99 commented 3 years ago

Hi, It seems that there is an inconsistency between https://github.com/facebookresearch/DPR/blob/49e5838f94ffced8392be750ded2a8fa4a14b5cf/dpr/models/biencoder.py#L200-L202 and https://github.com/facebookresearch/DPR/blob/49e5838f94ffced8392be750ded2a8fa4a14b5cf/dpr/models/biencoder.py#L216-L224

I think https://github.com/facebookresearch/DPR/blob/49e5838f94ffced8392be750ded2a8fa4a14b5cf/dpr/models/biencoder.py#L200 should be changed to all_ctxs = [positive_ctx] + hard_neg_ctxs + neg_ctxs? Sorry if I misunderstood the code.

Thanks.

vlad-karpukhin commented 3 years ago

Hi @thongnt99 , yes, it is inconsistency that doesn't affect anything since hard_neg_ctx_indices are not used and should be deleted from the code actually (it is a legacy from experimental code which I forgot to clean up).