def show_results(self, verbose=False):

        thresh = 0.5
        total, correct = 0, 0
        frag = self.frag
        while frag:
            total += 1
            if frag.label == (frag.pred > thresh):
                correct += 1
            else:
                w1 = ' '.join(frag.tokenized.split()[-2:])
                if frag.next: w2 = ' '.join(frag.next.tokenized.split()[:2])
                else: w2 = '<EOF>'
                if verbose:
                    print '[%d] [%1.4f] %s?? %s' %(frag.label, frag.pred, w1, w2)

            frag = frag.next

        error = 1 - (1.0 * correct / total)
        print 'correct [%d] total [%d] error [%1.4f]' %(correct, total, error)
dataset/ETHPy150Open daeilkim/refinery/refinery/lib/sbd.py/Doc.show_results/original