Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,9 @@ def predict(question_choice, audio):
|
|
22 |
|
23 |
# Generate the system message based on the chosen question
|
24 |
strategy, explanation = HongWenData.strategy_text["TREES"]
|
|
|
|
|
|
|
25 |
|
26 |
# Construct the conversation with the system and user's message
|
27 |
conversation = [
|
@@ -30,16 +33,19 @@ def predict(question_choice, audio):
|
|
30 |
"content": f"""
|
31 |
You are an expert English Language Teacher in a Singapore Primary school, directly guiding a Primary 6 student in Singapore.
|
32 |
The student is answering the question: '{question_choice}'.
|
|
|
|
|
33 |
Point out areas they did well and where they can improve, following the {strategy}.
|
34 |
-
Encourage the use of sophisticated vocabulary and expressions.
|
35 |
-
For the second and third questions, the picture is not relevant, so the student should not refer to it in their response.
|
36 |
-
{explanation}
|
37 |
The feedback should be in second person, addressing the student directly.
|
38 |
"""
|
39 |
},
|
40 |
{"role": "user", "content": message}
|
41 |
]
|
42 |
|
|
|
43 |
response = openai.ChatCompletion.create(
|
44 |
model='gpt-3.5-turbo',
|
45 |
messages=conversation,
|
|
|
22 |
|
23 |
# Generate the system message based on the chosen question
|
24 |
strategy, explanation = HongWenData.strategy_text["TREES"]
|
25 |
+
|
26 |
+
# Reference to the picture description from HongWenData.py
|
27 |
+
picture_description = HongWenData.description
|
28 |
|
29 |
# Construct the conversation with the system and user's message
|
30 |
conversation = [
|
|
|
33 |
"content": f"""
|
34 |
You are an expert English Language Teacher in a Singapore Primary school, directly guiding a Primary 6 student in Singapore.
|
35 |
The student is answering the question: '{question_choice}'.
|
36 |
+
For the first question, ensure your feedback refers to the picture description provided:
|
37 |
+
{picture_description}
|
38 |
Point out areas they did well and where they can improve, following the {strategy}.
|
39 |
+
Encourage the use of sophisticated vocabulary and expressions.
|
40 |
+
For the second and third questions, the picture is not relevant, so the student should not refer to it in their response.
|
41 |
+
{explanation}
|
42 |
The feedback should be in second person, addressing the student directly.
|
43 |
"""
|
44 |
},
|
45 |
{"role": "user", "content": message}
|
46 |
]
|
47 |
|
48 |
+
|
49 |
response = openai.ChatCompletion.create(
|
50 |
model='gpt-3.5-turbo',
|
51 |
messages=conversation,
|