utils.py 文件源码

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

项目:Content-Based-News-Recommendation-System-in-Spark 作者: Labyrinth108 项目源码 文件源码
def preprocess_WithSpeech(stopword_file, news):
    content = jieba.posseg.cut(news)  # ??????

    content = filter(lambda x: hasMeaningfulWords(x), content)  # ???????????
    content = [i.word for i in content]
    content = filter(lambda x: len(x) > 1, content)  # ?????

    stopw = [line.strip().decode('utf-8') for line in open(stopword_file).readlines()]

    parsed = set(content) - set(stopw)
    return ' '.join(parsed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号