Commit
·
6fc6f3c
1
Parent(s):
12b9aeb
Update app.py
Browse files
app.py
CHANGED
@@ -117,11 +117,25 @@ plt.imshow(wordcloud)
|
|
117 |
plt.axis('off')
|
118 |
plt.show()
|
119 |
fig.savefig("word1.png", dpi=900)
|
120 |
-
|
121 |
from sklearn.feature_extraction.text import CountVectorizer
|
122 |
import re
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
from sklearn.feature_extraction.text import CountVectorizer
|
127 |
|
|
|
117 |
plt.axis('off')
|
118 |
plt.show()
|
119 |
fig.savefig("word1.png", dpi=900)
|
|
|
120 |
from sklearn.feature_extraction.text import CountVectorizer
|
121 |
import re
|
122 |
+
|
123 |
+
# Assuming you have the 'corpus' defined
|
124 |
+
# and 'stop_words' defined as in your previous code
|
125 |
+
|
126 |
+
# Create a CountVectorizer with predefined English stop words
|
127 |
+
cv = CountVectorizer(max_df=0.8, stop_words='english', max_features=10000, ngram_range=(1, 3))
|
128 |
+
X = cv.fit_transform(corpus)
|
129 |
+
|
130 |
+
# Alternatively, use your custom stop words
|
131 |
+
custom_stop_words = ['same', 'hers', 'they', 'with', 'if', 'y', 'iv', 'new', ...] # Add your custom stop words
|
132 |
+
cv = CountVectorizer(max_df=0.8, stop_words=custom_stop_words, max_features=10000, ngram_range=(1, 3))
|
133 |
+
X = cv.fit_transform(corpus)
|
134 |
+
|
135 |
+
#from sklearn.feature_extraction.text import CountVectorizer
|
136 |
+
#import re
|
137 |
+
#cv=CountVectorizer(max_df=0.8,stop_words=stop_words, max_features=10000, ngram_range=(1,3))
|
138 |
+
#X=cv.fit_transform(corpus)
|
139 |
|
140 |
from sklearn.feature_extraction.text import CountVectorizer
|
141 |
|