'Reads through the analogy question file.
Returns:
questions: a [n, 4] numpy array containing the analogy question\'s
word ids.
questions_skipped: questions skipped due to unknown words.'

def read_analogies(self):

    questions = []
    questions_skipped = 0
    with open(self._options.eval_data, 'rb') as analogy_f:
        for line in analogy_f:
            if line.startswith(':'):
                continue
            words = line.strip().lower().split('    ')
            ids = [self._word2id.get(w.strip()) for w in words]
            if ((None in ids) or (len(ids) != 4)):
                questions_skipped += 1
            else:
                questions.append(np.array(ids))
    print('Eval    analogy    file:    ', self._options.eval_data)
    print('Questions:    ', len(questions))
    print('Skipped:    ', questions_skipped)
    self._analogy_questions = np.array(questions, dtype=np.int32)
