'Evaluate analogy questions and reports accuracy.'

def eval(self):

    correct = 0
    try:
        total = self._analogy_questions.shape[0]
    except AttributeError as e:
        raise AttributeError('Need    to    read    analogy    questions.')
    start = 0
    while (start < total):
        limit = (start + 2500)
        sub = self._analogy_questions[start:limit, :]
        idx = self._predict(sub)
        start = limit
        for question in xrange(sub.shape[0]):
            for j in xrange(4):
                if (idx[(question, j)] == sub[(question, 3)]):
                    correct += 1
                    break
                elif (idx[(question, j)] in sub[question, :3]):
                    continue
                else:
                    break
    print()
    print(('Eval    %4d/%d    accuracy    =    %4.1f%%' % (correct, total, ((correct * 100.0) / total))))
