Georgetown-IR-Lab / cedr

Code for CEDR: Contextualized Embeddings for Document Ranking, accepted at SIGIR 2019.
MIT License
155 stars 28 forks source link

shuffling documents just to pick a random one seems inefficient #4

Closed cmacdonald closed 5 years ago

cmacdonald commented 5 years ago

E.g. https://github.com/Georgetown-IR-Lab/cedr/blob/master/data.py#L70:

random.shuffle(pos_ids)
pos_id = pos_ids[0]

Why not

pos_id = random.choice(pos_ids)
seanmacavaney commented 5 years ago

Yes, the shuffle was totally overkill.