词云新增自定义词

This commit is contained in:
shuaikangzhou
2024-02-17 21:34:46 +08:00
parent 3d77a01748
commit 6feb0fc490
14 changed files with 155 additions and 81 deletions

View File

@@ -72,6 +72,7 @@ def wordcloud_(wxid, time_range=None):
def get_wordcloud(text):
total_msg_len = len(text)
jieba.load_userdict('./app/data/new_words.txt')
# 使用jieba进行分词并加入停用词
words = jieba.cut(text)
# 统计词频