Commit f0e3910b authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

bugfix: vector normalization was incorrect

parent 3bc46add9435
......@@ -96,7 +96,7 @@ class VectorSpaceModel(object):
idf = 0
vec[word] = tf * idf
# normalize result
total = sum(vec.values())
total = norm(vec)
for word, count in vec.items():
vec[word] = count/total
return vec
......
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