2a70e3a726404cd4230542a35cfd2dc4d63da6f1,gensim/models/keyedvectors.py,KeyedVectors,doesnt_match,#KeyedVectors#Any#,302

Before Change


        logger.debug("using words %s" % words)
        if not words:
            raise ValueError("cannot select a word from an empty list")
        vectors = vstack(self.syn0norm[self.vocab[word].index] for word in words).astype(REAL)
        mean = matutils.unitvec(vectors.mean(axis=0)).astype(REAL)
        dists = dot(vectors, mean)
        return sorted(zip(dists, words))[0][1]

After Change


            logger.warning("vectors for words %s are not present in the model, ignoring these words", ignored_words)
        if not used_words:
            raise ValueError("cannot select a word from an empty list")
        vectors = vstack(self.word_vec(word, use_norm=True) for word in used_words).astype(REAL)
        mean = matutils.unitvec(vectors.mean(axis=0)).astype(REAL)
        dists = dot(vectors, mean)
        return sorted(zip(dists, used_words))[0][1]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: 2a70e3a726404cd4230542a35cfd2dc4d63da6f1
Time: 2017-01-24
Author: jayantjain1992@gmail.com
File Name: gensim/models/keyedvectors.py
Class Name: KeyedVectors
Method Name: doesnt_match


Project Name: RaRe-Technologies/gensim
Commit Name: 2a70e3a726404cd4230542a35cfd2dc4d63da6f1
Time: 2017-01-24
Author: jayantjain1992@gmail.com
File Name: gensim/models/keyedvectors.py
Class Name: KeyedVectors
Method Name: __getitem__


Project Name: RaRe-Technologies/gensim
Commit Name: 2a70e3a726404cd4230542a35cfd2dc4d63da6f1
Time: 2017-01-24
Author: jayantjain1992@gmail.com
File Name: gensim/models/keyedvectors.py
Class Name: KeyedVectors
Method Name: most_similar