Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -126,24 +126,24 @@ def main():
|
|
126 |
if st.button("Grade Essays"):
|
127 |
if example_files and scores_file and new_file:
|
128 |
|
129 |
-
|
130 |
-
|
131 |
|
132 |
-
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
|
146 |
-
st.success("Grading completed for
|
147 |
else:
|
148 |
st.error("Please upload a proposal in pdf")
|
149 |
|
|
|
126 |
if st.button("Grade Essays"):
|
127 |
if example_files and scores_file and new_file:
|
128 |
|
129 |
+
# Grading the new essay using the provided barem and example graded essays
|
130 |
+
result = grade_essay(new_file, example_files, barem)
|
131 |
|
132 |
+
# Parse feedback into barem components
|
133 |
+
parsed_scores = parse_feedback(result)
|
134 |
|
135 |
+
# Store results in session state
|
136 |
+
st.session_state.results.append({
|
137 |
+
'Essay File': new_file.name,
|
138 |
+
**parsed_scores,
|
139 |
+
'Feedback': result,
|
140 |
+
})
|
141 |
|
142 |
+
# Display the grading feedback
|
143 |
+
st.write("Feedback:")
|
144 |
+
st.write(result)
|
145 |
|
146 |
+
st.success("Grading completed for uploaded proposal.")
|
147 |
else:
|
148 |
st.error("Please upload a proposal in pdf")
|
149 |
|