Skip to content

Commit 88357fe

Browse files
authored
Update part1.py
1 parent 8a934be commit 88357fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

assignment3/part1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def compute_tfidf(document_tf, idfs):
125125
document1 = 'hello world'
126126
document2 = 'hello cis192'
127127
bow = get_bow(document1, document2)
128-
d1 = compute_tf(document1, bow)
129-
d2 = compute_tf(document2, bow)
128+
d1 = get_word_count(document1, bow)
129+
d2 = get_word_count(document2, bow)
130130
print(compute_tfidf(compute_tf(d1, bow), compute_idf([d1, d2])))
131131
# should print {'cis192': 0.0, 'hello': 0.0, 'world': 0.34657359027997264}
132132
print(compute_tfidf(compute_tf(d2, bow), compute_idf([d1, d2])))

0 commit comments

Comments
 (0)