Yara Kyrychenko commited on
Commit
9c3cfcb
·
1 Parent(s): 2a3f220

fix formatting and ncond

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -120,7 +120,7 @@ with st.sidebar:
120
 
121
  @st.dialog('Form')
122
  def form():
123
- #with st.form("Form",border=False, enter_to_submit=False):
124
  st.session_state.age = st.text_input("How old are you in years?")
125
  st.session_state.gender = st.radio("Do you describe yourself as a man, a woman, or in some other way?",
126
  ['','Man', 'Woman', 'Other'])
@@ -141,12 +141,12 @@ def form():
141
  #st.session_state.income = st.radio("What was your total household income before taxes during the past 12 months?",
142
  # ['','Less than \$25,000','\$25,000 to \$49,999','\$50,000 to \$74,999','\$75,000 to \$99,999','\$100,000 to \$149,999','\$150,000 or more'])
143
  st.session_state.politics = st.radio('What is your political orientation?', ['', 'Extremely liberal', 'Liberal', 'Slightly liberal', 'Moderate', 'Slightly conservative', 'Conservative', 'Extremely conservative'])
144
- st.session_state.climate_actions = st.text_area('Please describe any actions you are taking to address climate change? Write "None" if you are not taking any.')
145
  st.session_state.impact_open = st.text_area('What do you believe is the single most effective action you can take to reduce carbon emissions that contribute to climate change?')
146
 
147
  st.session_state.recycling = st.slider('What percentage of plastic produced gets recycled?', 0, 100, value=0)
148
 
149
- st.markdown("Do you agree or disagree with the following statements?")
150
  st.session_state.ev = st.radio("Electric vehicles don't have enough range to handle daily travel demands.", ["", "Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"])
151
  st.session_state.fossil = st.radio('The fossil fuel industry is trying to shift the blame away from themselves by emphasizing the importance of individual climate action.', ["", "Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"])
152
  st.session_state.aerosol = st.radio('The use of aerosol spray cans is a major cause of climate change.', ["", "Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"])
@@ -168,7 +168,7 @@ def form():
168
  st.rerun()
169
 
170
  elif submitted and not all_form_completed:
171
- st.warning('Please complete every entry of the form and click "Proceed" again to start a conversation.')
172
 
173
 
174
  #st.write(st.session_state.system_message)
@@ -191,6 +191,7 @@ def submit():
191
  st.slider('❗ How knowledgeable do you feel the chatbot was, on a scale from *Not at all* to *Extremely knowledgeable*?', 0, 100, format="", key="knowledge_score", value=50)
192
  else:
193
  st.session_state.score = 51
 
194
  st.session_state.knowledge_score = 51
195
 
196
  st.text_area('Any feedback?',key="feedback")
@@ -201,6 +202,7 @@ def submit():
201
  "conversation":st.session_state.messages,
202
  "score":st.session_state.score,
203
  "personalization_score":st.session_state.personalization_score,
 
204
  "model":st.session_state["model"],
205
  #"user_info":st.session_state.user_info,
206
  "feedback":st.session_state.feedback,
 
120
 
121
  @st.dialog('Form')
122
  def form():
123
+ st.markdown("**Please answer every question to proceed.**")
124
  st.session_state.age = st.text_input("How old are you in years?")
125
  st.session_state.gender = st.radio("Do you describe yourself as a man, a woman, or in some other way?",
126
  ['','Man', 'Woman', 'Other'])
 
141
  #st.session_state.income = st.radio("What was your total household income before taxes during the past 12 months?",
142
  # ['','Less than \$25,000','\$25,000 to \$49,999','\$50,000 to \$74,999','\$75,000 to \$99,999','\$100,000 to \$149,999','\$150,000 or more'])
143
  st.session_state.politics = st.radio('What is your political orientation?', ['', 'Extremely liberal', 'Liberal', 'Slightly liberal', 'Moderate', 'Slightly conservative', 'Conservative', 'Extremely conservative'])
144
+ st.session_state.climate_actions = st.text_area('Please describe any actions you are taking to address climate change? Write *None* if you are not taking any.')
145
  st.session_state.impact_open = st.text_area('What do you believe is the single most effective action you can take to reduce carbon emissions that contribute to climate change?')
146
 
147
  st.session_state.recycling = st.slider('What percentage of plastic produced gets recycled?', 0, 100, value=0)
148
 
149
+ st.markdown("**Do you agree or disagree with the following statements?**")
150
  st.session_state.ev = st.radio("Electric vehicles don't have enough range to handle daily travel demands.", ["", "Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"])
151
  st.session_state.fossil = st.radio('The fossil fuel industry is trying to shift the blame away from themselves by emphasizing the importance of individual climate action.', ["", "Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"])
152
  st.session_state.aerosol = st.radio('The use of aerosol spray cans is a major cause of climate change.', ["", "Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"])
 
168
  st.rerun()
169
 
170
  elif submitted and not all_form_completed:
171
+ st.warning('Please answer every question and click *Proceed* again to start a conversation.')
172
 
173
 
174
  #st.write(st.session_state.system_message)
 
191
  st.slider('❗ How knowledgeable do you feel the chatbot was, on a scale from *Not at all* to *Extremely knowledgeable*?', 0, 100, format="", key="knowledge_score", value=50)
192
  else:
193
  st.session_state.score = 51
194
+ st.session_state.personalization_score = 51
195
  st.session_state.knowledge_score = 51
196
 
197
  st.text_area('Any feedback?',key="feedback")
 
202
  "conversation":st.session_state.messages,
203
  "score":st.session_state.score,
204
  "personalization_score":st.session_state.personalization_score,
205
+ "knowledge_score":st.session_state.knowledge_score,
206
  "model":st.session_state["model"],
207
  #"user_info":st.session_state.user_info,
208
  "feedback":st.session_state.feedback,