shrut27 commited on
Commit
df671ff
·
verified ·
1 Parent(s): 60b5240

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -25
app.py CHANGED
@@ -1,34 +1,54 @@
1
  import streamlit as st
2
  import pandas as pd
3
 
4
- ### streamlit run c:/Users/karim/OneDrive/Documents/Python/webapp/app.py
5
 
6
- st.title("Topic Modeling to determine climate anxiety among youth")
 
7
 
8
- st.header("Our mission and plan", divider='red')
 
9
 
10
- st.markdown("We're using BERTopic and LDA as a baseline model")
 
11
 
12
- page = st.selectbox('Select a page', ['modeling', 'LDA'])
 
13
 
14
- import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- # Create a dropdown in the sidebar for selecting page categories
17
- category = st.sidebar.selectbox('Choose a category', ['General Info', 'Contact Info'])
18
-
19
- # Display pages based on selected category
20
- if category == 'General Info':
21
- page = st.sidebar.selectbox('Select a page', ['1_sentiment_analysis'])
22
- if page == '1_sentiment_analysis':
23
- st.write('1_sentiment_analysis')
24
- # Add content specific to the Home page
25
-
26
-
27
- elif category == 'Contact Info':
28
- page = st.sidebar.selectbox('Select a page', ['2_modeling', '3_LDA'])
29
- if page == '2_modeling':
30
- st.write('2_modeling:')
31
- # Add content specific to the Contact page
32
- elif page == '3_LDA':
33
- st.write('3_LDA!')
34
- # Add content specific to the About page
 
1
  import streamlit as st
2
  import pandas as pd
3
 
4
+ st.title("Topic Modeling to Determine Climate Anxiety Among Youth")
5
 
6
+ st.header("Our Mission and Plan", divider='red')
7
+ st.markdown("We're using **BERTopic** and **LDA** as baseline models.")
8
 
9
+ if "page" not in st.session_state:
10
+ st.session_state.page = "Home"
11
 
12
+ def navigate_to(page):
13
+ st.session_state.page = page
14
 
15
+ st.subheader("Select a Section:")
16
+ col1, col2, col3, col4 = st.columns(4)
17
 
18
+ with col1:
19
+ if st.button("Home"):
20
+ navigate_to("Home")
21
+
22
+ with col2:
23
+ if st.button("Sentiment Analysis"):
24
+ navigate_to("Sentiment Analysis")
25
+
26
+ with col3:
27
+ if st.button("Topic Modelling"):
28
+ navigate_to("Topic Modelling")
29
+
30
+ with col4:
31
+ if st.button("LDA"):
32
+ navigate_to("LDA")
33
+
34
+ st.divider()
35
+
36
+ if st.session_state.page == "Home":
37
+ st.header("Home Page")
38
+
39
+ elif st.session_state.page == "Sentiment Analysis":
40
+ st.header("Sentiment Analysis")
41
+
42
+ elif st.session_state.page == "Topic Modelling":
43
+ st.header("Topic Modelling")
44
+
45
+ elif st.session_state.page == "LDA":
46
+ st.header("Latent Dirichlet Allocation (LDA)")
47
+
48
+ st.divider()
49
+
50
+ if st.button("Contact Info"):
51
+ st.session_state.page = "Contact Info"
52
 
53
+ if st.session_state.page == "Contact Info":
54
+ st.header("Contact Information")