Python学习之路-NLP(人物提取)
import osimport jieba.posseg as psgimport jiebaimport timeimport renovel = 'hlm'dir = './Text/'+novel#jieba.load_userdict(dir+'/mydict.txt')# 字典合并def combineListToDic(list): if len(list) <= 1: return list temp = {} for l i.