5d6cdbd53544d057a1cf344526ec70e0995b77d1,newspaper/nlp.py,,keywords,#Any#,107

Before Change


            freq[word] += 1

        min_size = min(10, len(freq))
        keywords = tuple(freq.most_common(min_size))
        keywords = dict((x, y) for x, y in keywords)

        for k in keywords:
            articleScore = keywords[k]*1.0 / max(num_words, 1)
            keywords[k] = articleScore * 1.5 + 1

        keywords = sorted(iter(keywords.items()), key=operator.itemgetter(1))
        keywords.reverse()
        return dict(keywords)
    else:

After Change


                freq[word] = 1

        min_size = min(NUM_KEYWORDS, len(freq))
        keywords = sorted(freq.items(),
                          key=lambda x: (x[1], x[0]),
                          reverse=True)
        keywords = keywords[:min_size]
        keywords = dict((x, y) for x, y in keywords)

        for k in keywords:
            articleScore = keywords[k]*1.0 / max(num_words, 1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: codelucas/newspaper
Commit Name: 5d6cdbd53544d057a1cf344526ec70e0995b77d1
Time: 2014-12-17
Author: lucasyangpersonal@gmail.com
File Name: newspaper/nlp.py
Class Name:
Method Name: keywords


Project Name: Pinafore/qb
Commit Name: aa913fbeb5bd531981b6a01d2ea727c87db26e24
Time: 2018-04-18
Author: sjtufs@gmail.com
File Name: qanta/buzzer/util.py
Class Name:
Method Name: read_data


Project Name: scikit-multiflow/scikit-multiflow
Commit Name: bfaeffe89a95dfd2167d90d8c006b5453e60d1f3
Time: 2019-03-06
Author: jacob.montiel@gmail.com
File Name: src/skmultiflow/trees/nominal_attribute_class_observer.py
Class Name: NominalAttributeClassObserver
Method Name: observe_attribute_class