cf1cf188830beef6024a0178ddd4c8baf12b8f66,deeppavlov/models/classifiers/intents/intent_model.py,KerasIntentModel,texts2vec,#KerasIntentModel#Any#,75

Before Change


            if len(tokens) > self.opt["text_size"]:
                tokens = tokens[:self.opt["text_size"]]
            for tok in tokens:
                embeddings.append(self.fasttext_model.infer(tok))
            if len(tokens) < self.opt["text_size"]:
                pads = [np.zeros(self.opt["embedding_size"])
                        for _ in range(self.opt["text_size"] - len(tokens))]

After Change


            if len(tokens) > self.opt["text_size"]:
                tokens = tokens[:self.opt["text_size"]]

            embeddings = self.fasttext_model.infer(" ".join(tokens))
            if len(tokens) < self.opt["text_size"]:
                pads = [np.zeros(self.opt["embedding_size"])
                        for _ in range(self.opt["text_size"] - len(tokens))]
                embeddings = pads + embeddings
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: cf1cf188830beef6024a0178ddd4c8baf12b8f66
Time: 2018-01-10
Author: ol.gure@gmail.com
File Name: deeppavlov/models/classifiers/intents/intent_model.py
Class Name: KerasIntentModel
Method Name: texts2vec


Project Name: shibing624/pycorrector
Commit Name: 3a7e22f703d5296e12370f19896ba58b3a284ce9
Time: 2019-07-19
Author: 507153809@qq.com
File Name: pycorrector/seq2seq/infer.py
Class Name:
Method Name:


Project Name: deepmipt/DeepPavlov
Commit Name: d86f0ef86868899b112ac61e598a3333fac66ad2
Time: 2018-01-24
Author: arkhipov@yahoo.com
File Name: deeppavlov/models/classifiers/intents/intent_model.py
Class Name: KerasIntentModel
Method Name: texts2vec