Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 33 |
|
| 34 |
# Scale the predictions
|
| 35 |
-
|
| 36 |
-
|
| 37 |
|
| 38 |
# Display the predictions
|
| 39 |
labels = ["cohesion", "syntax", "vocabulary", "phraseology", "grammar", "conventions"]
|
| 40 |
-
for label, score in zip(labels,
|
| 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.")
|