nlp - 英文文本预处理
文章目录1.大小写转换2.去除标点符号3. 分词4.去除暂停词
1.大小写转换
sentence.lower()
2.去除标点符号
import string
punct = str.maketrans('','',string.punctuation)
sentence.translate.(punct)
3. 分词
按照空格分词就好。
sentence.split(' ')
4.去除暂停词
from nltk.corpus import stopwords
stop = set(stopword
原创
2021-10-25 15:10:54 ·
512 阅读 ·
0 评论