63871d5ab3301d015805abddd8f4259680d6a24a,translate.py,,main,#,68

Before Change


            out_file.flush()

            if opt.verbose:
                words = []
                for f in src_sent:
                    word = translator.fields["src"].vocab.itos[f]
                    if word == onmt.IO.PAD_WORD:
                        break
                    words.append(word)

                os.write(1, bytes("\nSENT %d: %s\n" %
                                  (count, " ".join(words)), "UTF-8"))

                index += 1
                os.write(1, bytes("PRED %d: %s\n" %

After Change


                (sent.squeeze(1) for sent in src.split(1, dim=1)))

        for pred_sents, gold_sent, pred_score, gold_score, src_sent in z_batch:
            n_best_preds = [" ".join(pred) for pred in pred_sents[:opt.n_best]]
            count += 1
            out_file.write("\n".join(n_best_preds))
            out_file.write("\n")
            out_file.flush()

            if opt.verbose:
                words = get_src_words(
                    src_sent, translator.fields["src"].vocab.itos)

                os.write(1, bytes("\nSENT %d: %s\n" %
                                  (count, words), "UTF-8"))

                index += 1
                best_pred = n_best_preds[0]
                best_score = pred_score[0]
                os.write(1, bytes("PRED %d: %s\n" %
                                  (count, best_pred), "UTF-8"))
                print("PRED SCORE: %.4f" % best_score)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 63871d5ab3301d015805abddd8f4259680d6a24a
Time: 2017-09-21
Author: bpeters@coli.uni-saarland.de
File Name: translate.py
Class Name:
Method Name: main


Project Name: deepmipt/DeepPavlov
Commit Name: 61980b57db5349ec0adc4a7b4797ee4742c21b73
Time: 2018-02-15
Author: yoptar@gmail.com
File Name: deeppavlov/models/classifiers/intents/intent_model.py
Class Name: KerasIntentModel
Method Name: texts2vec


Project Name: google/deepvariant
Commit Name: 124b32163e3975e15c59df8b16017f2508b6c233
Time: 2018-04-04
Author: mdepristo@google.com
File Name: third_party/nucleus/io/fasta.py
Class Name: InMemoryRefReader
Method Name: __str__