ngcanh commited on
Commit
fc910ad
·
verified ·
1 Parent(s): d6a6476

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
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
- 'Content Relevance': None,
25
- 'Clarity and Organisation': None,
26
- 'Originality and Creativity': None,
27
- 'Research and Evidence': None,
28
- 'Writing Style and Language': None,
29
- 'Conclusion': None,
30
- 'Overall Impression': None,
31
  'Total Score': None
 
 
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
 
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