bjorn-hommel commited on
Commit
1ababcd
1 Parent(s): f4c9371
Files changed (1) hide show
  1. app.py +18 -14
app.py CHANGED
@@ -53,7 +53,9 @@ def show_demo(placeholder):
53
  Try it yourself by defining a scale structure using the input field
54
  below and let the **SurveyBot3000** predict the expected response
55
  pattern. Use the [YAML](https://yaml.org/) format or follow the structure
56
- outlined by the preset example.
 
 
57
  """)
58
 
59
  with st.form("submission_form"):
@@ -94,7 +96,7 @@ def show_demo(placeholder):
94
  except Exception as error:
95
  st.error(error)
96
  st.json(yaml_dict)
97
- return(None)
98
 
99
  try:
100
  st.session_state.input_data = modeling.encode_input_data()
@@ -103,6 +105,12 @@ def show_demo(placeholder):
103
  st.json(yaml_dict)
104
  return(None)
105
 
 
 
 
 
 
 
106
  if 'input_data' in st.session_state:
107
 
108
  if 'yaml_dict' in locals():
@@ -135,7 +143,7 @@ def show_demo(placeholder):
135
  st.dataframe(synthetic_scale_correlations, use_container_width=True)
136
 
137
  with tab3:
138
- st.markdown("alpha (Θ) = Synthetic Reliability Estimate")
139
  if np.min(modeling.get_items_per_scale()) < 3:
140
  st.error("Please make sure that each scale consits of at least 3 items!")
141
  else:
@@ -217,17 +225,13 @@ def main():
217
 
218
  st.markdown("""
219
 
220
- 📖 **Preprint (Open Access)**: https://osf.io/preprints/psyarxiv/kjuce
221
-
222
- 🖊️ **Cite**: *Hommel, B. E., & Arslan, R. C. (2024). Language models accurately infer correlations between psychological items and scales from text alone. https://doi.org/10.31234/osf.io/kjuce*
223
-
224
- 🌐 **Project website**: https://synth-science.github.io/surveybot3000/
225
-
226
- 💾 **Data**: https://osf.io/z47qs/
227
-
228
- #️⃣ **Social Media**:
229
- - [Björn Hommel on X/Twitter](https://twitter.com/BjoernHommel)
230
- - [Ruben Arslan on X/Twitter](https://twitter.com/rubenarslan/)
231
 
232
  The web application is maintained by [magnolia psychometrics](https://www.magnolia-psychometrics.com/).
233
  """, unsafe_allow_html=True)
 
53
  Try it yourself by defining a scale structure using the input field
54
  below and let the **SurveyBot3000** predict the expected response
55
  pattern. Use the [YAML](https://yaml.org/) format or follow the structure
56
+ outlined by the preset example:
57
+ - Scale names must end with "**:**"
58
+ - Nest items under a scale name by prepending "**-**" before each item
59
  """)
60
 
61
  with st.form("submission_form"):
 
96
  except Exception as error:
97
  st.error(error)
98
  st.json(yaml_dict)
99
+ return(None)
100
 
101
  try:
102
  st.session_state.input_data = modeling.encode_input_data()
 
105
  st.json(yaml_dict)
106
  return(None)
107
 
108
+ if os.environ.get('remote_model_path'):
109
+ n_items = st.session_state.input_data.shape[0]
110
+ if n_items > 50:
111
+ st.error(f"You've entered too many items ({n_items} on a 50 item limit)! Please contact bjoern.hommel@uni-leipzig.de if you require estimates of larger sets!")
112
+ return(None)
113
+
114
  if 'input_data' in st.session_state:
115
 
116
  if 'yaml_dict' in locals():
 
143
  st.dataframe(synthetic_scale_correlations, use_container_width=True)
144
 
145
  with tab3:
146
+ st.markdown("alpha (Θ) = Synthetic Reliability Estimate (Cronbach's Alpha)")
147
  if np.min(modeling.get_items_per_scale()) < 3:
148
  st.error("Please make sure that each scale consits of at least 3 items!")
149
  else:
 
225
 
226
  st.markdown("""
227
 
228
+ - 📖 **Preprint (Open Access)**: https://osf.io/preprints/psyarxiv/kjuce
229
+ - 🖊️ **Cite**: *Hommel, B. E., & Arslan, R. C. (2024). Language models accurately infer correlations between psychological items and scales from text alone. https://doi.org/10.31234/osf.io/kjuce*
230
+ - 🌐 **Project website**: https://synth-science.github.io/surveybot3000/
231
+ - 💾 **Data**: https://osf.io/z47qs/
232
+ - #️⃣ **Social Media**:
233
+ - Björn Hommel: [X/Twitter](https://twitter.com/BjoernHommel) | [ResearchGate](https://www.researchgate.net/profile/Bjoern-Hommel) | [Bsky](https://bsky.app/profile/bjoernhommel.bsky.social)
234
+ - Ruben Arslan: [X/Twitter](https://twitter.com/rubenarslan/) | [ResearchGate](https://www.researchgate.net/profile/Ruben_Arslan) | [Bsky](https://bsky.app/profile/ruben.the100.ci)
 
 
 
 
235
 
236
  The web application is maintained by [magnolia psychometrics](https://www.magnolia-psychometrics.com/).
237
  """, unsafe_allow_html=True)