Beispiel #1
0
class PoolScorer:
    def __init__(self, ini):
        if USE_CANDIDATE_SCORER:
            self.scorer = CandidateScorer(ini)
        self.count = 0

    def __call__(self, instance):
        score = 0
        candidate, evidence, main_evidence, parsed_query = instance
        if USE_CANDIDATE_SCORER:
            score = self.scorer.score(*instance)
        else:
            score = score_candidate(candidate, evidence, main_evidence, parsed_query)
        return candidate, score, evidence
Beispiel #2
0
 def __init__(self, ini):
     if USE_CANDIDATE_SCORER:
         self.scorer = CandidateScorer(ini)
     self.count = 0