Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -279,9 +279,8 @@ def word_cloud_generator(parsed_text_name,text_Party):
|
|
| 279 |
if 'bjp' in parsed:
|
| 280 |
orgImg=Original_Image('BJPMain.jpg')
|
| 281 |
bwImg=Image_Processed('BJPMain.jpg')
|
| 282 |
-
plt.figure(figsize=(5,
|
| 283 |
-
wordCloud(orgImg,bwImg,
|
| 284 |
-
|
| 285 |
plt.tight_layout()
|
| 286 |
buf = BytesIO()
|
| 287 |
plt.savefig(buf)
|
|
@@ -294,7 +293,7 @@ def word_cloud_generator(parsed_text_name,text_Party):
|
|
| 294 |
elif 'congress' in parsed:
|
| 295 |
orgImg=Original_Image('congress3.jpeg')
|
| 296 |
bwImg=Image_Processed('congress3.jpeg')
|
| 297 |
-
plt.figure(figsize=(5,
|
| 298 |
wordCloud(orgImg,bwImg,text_Party,maxWord=3000,colorGener=True)
|
| 299 |
|
| 300 |
plt.tight_layout()
|
|
@@ -310,7 +309,7 @@ def word_cloud_generator(parsed_text_name,text_Party):
|
|
| 310 |
elif 'aap' in parsed:
|
| 311 |
orgImg=Original_Image('aapMain2.jpg')
|
| 312 |
bwImg=Image_Processed('aapMain2.jpg')
|
| 313 |
-
plt.figure(figsize=(5,
|
| 314 |
wordCloud(orgImg,bwImg,text_Party,maxWord=3000,colorGener=False,contCol='black')
|
| 315 |
|
| 316 |
plt.tight_layout()
|
|
@@ -323,7 +322,7 @@ def word_cloud_generator(parsed_text_name,text_Party):
|
|
| 323 |
|
| 324 |
else :
|
| 325 |
wordcloud = WordCloud(max_words=2000, background_color="white",mode="RGB").generate(text_Party)
|
| 326 |
-
plt.figure(figsize=(
|
| 327 |
plt.imshow(wordcloud, interpolation="bilinear")
|
| 328 |
plt.axis("off")
|
| 329 |
plt.tight_layout()
|
|
|
|
| 279 |
if 'bjp' in parsed:
|
| 280 |
orgImg=Original_Image('BJPMain.jpg')
|
| 281 |
bwImg=Image_Processed('BJPMain.jpg')
|
| 282 |
+
plt.figure(figsize=(5,4))
|
| 283 |
+
wordCloud(orgImg,bwImg,text_party,maxWord=3000,colorGen=True,contCol='white',bckColor='black'
|
|
|
|
| 284 |
plt.tight_layout()
|
| 285 |
buf = BytesIO()
|
| 286 |
plt.savefig(buf)
|
|
|
|
| 293 |
elif 'congress' in parsed:
|
| 294 |
orgImg=Original_Image('congress3.jpeg')
|
| 295 |
bwImg=Image_Processed('congress3.jpeg')
|
| 296 |
+
plt.figure(figsize=(5,4))
|
| 297 |
wordCloud(orgImg,bwImg,text_Party,maxWord=3000,colorGener=True)
|
| 298 |
|
| 299 |
plt.tight_layout()
|
|
|
|
| 309 |
elif 'aap' in parsed:
|
| 310 |
orgImg=Original_Image('aapMain2.jpg')
|
| 311 |
bwImg=Image_Processed('aapMain2.jpg')
|
| 312 |
+
plt.figure(figsize=(5,4))
|
| 313 |
wordCloud(orgImg,bwImg,text_Party,maxWord=3000,colorGener=False,contCol='black')
|
| 314 |
|
| 315 |
plt.tight_layout()
|
|
|
|
| 322 |
|
| 323 |
else :
|
| 324 |
wordcloud = WordCloud(max_words=2000, background_color="white",mode="RGB").generate(text_Party)
|
| 325 |
+
plt.figure(figsize=(5,5))
|
| 326 |
plt.imshow(wordcloud, interpolation="bilinear")
|
| 327 |
plt.axis("off")
|
| 328 |
plt.tight_layout()
|