e0ddcc6bc5fff33824ecde2c6abba3ed2bfcecf8,src/gensim/models/tfidfmodel.py,TfidfModel,initialize,#TfidfModel#Any#,54
Before Change
if self.id2word is None:
logging.info("no word id mapping provided; initializing from corpus, assuming identity")
maxId = 0
for document in corpus:
maxId = max(maxId, max([-1] + [fieldId for fieldId, _ in document]))
self.numTerms = 1 + maxId
self.id2word = dict(zip(xrange(self.numTerms), xrange(self.numTerms)))
else:
self.numTerms = 1 + max([-1] + self.id2word.keys())
After Change
if self.id2word is None:
logging.info("no word id mapping provided; initializing from corpus, assuming identity")
self.id2word = utils.dictFromCorpus(corpus)
self.numTerms = len(self.id2word)
else:
self.numTerms = 1 + max([-1] + self.id2word.keys())
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 21
Instances
Project Name: RaRe-Technologies/gensim
Commit Name: e0ddcc6bc5fff33824ecde2c6abba3ed2bfcecf8
Time: 2010-04-17
Author: radimrehurek@seznam.cz
File Name: src/gensim/models/tfidfmodel.py
Class Name: TfidfModel
Method Name: initialize
Project Name: RaRe-Technologies/gensim
Commit Name: 2299d6fb7437903bf421884c0191c38d59d06f7b
Time: 2010-03-12
Author: piskvorky@92d0401f-a546-4972-9173-107b360ed7e5
File Name: src/gensim/corpora/bleicorpus.py
Class Name: BleiCorpus
Method Name: saveCorpus
Project Name: RaRe-Technologies/gensim
Commit Name: a241c2b0a2b73a83662ea7050f99f10d31252183
Time: 2010-04-17
Author: piskvorky@92d0401f-a546-4972-9173-107b360ed7e5
File Name: src/gensim/models/tfidfmodel.py
Class Name: TfidfModel
Method Name: initialize
Project Name: RaRe-Technologies/gensim
Commit Name: e0ddcc6bc5fff33824ecde2c6abba3ed2bfcecf8
Time: 2010-04-17
Author: radimrehurek@seznam.cz
File Name: src/gensim/models/tfidfmodel.py
Class Name: TfidfModel
Method Name: initialize
Project Name: RaRe-Technologies/gensim
Commit Name: 2e07c2d2743bc80fe0a2b9c8ec5a8460b2f5d6dd
Time: 2010-03-12
Author: radimrehurek@seznam.cz
File Name: src/gensim/corpora/bleicorpus.py
Class Name: BleiCorpus
Method Name: saveCorpus