There was an error while loading. Please reload this page.
1 parent 8a934be commit 88357feCopy full SHA for 88357fe
assignment3/part1.py
@@ -125,8 +125,8 @@ def compute_tfidf(document_tf, idfs):
125
document1 = 'hello world'
126
document2 = 'hello cis192'
127
bow = get_bow(document1, document2)
128
- d1 = compute_tf(document1, bow)
129
- d2 = compute_tf(document2, bow)
+ d1 = get_word_count(document1, bow)
+ d2 = get_word_count(document2, bow)
130
print(compute_tfidf(compute_tf(d1, bow), compute_idf([d1, d2])))
131
# should print {'cis192': 0.0, 'hello': 0.0, 'world': 0.34657359027997264}
132
print(compute_tfidf(compute_tf(d2, bow), compute_idf([d1, d2])))
0 commit comments