KevSun commited on
Commit
0a8afbb
·
verified ·
1 Parent(s): f0971d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -29,15 +29,15 @@ if st.button("Predict"):
29
  predictions = predictions[0].tolist()
30
 
31
  # Convert predictions to a NumPy array for the calculations
32
- predictions_np = np.array(predictions)
33
 
34
  # Scale the predictions
35
- scaled_scores = 2.25 * predictions_np - 1.25
36
- rounded_scores = [round(score * 2) / 2 for score in scaled_scores] # Round to nearest 0.5
37
 
38
  # Display the predictions
39
  labels = ["cohesion", "syntax", "vocabulary", "phraseology", "grammar", "conventions"]
40
- for label, score in zip(labels, rounded_scores):
41
  st.write(f"{label}: {score:.4f}")
42
  else:
43
  st.write("Please enter some text to get scores.")
 
29
  predictions = predictions[0].tolist()
30
 
31
  # Convert predictions to a NumPy array for the calculations
32
+ # predictions_np = np.array(predictions)
33
 
34
  # Scale the predictions
35
+ # scaled_scores = 2.25 * predictions_np - 1.25
36
+ # rounded_scores = [round(score * 2) / 2 for score in scaled_scores] # Round to nearest 0.5
37
 
38
  # Display the predictions
39
  labels = ["cohesion", "syntax", "vocabulary", "phraseology", "grammar", "conventions"]
40
+ for label, score in zip(labels, predictions):
41
  st.write(f"{label}: {score:.4f}")
42
  else:
43
  st.write("Please enter some text to get scores.")