7a125ea5e0113ec9d10d010884cdc78419bffe6e,python/baseline/dy/tagger/train.py,TaggerTrainerDyNet,process_output,#TaggerTrainerDyNet#Any#Any#Any#Any#Any#Any#,31

Before Change


        total_labels = 0
        truth_n = truth
        // For fscore
        gold_count = 0
        guess_count = 0
        overlap_count = 0
        // For each sentence
        for b in range(len(guess)):

            sentence_length = sentence_lengths[b]
            gold = truth_n[b, :sentence_length]
            sentence = guess[b]
            sentence = sentence[:sentence_length]
            correct_labels += np.sum(np.equal(sentence, gold))
            total_labels += sentence_length
            gold_chunks = to_spans(gold, self.idx2label, self.span_type)
            gold_count += len(gold_chunks)
            guess_chunks = to_spans(sentence, self.idx2label, self.span_type)
            guess_count += len(guess_chunks)

            overlap_chunks = gold_chunks & guess_chunks
            overlap_count += len(overlap_chunks)

            // Should we write a file out?  If so, we have to have txts
            if handle is not None:
                id = ids[b]

After Change


        total_labels = 0
        truth_n = truth
        // For fscore
        gold_chunks = []
        pred_chunks = []
        // For each sentence
        for b in range(len(guess)):

            sentence_length = sentence_lengths[b]
            gold = truth_n[b, :sentence_length]
            sentence = guess[b]
            sentence = sentence[:sentence_length]
            correct_labels += np.sum(np.equal(sentence, gold))
            total_labels += sentence_length
            gold_chunks.append(set(to_spans(gold, self.idx2label, self.span_type)))
            pred_chunks.append(set(to_spans(sentence, self.idx2label, self.span_type)))
            // Should we write a file out?  If so, we have to have txts
            if handle is not None:
                id = ids[b]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 19

Instances


Project Name: dpressel/mead-baseline
Commit Name: 7a125ea5e0113ec9d10d010884cdc78419bffe6e
Time: 2019-05-21
Author: blester125@users.noreply.github.com
File Name: python/baseline/dy/tagger/train.py
Class Name: TaggerTrainerDyNet
Method Name: process_output


Project Name: dpressel/mead-baseline
Commit Name: 7a125ea5e0113ec9d10d010884cdc78419bffe6e
Time: 2019-05-21
Author: blester125@users.noreply.github.com
File Name: python/baseline/tf/tagger/train.py
Class Name: TaggerEvaluatorTf
Method Name: process_batch


Project Name: dpressel/mead-baseline
Commit Name: 7a125ea5e0113ec9d10d010884cdc78419bffe6e
Time: 2019-05-21
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/tagger/train.py
Class Name: TaggerTrainerPyTorch
Method Name: process_output


Project Name: dpressel/mead-baseline
Commit Name: 7a125ea5e0113ec9d10d010884cdc78419bffe6e
Time: 2019-05-21
Author: blester125@users.noreply.github.com
File Name: python/baseline/dy/tagger/train.py
Class Name: TaggerTrainerDyNet
Method Name: process_output