summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2011-05-06 01:03:00 +0300
committerYuval Adam <yuv.adm@gmail.com>2011-05-06 01:03:00 +0300
commite1ac42c8e2094521bf74bf9a4a119141fff3cb23 (patch)
treef745e6ddf89c5fe2bb41abf126f8c40430d8c0dd /utils.py
parentc3574e45a3a18d8964f04316fc7305329afe1120 (diff)
implemented NS(n)
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/utils.py b/utils.py
index c5e020f..43f2b4a 100644
--- a/utils.py
+++ b/utils.py
@@ -1,12 +1,10 @@
+from brown import brown_collection
from consts import SN, SN_
-def NS(n):
+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_`
"""
- for noun in SN_:
- acv = ()
- # let acv be the vector of absolute frequencies of each adjective that
- # modifies the noun in the union of the erotica and Brown corpora
- return 0
+ # return 10**-7 for nouns that occur less than 200 times
+ return brown_collection.tf_idf(noun, SN_)