dhanikitkat commited on
Commit
9790e56
·
1 Parent(s): 52275d1
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -11,6 +11,8 @@ import matplotlib.pyplot as plt
11
  from wordcloud import WordCloud
12
  import numpy as np
13
  from PIL import ImageFont
 
 
14
 
15
  nltk.download('punkt')
16
 
@@ -51,7 +53,7 @@ def generate_wordcloud(text, font_path, title, colormap):
51
  width=600,
52
  height=600,
53
  background_color='white',
54
- font_path='assets\Poppins-Regular.ttf',
55
  prefer_horizontal=1.0,
56
  colormap=colormap,
57
  max_words=100
@@ -98,7 +100,7 @@ def combined_analysis(text, slank_formal_df):
98
  st.plotly_chart(fig_emotion, use_container_width=True)
99
 
100
  # Generate word clouds
101
- font_path = 'assets\Poppins-Regular.ttf'
102
 
103
  # Overall word cloud
104
  overall_text = ' '.join(df['Cleaned Content'].dropna())
@@ -162,7 +164,7 @@ def process_file(file, slank_formal_df):
162
  st.plotly_chart(fig_emotion, use_container_width=True)
163
 
164
  # Generate word clouds
165
- font_path = 'assets\Poppins-Regular.ttf'
166
 
167
  # Overall word cloud
168
  overall_text = ' '.join(df['Cleaned Content'].dropna())
 
11
  from wordcloud import WordCloud
12
  import numpy as np
13
  from PIL import ImageFont
14
+ import os
15
+
16
 
17
  nltk.download('punkt')
18
 
 
53
  width=600,
54
  height=600,
55
  background_color='white',
56
+ font_path=font_path,
57
  prefer_horizontal=1.0,
58
  colormap=colormap,
59
  max_words=100
 
100
  st.plotly_chart(fig_emotion, use_container_width=True)
101
 
102
  # Generate word clouds
103
+ font_path = os.path.join('assets', 'Poppins-Regular.ttf')
104
 
105
  # Overall word cloud
106
  overall_text = ' '.join(df['Cleaned Content'].dropna())
 
164
  st.plotly_chart(fig_emotion, use_container_width=True)
165
 
166
  # Generate word clouds
167
+ font_path = os.path.join('assets', 'Poppins-Regular.ttf')
168
 
169
  # Overall word cloud
170
  overall_text = ' '.join(df['Cleaned Content'].dropna())