2e07c2d2743bc80fe0a2b9c8ec5a8460b2f5d6dd,src/gensim/corpora/svmlightcorpus.py,SvmLightCorpus,__iter__,#SvmLightCorpus#,53

Before Change


        Iterate over the corpus, returning one sparse vector at a time.
        
        for lineNo, line in enumerate(open(self.fname)):
            if line.startswith("//"):
                continue
            parts = line.split()
            target, fields = parts[0], [part.rsplit(":", 1) for part in parts[1:]]

After Change


            if not line:
                continue // ignore comments and empty lines
            parts = line.split()
            if not parts:
                raise ValueError("invalid format at line no. %i in %s" %
                                 (lineNo, self.fname))
            target, fields = parts[0], [part.rsplit(":", 1) for part in parts[1:]]
            doc = [(int(p1), float(p2)) for p1, p2 in fields if p1 != "qid"] // ignore "qid" features
            yield doc
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: 2e07c2d2743bc80fe0a2b9c8ec5a8460b2f5d6dd
Time: 2010-03-12
Author: radimrehurek@seznam.cz
File Name: src/gensim/corpora/svmlightcorpus.py
Class Name: SvmLightCorpus
Method Name: __iter__


Project Name: RaRe-Technologies/gensim
Commit Name: 2299d6fb7437903bf421884c0191c38d59d06f7b
Time: 2010-03-12
Author: piskvorky@92d0401f-a546-4972-9173-107b360ed7e5
File Name: src/gensim/corpora/svmlightcorpus.py
Class Name: SvmLightCorpus
Method Name: __iter__


Project Name: googledatalab/pydatalab
Commit Name: 90d39b1cb096e391562565aefa904b5f0857d972
Time: 2017-06-14
Author: brandondutra@google.com
File Name: solutionbox/code_free_ml/mltoolbox/code_free_ml/analyze.py
Class Name:
Method Name: parse_arguments