johnpaulbin commited on
Commit
2d3a114
1 Parent(s): ca78d43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -203,14 +203,15 @@ def compute_bfi_scores(*args):
203
  # Determine the score category based on the trait's score range
204
  min_s = traits[trait]['min_score']
205
  max_s = traits[trait]['max_score']
206
- midpoint_low = min_s + (max_s - min_s) / 3
207
- midpoint_high = min_s + 2 * (max_s - min_s) / 3
 
208
 
209
- if score < midpoint_low:
210
  category = 'low'
211
- elif score < midpoint_high:
212
  category = 'medium_low'
213
- elif score < midpoint_high + (max_s - min_s)/3:
214
  category = 'medium_high'
215
  else:
216
  category = 'high'
@@ -220,7 +221,7 @@ def compute_bfi_scores(*args):
220
  markdown_output += f"{explanation}\n\n"
221
  trait_names.append(trait)
222
  trait_scores.append(score)
223
-
224
  # Generate bar chart
225
  image = None
226
  if trait_scores:
 
203
  # Determine the score category based on the trait's score range
204
  min_s = traits[trait]['min_score']
205
  max_s = traits[trait]['max_score']
206
+ range_third = (max_s - min_s) / 3
207
+ mid_low = min_s + range_third
208
+ mid_high = min_s + 2 * range_third
209
 
210
+ if score < mid_low:
211
  category = 'low'
212
+ elif score < mid_high:
213
  category = 'medium_low'
214
+ elif score < max_s:
215
  category = 'medium_high'
216
  else:
217
  category = 'high'
 
221
  markdown_output += f"{explanation}\n\n"
222
  trait_names.append(trait)
223
  trait_scores.append(score)
224
+
225
  # Generate bar chart
226
  image = None
227
  if trait_scores: