Spaces:
Sleeping
Sleeping
Update Backend.py
Browse files- Backend.py +3 -4
Backend.py
CHANGED
@@ -155,7 +155,7 @@ def generate_plot(dropout_risk):
|
|
155 |
ax.set_title('Dropout Risk Prediction')
|
156 |
|
157 |
plt.savefig("dropout_plot.png") # Save before using in PDF
|
158 |
-
return fig
|
159 |
|
160 |
def remove_emojis(text):
|
161 |
"""Removes all emojis and unsupported Unicode characters from text."""
|
@@ -167,10 +167,9 @@ def process_and_generate_report(**input_values):
|
|
167 |
"""Processes input values and generates risk prediction along with a report."""
|
168 |
|
169 |
dropout_risk,risk_factor = predict_dropout(**input_values)
|
170 |
-
|
|
|
171 |
cleaned_insights = remove_emojis(insights)
|
172 |
-
fig = generate_plot(dropout_risk)
|
173 |
pdf_filename = generate_pdf(input_values, dropout_risk, cleaned_insights)
|
174 |
|
175 |
-
|
176 |
return fig, insights, pdf_filename
|
|
|
155 |
ax.set_title('Dropout Risk Prediction')
|
156 |
|
157 |
plt.savefig("dropout_plot.png") # Save before using in PDF
|
158 |
+
return fig ,labels[index]
|
159 |
|
160 |
def remove_emojis(text):
|
161 |
"""Removes all emojis and unsupported Unicode characters from text."""
|
|
|
167 |
"""Processes input values and generates risk prediction along with a report."""
|
168 |
|
169 |
dropout_risk,risk_factor = predict_dropout(**input_values)
|
170 |
+
fig, label = generate_plot(dropout_risk)
|
171 |
+
insights = generate_dropout_insights(input_values,risk_factor,label)
|
172 |
cleaned_insights = remove_emojis(insights)
|
|
|
173 |
pdf_filename = generate_pdf(input_values, dropout_risk, cleaned_insights)
|
174 |
|
|
|
175 |
return fig, insights, pdf_filename
|