peter2000 commited on
Commit
de5a6d2
β€’
1 Parent(s): 84afe69

Update appStore/sdg_analysis.py

Browse files
Files changed (1) hide show
  1. appStore/sdg_analysis.py +13 -2
appStore/sdg_analysis.py CHANGED
@@ -77,18 +77,29 @@ def app():
77
  keyphrase_ngram_range=(1, 3),
78
  use_mmr=True,
79
  stop_words="english",
80
- top_n=5,
81
  diversity=0.7,
82
  )
83
 
84
  st.markdown("## 🎈 What is my document about?")
 
 
85
 
86
  df = (
87
  DataFrame(keywords, columns=["Keyword/Keyphrase", "Relevancy"])
88
  .sort_values(by="Relevancy", ascending=False)
89
  .reset_index(drop=True)
90
  )
91
-
 
 
 
 
 
 
 
 
 
92
  df.index += 1
93
 
94
  # Add styling
 
77
  keyphrase_ngram_range=(1, 3),
78
  use_mmr=True,
79
  stop_words="english",
80
+ top_n=10,
81
  diversity=0.7,
82
  )
83
 
84
  st.markdown("## 🎈 What is my document about?")
85
+
86
+
87
 
88
  df = (
89
  DataFrame(keywords, columns=["Keyword/Keyphrase", "Relevancy"])
90
  .sort_values(by="Relevancy", ascending=False)
91
  .reset_index(drop=True)
92
  )
93
+
94
+ # Create and generate a word cloud image:
95
+ text = ' '.join(word for word in df["Keyword/Keyphrase"]
96
+ wordcloud = WordCloud().generate(text)
97
+
98
+ # Display the generated image:
99
+ plt.imshow(wordcloud, interpolation='bilinear')
100
+ plt.axis("off")
101
+ plt.show()
102
+ st.pyplot()
103
  df.index += 1
104
 
105
  # Add styling