summaryrefslogtreecommitdiff
path: root/utils.py
blob: 43f2b4a188fb0592bda476fe8479bf09af58c2ef (plain)
1
2
3
4
5
6
7
8
9
10
from brown import brown_collection
from consts import SN, SN_

def NS(noun):
    """Noun sexiness function
    Returns a real value measure of the maximum similarity a noun `n not in SN`
    has to each of the `nouns in SN_`
    """
    # return 10**-7 for nouns that occur less than 200 times
    return brown_collection.tf_idf(noun, SN_)