4 Star 22 Fork 5

apple123456 / tf-idf-keyword

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
segmenter.py 342 Bytes
一键复制 编辑 原始数据 按行查看 历史
Gaussic 提交于 2017-11-02 00:37 . update tfidf
#!/usr/bin/python
# -*- coding: utf-8 -*-
import jieba
import re
def segment(sentence, cut_all=False):
sentence = sentence.replace('\n', '').replace('\u3000', '').replace('\u00A0', '')
sentence = ' '.join(jieba.cut(sentence, cut_all=cut_all))
return re.sub('[a-zA-Z0-9.。::,,))((!!??”“\"]', '', sentence).split()
Python
1
https://gitee.com/apple12345656/tf-idf-keyword.git
git@gitee.com:apple12345656/tf-idf-keyword.git
apple12345656
tf-idf-keyword
tf-idf-keyword
master

搜索帮助