Commit 2471e73d authored by Romain Loth's avatar Romain Loth

fix tfidf formula operator mistake

parent fee236bc
...@@ -87,7 +87,7 @@ def compute_tfidf_local(corpus): ...@@ -87,7 +87,7 @@ def compute_tfidf_local(corpus):
# --------------------------------------------- # ---------------------------------------------
tfidfs = {} tfidfs = {}
for (ngram_id, tf, nd) in tf_nd: for (ngram_id, tf, nd) in tf_nd:
tfidfs[ngram_id] = tf / log(total_docs/nd) tfidfs[ngram_id] = tf * log(total_docs/nd)
# --------------------------------------------- # ---------------------------------------------
# create the new TFIDF-CORPUS node # create the new TFIDF-CORPUS node
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment