问题描述
我已经清理了数据
def get_stop_words(stop_file_path):
"""load stop words """
with open(stop_file_path,'r',encoding="utf-8") as f:
stopwords = f.readlines()
stop_set = set(m.strip() for m in stopwords)
return frozenset(stop_set)
#load a set of stop words
stopwords=get_stop_words("stopwords.txt")
def pre_process(text):
# lowercase
text=text.lower()
# remove tags
text=re.sub("</?.*?>"," <> ",text)
# remove special characters and digits
text=re.sub("(\\d|\\W|_)+"," ",text)
# tokenization
tokens = re.split('\W+',text)
# Stopwords and Lemmatization
text = " ".join([wn.lemmatize(word) for word in tokens if word not in stopwords])
return text
text_clean = dat['text'].apply(lambda x:pre_process(x))
我在 excel 中总共有 2210 行,我想总结每个文本。我是 python 新手,因此,我不知道如何去做。有人可以帮忙吗:(
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)