下载相关依赖包:
pip install zhon
import re
from zhon.hanzi import punctuation
def deleteChinese(text):
text = re.sub('[u4e00-u9fa5]', '', text)
text = re.sub('[{}]'.format(punctuation), "", text)
return text

下载相关依赖包:
pip install zhon
import re
from zhon.hanzi import punctuation
def deleteChinese(text):
text = re.sub('[u4e00-u9fa5]', '', text)
text = re.sub('[{}]'.format(punctuation), "", text)
return text