def shouldProcessQuestion()

in 1_synthetic-qa-generation/reasoningplaning/evolve.py [0:0]


    def shouldProcessQuestion(self, question: Dict[str, str]) -> bool:
        prompt = question[self.column_names]
        correct_answer = question[GRND_TRUTH_COL]

        has_correct = False
        has_incorrect = False

        initial_batch_answers = self.branchMaker.generateBranch(prompt, NUM_TRY_BEFORE_SEARCH)

        for answer in initial_batch_answers:
            if answer and self.branchMaker.evaluateCorrectness(answer, correct_answer):
                has_correct = True
            else:
                has_incorrect = True

            if has_correct and has_incorrect:
                logger.info(f"Question passed filter: {question['problem']}")
                return True

        return False