''WordListCorpusReader' object has no attribute 'add'
Code:
import re
import nltk
nltk.download('stopwords')
stopwords = stopwords
stopwords.add('will')
wordcloud = WordCloud(width = 3000, height = 2000, background_color='black', max_words=100,colormap='Set2',stopwords=stopwords).generate(text)
# Plot
plot_cloud(wordcloud)
Error:
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2724/2521944359.py in <module>
5
6 stopwords = stopwords
----> 7 stopwords.add('will')
8 wordcloud = WordCloud(width = 3000, height = 2000, background_color='black', max_words=100,colormap='Set2',stopwords=stopwords).generate(text)
9 # Plot
AttributeError: 'WordListCorpusReader' object has no attribute 'add'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
