Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
|
| 6 |
from textblob import TextBlob
|
| 7 |
import nltk
|
| 8 |
from wordcloud import WordCloud
|
| 9 |
-
import base64
|
| 10 |
from io import BytesIO
|
| 11 |
import numpy as np
|
| 12 |
from sklearn.linear_model import LinearRegression
|
|
@@ -36,7 +36,7 @@ def generate_wordcloud(text):
|
|
| 36 |
wordcloud = WordCloud(width=800, height=400, background_color="white", stopwords=stopwords).generate(text)
|
| 37 |
buf = BytesIO()
|
| 38 |
wordcloud.to_image().save(buf, format="PNG")
|
| 39 |
-
return base64.b64encode(buf.getvalue()).decode()
|
| 40 |
|
| 41 |
|
| 42 |
# --------------------------
|
|
|
|
| 6 |
from textblob import TextBlob
|
| 7 |
import nltk
|
| 8 |
from wordcloud import WordCloud
|
| 9 |
+
import base64
|
| 10 |
from io import BytesIO
|
| 11 |
import numpy as np
|
| 12 |
from sklearn.linear_model import LinearRegression
|
|
|
|
| 36 |
wordcloud = WordCloud(width=800, height=400, background_color="white", stopwords=stopwords).generate(text)
|
| 37 |
buf = BytesIO()
|
| 38 |
wordcloud.to_image().save(buf, format="PNG")
|
| 39 |
+
return base64.b64encode(buf.getvalue()).decode()
|
| 40 |
|
| 41 |
|
| 42 |
# --------------------------
|