:mod:`capreolus.sampler` ======================== .. py:module:: capreolus.sampler Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: capreolus.sampler.TrainDataset capreolus.sampler.PredDataset .. data:: logger .. py:class:: TrainDataset(qid_docid_to_rank, qrels, extractor) Bases: :class:`torch.utils.data.IterableDataset` Samples training data. Intended to be used with a pytorch DataLoader .. method:: get_hash(self) .. method:: get_total_samples(self) .. method:: generator_func(self) .. py:class:: PredDataset(qid_docid_to_rank, extractor) Bases: :class:`torch.utils.data.IterableDataset` Creates a Dataset for evaluation (test) data to be used with a pytorch DataLoader .. method:: get_hash(self) .. method:: get_qid_docid_pairs(self) Returns a generator for the (qid, docid) pairs. Useful if you want to sequentially access the pred pairs without extracting the actual content