bm25Matcher.py 文件源码

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

项目:PTTChatBot_DL2017 作者: thisray 项目源码 文件源码
def calculateIDF(self):

        # ???????????????
        if len(self.wordset) == 0:
            self.buildWordSet()
        if len(self.words_location_record) == 0:
            self.buildWordLocationRecord()

        # ?? idf
        for word in self.wordset:
            self.words_idf[word] = math.log2((self.D + .5)/(self.words_location_record[word] + .5))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号