Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
|
14 |
# Commented out IPython magic to ensure Python compatibility.
|
15 |
|
16 |
-
|
17 |
import random
|
18 |
import matplotlib.pyplot as plt
|
19 |
import nltk
|
@@ -32,7 +32,8 @@ import textract
|
|
32 |
import urllib.request
|
33 |
import nltk.corpus
|
34 |
from nltk.text import Text
|
35 |
-
|
|
|
36 |
import sys
|
37 |
import pandas as pd
|
38 |
import cv2
|
@@ -204,7 +205,7 @@ def analysis(Manifesto,Search):
|
|
204 |
#plt.savefig('./sentimentAnalysis.png')
|
205 |
#plt.clf()
|
206 |
plt.tight_layout()
|
207 |
-
buf =
|
208 |
plt.savefig(buf)
|
209 |
buf.seek(0)
|
210 |
img1 = Image.open(buf)
|
|
|
13 |
|
14 |
# Commented out IPython magic to ensure Python compatibility.
|
15 |
|
16 |
+
|
17 |
import random
|
18 |
import matplotlib.pyplot as plt
|
19 |
import nltk
|
|
|
32 |
import urllib.request
|
33 |
import nltk.corpus
|
34 |
from nltk.text import Text
|
35 |
+
import io
|
36 |
+
from io import StringIO,BytesIO
|
37 |
import sys
|
38 |
import pandas as pd
|
39 |
import cv2
|
|
|
205 |
#plt.savefig('./sentimentAnalysis.png')
|
206 |
#plt.clf()
|
207 |
plt.tight_layout()
|
208 |
+
buf = BytesIO()
|
209 |
plt.savefig(buf)
|
210 |
buf.seek(0)
|
211 |
img1 = Image.open(buf)
|