input_module.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:jack 作者: uclmr 项目源码 文件源码
def _batch_questions(self, questions: List[Tuple[QASetting, List[Answer]]], batch_size, is_eval: bool):
        """Optionally shuffles and batches annotations.

        By default, all annotations are shuffled (if self.shuffle(is_eval) and
        then batched. Override this method if you want to customize the
        batching, e.g., to do stratified sampling, sampling with replacement,
        etc.

        Args:
            - annotations: List of annotations to shuffle & batch.
            - is_eval: Whether batches are generated for evaluation.

        Returns: Batch iterator
        """
        rng = _rng if self._shuffle(is_eval) else None
        return shuffle_and_batch(questions, batch_size, rng)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号