517c81db14d146a5e740ca5cca9177d9f9c30d8f,python/baseline/services.py,EncoderDecoderService,predict,#EncoderDecoderService#Any#Any#,484

Before Change



        results = []
        B = len(outcomes)
        for i in range(B):
            N = len(outcomes[i])
            n_best_result = []
            for n in range(min(K, N)):
                n_best = outcomes[i][n]
                out = lookup_sentence(self.tgt_idx_to_token, n_best).split()
                if K == 1:
                    results += [out]
                else:
                    n_best_result += [out]
            if K > 1:
                results.append(n_best_result)
        return results

After Change



        kwargs["beam"] = int(kwargs.get("beam", K))
        outcomes = self.model.predict(examples, **kwargs)
        return self.format_output(outcomes, K=K)

    def format_output(self, predicted, K=1, **kwargs):
        results = []
        B = len(predicted)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dpressel/mead-baseline
Commit Name: 517c81db14d146a5e740ca5cca9177d9f9c30d8f
Time: 2019-11-15
Author: blester125@gmail.com
File Name: python/baseline/services.py
Class Name: EncoderDecoderService
Method Name: predict


Project Name: dpressel/mead-baseline
Commit Name: 517c81db14d146a5e740ca5cca9177d9f9c30d8f
Time: 2019-11-15
Author: blester125@gmail.com
File Name: python/baseline/services.py
Class Name: TaggerService
Method Name: predict


Project Name: dpressel/mead-baseline
Commit Name: 517c81db14d146a5e740ca5cca9177d9f9c30d8f
Time: 2019-11-15
Author: blester125@gmail.com
File Name: python/baseline/services.py
Class Name: ClassifierService
Method Name: predict