test_similarity.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:rltk 作者: usc-isi-i2 项目源码 文件源码
def test_tf_idf(bag1, bag2, df_corpus, doc_size, math_log, score):
    if bag1 is None or bag2 is None or df_corpus is None:
        with pytest.raises(TypeError):
            tf_idf_similarity(bag1, bag2)
    else:
        assert pytest.approx(tf_idf_similarity(bag1, bag2, df_corpus, doc_size, math_log), 0.001) == score
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号