AIEcosystem commited on
Commit
a247bc0
·
verified ·
1 Parent(s): dfd8346

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +28 -17
src/streamlit_app.py CHANGED
@@ -21,12 +21,12 @@ st.set_page_config(
21
  st.markdown(
22
  """
23
  <style>
24
- /* ... (your CSS styles here, as they were mostly fine) ... */
25
  .stApp {
26
  background: linear-gradient(135deg, #f0f8ff, #f5f0ff, #fff0f5);
27
  color: #000000;
28
  font-family: 'Inter', sans-serif;
29
  }
 
30
  .stButton > button {
31
  background-color: #FF69B4;
32
  color: #FFFFFF;
@@ -35,11 +35,20 @@ st.markdown(
35
  transition: all 0.2s ease-in-out;
36
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
37
  }
 
38
  .stButton > button:hover {
39
  background-color: #FFB6C1;
40
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
41
  transform: translateY(-2px);
42
  }
 
 
 
 
 
 
 
 
43
  </style>
44
  """,
45
  unsafe_allow_html=True
@@ -57,7 +66,7 @@ if not comet_initialized:
57
  # --- UI Header and Notes ---
58
  st.subheader("AcademiaMiner", divider="rainbow")
59
  st.link_button("by nlpblogs", "https://nlpblogs.com", type="tertiary")
60
- expander = st.expander("**Important notes*")
61
  expander.write('''**Named Entities:** This AcademiaMiner extracts keyphrases from English academic and scientific papers.
62
 
63
  Results are presented in easy-to-read tables, visualized in an interactive tree map, pie chart and bar chart, and are available for download along with a Glossary of tags.
@@ -68,7 +77,9 @@ Results are presented in easy-to-read tables, visualized in an interactive tree
68
 
69
  **Supported Languages:** English
70
 
71
- **Technical issues:** If your connection times out, please refresh the page or reopen the app's URL. For any errors or inquiries, please contact us at [email protected]''')
 
 
72
 
73
  with st.sidebar:
74
  st.write("Use the following code to embed the AcademiaMiner web app on your website. Feel free to adjust the width and height values to fit your page.")
@@ -78,12 +89,7 @@ with st.sidebar:
78
  frameborder="0"
79
  width="850"
80
  height="450"
81
- ></iframe>
82
-
83
-
84
-
85
-
86
-
87
  '''
88
  st.code(code, language="html")
89
  st.text("")
@@ -171,11 +177,11 @@ if st.button("Results"):
171
  st.dataframe(df, use_container_width=True)
172
  with st.expander("See Glossary of tags"):
173
  st.write('''
174
- **word**: ['keyphrase extracted from your text data']
175
- **score**: ['accuracy score; how accurately a tag has been assigned']
176
- **label**: ['label (tag) assigned to a given extracted keyphrase']
177
- **start**: ['index of the start of the corresponding entity']
178
- **end**: ['index of the end of the corresponding entity']
179
  ''')
180
 
181
  # --- Most Frequent Keyphrases ---
@@ -198,7 +204,12 @@ if st.button("Results"):
198
  color='count',
199
  color_continuous_scale=px.colors.sequential.Viridis
200
  )
201
- fig_frequent_bar.update_layout(yaxis={'categoryorder': 'total ascending'})
 
 
 
 
 
202
  st.plotly_chart(fig_frequent_bar, use_container_width=True)
203
  if experiment:
204
  experiment.log_figure(figure=fig_frequent_bar, figure_name="frequent_keyphrases_bar_chart")
@@ -215,7 +226,7 @@ if st.button("Results"):
215
  color='word',
216
  color_continuous_scale=px.colors.sequential.Plasma
217
  )
218
- fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25))
219
  st.plotly_chart(fig_treemap, use_container_width=True)
220
  if experiment:
221
  experiment.log_figure(figure=fig_treemap, figure_name="entity_treemap")
@@ -241,7 +252,7 @@ if st.button("Results"):
241
 
242
  with stylable_container(
243
  key="download_button",
244
- css_styles="""button { background-color: yellow; border: 1px solid black; padding: 5px; color: black; }""",
245
  ):
246
  st.download_button(
247
  label="Download zip file",
 
21
  st.markdown(
22
  """
23
  <style>
 
24
  .stApp {
25
  background: linear-gradient(135deg, #f0f8ff, #f5f0ff, #fff0f5);
26
  color: #000000;
27
  font-family: 'Inter', sans-serif;
28
  }
29
+
30
  .stButton > button {
31
  background-color: #FF69B4;
32
  color: #FFFFFF;
 
35
  transition: all 0.2s ease-in-out;
36
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
37
  }
38
+
39
  .stButton > button:hover {
40
  background-color: #FFB6C1;
41
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
42
  transform: translateY(-2px);
43
  }
44
+
45
+ /* Text Area background and text color */
46
+ .stTextArea textarea {
47
+ background-color: #FFC0CB; /* A nice pink color */
48
+ color: #000000;
49
+ border: 1px solid #FF69B4; /* A pink border to match the button */
50
+ }
51
+
52
  </style>
53
  """,
54
  unsafe_allow_html=True
 
66
  # --- UI Header and Notes ---
67
  st.subheader("AcademiaMiner", divider="rainbow")
68
  st.link_button("by nlpblogs", "https://nlpblogs.com", type="tertiary")
69
+ expander = st.expander("**Important notes**")
70
  expander.write('''**Named Entities:** This AcademiaMiner extracts keyphrases from English academic and scientific papers.
71
 
72
  Results are presented in easy-to-read tables, visualized in an interactive tree map, pie chart and bar chart, and are available for download along with a Glossary of tags.
 
77
 
78
  **Supported Languages:** English
79
 
80
+ **Technical issues:** If your connection times out, please refresh the page or reopen the app's URL.
81
+
82
+ For any errors or inquiries, please contact us at [email protected]''')
83
 
84
  with st.sidebar:
85
  st.write("Use the following code to embed the AcademiaMiner web app on your website. Feel free to adjust the width and height values to fit your page.")
 
89
  frameborder="0"
90
  width="850"
91
  height="450"
92
+ ></iframe>
 
 
 
 
 
93
  '''
94
  st.code(code, language="html")
95
  st.text("")
 
177
  st.dataframe(df, use_container_width=True)
178
  with st.expander("See Glossary of tags"):
179
  st.write('''
180
+ -**word**: ['keyphrase extracted from your text data']
181
+ -**score**: ['accuracy score; how accurately a tag has been assigned']
182
+ -**label**: ['label (tag) assigned to a given extracted keyphrase']
183
+ -**start**: ['index of the start of the corresponding entity']
184
+ -**end**: ['index of the end of the corresponding entity']
185
  ''')
186
 
187
  # --- Most Frequent Keyphrases ---
 
204
  color='count',
205
  color_continuous_scale=px.colors.sequential.Viridis
206
  )
207
+ fig_frequent_bar.update_layout(
208
+ yaxis={'categoryorder': 'total ascending'},
209
+ paper_bgcolor='#000000', # Sets the background color of the entire figure
210
+ plot_bgcolor='#000000' # Sets the background color of the plotting area
211
+ )
212
+
213
  st.plotly_chart(fig_frequent_bar, use_container_width=True)
214
  if experiment:
215
  experiment.log_figure(figure=fig_frequent_bar, figure_name="frequent_keyphrases_bar_chart")
 
226
  color='word',
227
  color_continuous_scale=px.colors.sequential.Plasma
228
  )
229
+ fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25), paper_bgcolor='#000000', plot_bgcolor='#000000')
230
  st.plotly_chart(fig_treemap, use_container_width=True)
231
  if experiment:
232
  experiment.log_figure(figure=fig_treemap, figure_name="entity_treemap")
 
252
 
253
  with stylable_container(
254
  key="download_button",
255
+ css_styles="""button { background-color: red; border: 1px solid black; padding: 5px; color: white; }""",
256
  ):
257
  st.download_button(
258
  label="Download zip file",