35cf4f0ae774a4aa500318879a1a4d53408ac129,onmt/translate/translation.py,TranslationBuilder,_build_target_tokens,#TranslationBuilder#Any#Any#Any#Any#Any#,36

Before Change


                    if self.phrase_table != "":
                        with open(self.phrase_table, "r") as f:
                            for line in f:
                                if line.startswith(src_raw[max_index.item()]):
                                    tokens[i] = line.split("|||")[1].strip()
        return tokens

    def from_batch(self, translation_batch):
        batch = translation_batch["batch"]

After Change


                    tokens[i] = src_raw[max_index.item()]
                    if self.phrase_table_dict:
                        src_tok = src_raw[max_index.item()]
                        if src_tok in self.phrase_table_dict:
                            tokens[i] = self.phrase_table_dict[src_tok]
        return tokens

    def from_batch(self, translation_batch):
        batch = translation_batch["batch"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 35cf4f0ae774a4aa500318879a1a4d53408ac129
Time: 2020-06-02
Author: plison@nr.no
File Name: onmt/translate/translation.py
Class Name: TranslationBuilder
Method Name: _build_target_tokens


Project Name: OpenNMT/OpenNMT-py
Commit Name: aaa220b753c9749ac1a0d86a32e4c1fdcb4faa7a
Time: 2019-06-13
Author: francois.hernandez.fh@gmail.com
File Name: onmt/utils/optimizers.py
Class Name:
Method Name: build_torch_optimizer


Project Name: AKSHAYUBHAT/DeepVideoAnalytics
Commit Name: 90c7356471023c1bbeaabbcfff37eba11940bbe4
Time: 2018-08-13
Author: akshayubhat@gmail.com
File Name: server/init_fs.py
Class Name:
Method Name: init_models