Python 结巴分词停止词及自定义词库
2017-08-28 17:50
567 查看
# 自定义词库
f='g:/'+I[i]+'.txt'
jieba.load_userdict(f)
# 停止词
stopwords='G:/g/data/word/chinese_stopword.txt'
stop_single_words=[]
with open(stopwords,'r') as f:
for line in f:
content=line.strip()
stop_single_words.append(content.decode('utf8'))
# 分词时去除停止词
word_cut=table_x.ABSTRACT_ZH[[j,k]].apply(lambda s: [i for i in list(jieba.cut(s)) if i not in stop_single_words])
f='g:/'+I[i]+'.txt'
jieba.load_userdict(f)
# 停止词
stopwords='G:/g/data/word/chinese_stopword.txt'
stop_single_words=[]
with open(stopwords,'r') as f:
for line in f:
content=line.strip()
stop_single_words.append(content.decode('utf8'))
# 分词时去除停止词
word_cut=table_x.ABSTRACT_ZH[[j,k]].apply(lambda s: [i for i in list(jieba.cut(s)) if i not in stop_single_words])
相关文章推荐
- 基于Python结巴分词(调用自定义词库已经去除停用词)
- python调用jieba(结巴)分词 加入自定义词典和去停用词功能
- 结巴分词 0.14 版发布,Python 中文分词库
- python调用jieba(结巴)分词 加入自定义词典和去停用词功能
- ElasticSearch自定义分析器-集成结巴分词插件
- 用python通过结巴分词对语料库进行分词初步实现word2vec
- 【Python】用Python的“结巴”模块进行分词
- 对Python中文分词模块结巴分词算法过程的理解和分析
- python与自然语言处理 2结巴分词
- python中文分词:结巴分词
- python中结巴分词快速入门
- mmseg自定义分词词库
- python 结巴分词(jieba)学习
- Python 结巴分词(2)关键字提取
- Python中文分词模块结巴分词算法过程的理解和分析
- python 商品名称相似度查找(difflib库和结巴分词的运用)
- 结巴分词(Python中文分词组件)
- python 结巴分词(jieba)学习
- Python 结巴分词(1)分词
- python结巴分词以及词频统计实例