import math
idf = {'python': math.log(3/2), 'est': 0.1}
doc = 'python python est simple'
scores = tfidf(doc, idf)
assert scores['python'] > scores['est']
import math
idf = {'python': math.log(3/2), 'simple': math.log(3)}
doc = 'python est simple'
score = scorer_document(doc, 'python simple', idf)
assert score > 0
+ 0 tests cachés