自定义语料库后,在提取关键词时报错:“File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\jieba\analyse\tfidf.py", line 50, in set_new_path
word, freq = line.strip().split(' ')
ValueError: too many values to unpack (expected 2)”
源代码如下:
jieba.analyse.set_idf_path(r'C:/Users/Administrator/Desktop/分词/语料库.txt')
keywords = jieba.analyse.extract_tags(words, topK=10, withWeight=True)
print('\n(TF-IDF提取的关键词:)')
print(keywords)
不知道原因是什么