"jieba path 结巴分词目录快速处理"

Published on Aug. 22, 2023, 12:07 p.m.

jieba path 结巴分词目录快速处理

项目地址<https://github.com/napoler/jieba_path>

安装

pip install jieba_path

使用

批量处理文件

from jieba_path import jieba_pathjpath = jieba_path.Jpath()#处理目录下的txt所有文件jpath.jieba_path('./data/', 'txt')#单个文件处理jpath.jieba_file('./data/001.txt')#获取目录下的txt文件列表jpath.file_List('./data/', 'txt')