Ejemplo n.º 1
0
 def scores(self):
     if not self.initialized:
         guess_df = AbstractGuesser.load_all_guesses(
             directory_prefix=self.directory_prefix)
         self.map = AbstractGuesser.load_guess_score_map(guess_df)
         self.initialized = True
     return self.map
Ejemplo n.º 2
0
def task_list():
    guess_df = AbstractGuesser.load_all_guesses()
    question_db = QuestionDatabase()
    question_map = question_db.all_questions()
    tasks = []
    guess_df = guess_df[['qnum', 'sentence', 'token', 'guess',
                         'fold']].drop_duplicates(
                             ['qnum', 'sentence', 'token', 'guess'])
    for name, guesses in guess_df.groupby(['qnum', 'sentence', 'token']):
        qnum = name[0]
        question = question_map[qnum]
        tasks.append(Task(question, guesses))

    return tasks