e58e5a994ab596edfa81e167ac34c829b0fddbca,torchnlp/word_to_vector/pretrained_word_vectors.py,_PretrainedWordVectors,cache,#_PretrainedWordVectors#Any#Any#Any#,101

Before Change


            // str call is necessary for Python 2/3 compatibility, since
            // argument must be Python 2 str (Python 3 bytes) or
            // Python 3 str (Python 2 unicode)
            itos, vectors, dim = [], array.array(str("d")), None

            // Try to read the whole file with utf-8 encoding.
            binary_lines = False

After Change


                if self.is_include is not None and not self.is_include(word):
                    continue

                vectors[len(itos)] = torch.Tensor([float(e) for x in entries])
                itos.append(word)

            self.itos = itos
            self.stoi = {word: i for i, word in enumerate(itos)}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: PetrochukM/PyTorch-NLP
Commit Name: e58e5a994ab596edfa81e167ac34c829b0fddbca
Time: 2019-02-26
Author: zbyte64@gmail.com
File Name: torchnlp/word_to_vector/pretrained_word_vectors.py
Class Name: _PretrainedWordVectors
Method Name: cache


Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: rank_response


Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: recall_at_k