segmentation.py 文件源码

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

项目:email-segmentation 作者: gorgias 项目源码 文件源码
def LSI_fit(self, data):
        '''
        Fits an LSI model and returns it with associated dictionary
        '''
        texts = [[tag for tag in sent] for sent in self.get_pos(data)]
        dictionary = corpora.Dictionary(texts)
        texts = map(dictionary.doc2bow, texts)
        lsi = models.LsiModel(texts, id2word=dictionary, 
                                                    num_topics=self.num_topics)

        return dictionary, lsi
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号