Spaces:
Running
Running
Yara Kyrychenko
commited on
Commit
·
d7d7660
1
Parent(s):
254776f
upd pers
Browse files- app.py +7 -5
- personalization.txt +16 -23
app.py
CHANGED
@@ -60,7 +60,7 @@ if 'inserted' not in st.session_state:
|
|
60 |
|
61 |
# user info state
|
62 |
st.session_state.fields = [
|
63 |
-
'climate_actions', 'age', 'gender', 'education', 'residence', 'property',
|
64 |
'politics', 'impact_open', 'ev',
|
65 |
'fossil', 'aerosol', 'diet', 'recycling',
|
66 |
'user_id'
|
@@ -140,12 +140,14 @@ def form():
|
|
140 |
"Bachelor's (college) degree or equivalent",
|
141 |
"Graduate degree (e.g., Master's degree, MBA)",
|
142 |
'Doctorate degree (e.g., PhD, MD)'])
|
|
|
143 |
st.session_state.residence = st.radio("What type of a community do you live in?",
|
144 |
['', 'Urban','Suburban','Rural','Other'])
|
145 |
st.session_state.property = st.radio("Do you own or rent the home in which you live?",
|
146 |
-
['', 'Own','Rent','Neither (I live rent-free)',
|
147 |
-
|
148 |
-
|
|
|
149 |
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.')
|
150 |
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?')
|
151 |
|
@@ -161,7 +163,7 @@ def form():
|
|
161 |
columns_form = st.columns((1,1,1))
|
162 |
with columns_form[2]:
|
163 |
submitted = st.button("Proceed",use_container_width=True,
|
164 |
-
help = 'Make sure you answer every question
|
165 |
disabled = not (all(st.session_state[field] != '' for field in st.session_state.fields) and st.session_state.recycling != 0))
|
166 |
|
167 |
if submitted:
|
|
|
60 |
|
61 |
# user info state
|
62 |
st.session_state.fields = [
|
63 |
+
'climate_actions', 'age', 'gender', 'education', 'residence', 'property', 'car',
|
64 |
'politics', 'impact_open', 'ev',
|
65 |
'fossil', 'aerosol', 'diet', 'recycling',
|
66 |
'user_id'
|
|
|
140 |
"Bachelor's (college) degree or equivalent",
|
141 |
"Graduate degree (e.g., Master's degree, MBA)",
|
142 |
'Doctorate degree (e.g., PhD, MD)'])
|
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.residence = st.radio("What type of a community do you live in?",
|
145 |
['', 'Urban','Suburban','Rural','Other'])
|
146 |
st.session_state.property = st.radio("Do you own or rent the home in which you live?",
|
147 |
+
['', 'Own', 'Rent', 'Neither (I live rent-free)', 'Other' ])
|
148 |
+
st.session_state.car = st.radio("Do you own or lease a car?",
|
149 |
+
['', 'Own', 'Lease', 'Neither (I do not own or lease a car)'])
|
150 |
+
|
151 |
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.')
|
152 |
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?')
|
153 |
|
|
|
163 |
columns_form = st.columns((1,1,1))
|
164 |
with columns_form[2]:
|
165 |
submitted = st.button("Proceed",use_container_width=True,
|
166 |
+
help = 'Make sure you answer every question',
|
167 |
disabled = not (all(st.session_state[field] != '' for field in st.session_state.fields) and st.session_state.recycling != 0))
|
168 |
|
169 |
if submitted:
|
personalization.txt
CHANGED
@@ -9,33 +9,26 @@ The participant has the following attributes:
|
|
9 |
- Age: [AGE] years
|
10 |
- Gender: [GENDER]
|
11 |
- Education: [EDUCATION]
|
|
|
12 |
- Residence: [RESIDENCE]
|
13 |
-
|
14 |
-
|
|
|
|
|
15 |
|
16 |
# User Climate Actions and Beliefs
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
-
|
21 |
-
|
22 |
-
-
|
23 |
-
|
24 |
-
|
25 |
-
-
|
26 |
-
-
|
27 |
-
|
28 |
-
-
|
29 |
-
- User Response: [EV]
|
30 |
-
Diet:
|
31 |
-
- Statement: 'Lab-grown meat produces up to 25 times more CO2 than real meat.'
|
32 |
-
- User Response: [DIET]
|
33 |
-
Fossil Fuel Industry:
|
34 |
-
- Statement: 'The fossil fuel industry is trying to shift the blame away from themselves by emphasizing the importance of individual climate action.'
|
35 |
-
- User Response: [FOSSIL]
|
36 |
-
Aerosols:
|
37 |
-
- Statement: 'The use of aerosol spray cans is a major cause of climate change.'
|
38 |
-
- User Response: [AEROSOL]
|
39 |
|
40 |
# Your Expertise
|
41 |
|
|
|
9 |
- Age: [AGE] years
|
10 |
- Gender: [GENDER]
|
11 |
- Education: [EDUCATION]
|
12 |
+
- Political orientation: [POLITICS]
|
13 |
- Residence: [RESIDENCE]
|
14 |
+
|
15 |
+
The participant provided the following information:
|
16 |
+
- 'Do you own or rent the home in which you live?' Participant Response: [PROPERTY]
|
17 |
+
- 'Do you own or lease a car?' Participant Response: [CAR]
|
18 |
|
19 |
# User Climate Actions and Beliefs
|
20 |
|
21 |
+
- 'What do you believe is the single most effective action you can take to reduce carbon emissions that contribute to climate change?' Participant Response: [IMPACT_OPEN]
|
22 |
+
|
23 |
+
- 'Do you take any actions with the aim of reducing your carbon emissions and reducing your contribution to climate change?' Participant Response: [CLIMATE_ACTIONS]
|
24 |
+
|
25 |
+
- 'What percentage of plastic produced gets recycled globally?' Participant Response: [RECYCLING]%
|
26 |
+
|
27 |
+
When asked 'Do you agree or disagree with the following statements?' the participant responded:
|
28 |
+
- 'Electric vehicles don’t have enough range to handle daily travel demands.' Participant Response: [EV]
|
29 |
+
- 'Lab-grown meat produces up to 25 times more CO2 than real meat.' Participant Response: [DIET]
|
30 |
+
- 'The fossil fuel industry is trying to shift the blame away from themselves by emphasizing the importance of individual climate action.' Participant Response: [FOSSIL]
|
31 |
+
- 'The use of aerosol spray cans is a major cause of climate change.' Participant Response: [AEROSOL]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
# Your Expertise
|
34 |
|