aug6th commited on
Commit
1c1190b
·
verified ·
1 Parent(s): 8f0b5c0

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +6 -1
src/streamlit_app.py CHANGED
@@ -1,4 +1,5 @@
1
  import streamlit as st
 
2
  import pandas as pd
3
  import plotly.express as px
4
  from datasets import load_dataset
@@ -127,6 +128,10 @@ st.markdown("---")
127
  # -----------------------------
128
  # WordCloud Section
129
  # -----------------------------
 
 
 
 
130
  st.subheader("☁️ Word Cloud")
131
 
132
  text_data = " ".join(filtered_df["text"].tolist())
@@ -138,7 +143,7 @@ if len(text_data) > 0:
138
  text_data = " ".join(sample_df["text"].tolist())
139
 
140
  wordcloud = WordCloud(
141
- font_path="./NanumGothic.ttf",
142
  background_color=None,
143
  mode="RGBA",
144
  colormap="viridis",
 
1
  import streamlit as st
2
+ import pathlib
3
  import pandas as pd
4
  import plotly.express as px
5
  from datasets import load_dataset
 
128
  # -----------------------------
129
  # WordCloud Section
130
  # -----------------------------
131
+
132
+ BASE_DIR = pathlib.Path(__file__).resolve().parent
133
+ FONT_PATH = BASE_DIR / "NanumGothic.ttf"
134
+
135
  st.subheader("☁️ Word Cloud")
136
 
137
  text_data = " ".join(filtered_df["text"].tolist())
 
143
  text_data = " ".join(sample_df["text"].tolist())
144
 
145
  wordcloud = WordCloud(
146
+ font_path=str(FONT_PATH),
147
  background_color=None,
148
  mode="RGBA",
149
  colormap="viridis",