Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,26 +21,26 @@ def parse_feedback(feedback):
|
|
21 |
# You can customize this based on how GPT provides the feedback
|
22 |
# Here, I assume feedback includes specific scoring lines like 'Content Relevance: X/25'
|
23 |
scores = {
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
29 |
-
'Conclusion': None,
|
30 |
-
'Overall Impression': None,
|
31 |
'Total Score': None
|
|
|
|
|
32 |
}
|
33 |
|
34 |
-
lines = feedback.split('\n')
|
35 |
-
for line in lines:
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
# Assume that the last numerical value mentioned is the total score
|
42 |
-
total_score = sum([int(score) for score in scores.values() if score])
|
43 |
-
scores['Total Score'] = total_score
|
44 |
return scores
|
45 |
|
46 |
# Function to grade the essay using GPT-4
|
|
|
21 |
# You can customize this based on how GPT provides the feedback
|
22 |
# Here, I assume feedback includes specific scoring lines like 'Content Relevance: X/25'
|
23 |
scores = {
|
24 |
+
'Research': None,
|
25 |
+
'Xác định rõ vấn đề, mục tiêu và vai trò nhãn hàng trong chiến dịch': None,
|
26 |
+
'Phân tích đối tượng truyền thông': None,
|
27 |
+
'Đề xuất chiến lược tiếp cận': None,
|
28 |
+
'Ý tưởng lớn': None,
|
|
|
|
|
29 |
'Total Score': None
|
30 |
+
|
31 |
+
|
32 |
}
|
33 |
|
34 |
+
# lines = feedback.split('\n')
|
35 |
+
# for line in lines:
|
36 |
+
# for key in scores.keys():
|
37 |
+
# if key in line:
|
38 |
+
# score = line.split(':')[-1].strip()
|
39 |
+
# scores[key] = score
|
40 |
+
|
41 |
+
# # Assume that the last numerical value mentioned is the total score
|
42 |
+
# total_score = sum([int(score) for score in scores.values() if score])
|
43 |
+
# scores['Total Score'] = total_score
|
44 |
return scores
|
45 |
|
46 |
# Function to grade the essay using GPT-4
|