You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text = open('speech.txt', 'r', encoding='utf8').read()
#進行分詞
'''
cut_all=True, 全模式
我来到北京清华大学 ==> 我/ 来到/ 北京/ 清华/ 清华大学/ 华大/ 大学
cut_all=False, 精確模式
我来到北京清华大学 ==> 我/ 来到/ 北京/ 清华大学
'''
out = "".join(c for c in text if c not in (',','。','!',':','「','」','…','、','?','【','】','.',':','?',';','!','~','`','+','-','<','>','/','[',']','{','}',"'",'"'))