Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -220,6 +220,18 @@ with tab1:
|
|
| 220 |
df = df[['content','Class']]
|
| 221 |
|
| 222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
#show Classification Results
|
| 225 |
st.subheader("Classification Results")
|
|
|
|
| 220 |
df = df[['content','Class']]
|
| 221 |
|
| 222 |
|
| 223 |
+
# Word Cloud Visualization
|
| 224 |
+
def create_wordcloud(text_data):
|
| 225 |
+
text = ' '.join(text_data)
|
| 226 |
+
wordcloud = WordCloud(width=800, height=400).generate(text)
|
| 227 |
+
plt.figure(figsize=(10, 5))
|
| 228 |
+
plt.imshow(wordcloud, interpolation='bilinear')
|
| 229 |
+
plt.axis('off')
|
| 230 |
+
st.pyplot(plt)
|
| 231 |
+
|
| 232 |
+
st.subheader("Word Cloud of News Content")
|
| 233 |
+
create_wordcloud(df['content'])
|
| 234 |
+
|
| 235 |
|
| 236 |
#show Classification Results
|
| 237 |
st.subheader("Classification Results")
|