Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word Cloud正确识别@用户名 #367 #432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/analysis/analysis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
from collections import Counter
import sys
from datetime import datetime
Expand Down Expand Up @@ -28,6 +29,7 @@ def wordcloud_(wxid, time_range=None):
}
# text = ''.join(map(lambda x: x[7], txt_messages))
text = ''.join(map(lambda x: x[7], txt_messages)) # 1“我”说的话,0“Ta”说的话
text = re.sub(r'^@\w+\s', '', text) # 去掉@的人

total_msg_len = len(text)
# 使用jieba进行分词,并加入停用词
Expand Down