【发布时间】:2020-11-02 01:44:37
【问题描述】:
我想删除每条推文中的所有停用词,但是我在下面收到此错误。
我尝试寻找解决方案来解决它,但我没有找到任何解决方案。
stop_words = set(stopwords.words('english'))
print(stop_words)
nltk.download('punkt')
for all_words in words_in_tweet:
for a word in all_words:
#this is the error
File "<ipython-input-59-ade5bcf99259>", line 3
for a word in all_words:
^
SyntaxError: invalid syntax
【问题讨论】:
-
你只需要写
for word in all_words:而不是for a word...
标签: python python-3.x jupyter-notebook data-mining sentiment-analysis