reading.py 文件源码

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

项目:nstock 作者: ybenitezf 项目源码 文件源码
def most_distinctive_terms(self, fieldname, number=5, prefix=''):
        """Returns the top 'number' terms with the highest `tf*idf` scores as
        a list of (score, text) tuples.
        """

        N = float(self.doc_count())
        gen = ((terminfo.weight() * log(N / terminfo.doc_frequency()), text)
               for text, terminfo in self.iter_prefix(fieldname, prefix))
        return nlargest(number, gen)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号