Spaces:
Running
Running
tiennguyenbnbk
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -108,9 +108,10 @@ mapping_style_en = {
|
|
108 |
}
|
109 |
|
110 |
def gen_english(*args):
|
|
|
111 |
input_dict = {
|
112 |
'title': "Cô" if args[0] == "Female teacher" else "Thầy" if args[0] else None,
|
113 |
-
'style':
|
114 |
'reception': mapping_score_en.get(args[2]) if args[2] else None,
|
115 |
'participate_activities': mapping_score_en.get(args[3]) if args[3] else None,
|
116 |
'remember_apply_vocab_grama': mapping_score_en.get(args[4]) if args[4] else None,
|
@@ -126,9 +127,10 @@ def gen_english(*args):
|
|
126 |
return response["evaluation"].replace("**", '"')
|
127 |
|
128 |
def gen_math(*args):
|
|
|
129 |
input_dict = {
|
130 |
'title': "Cô" if args[0] == "Cô giáo" else "Thầy" if args[0] else None,
|
131 |
-
'style':
|
132 |
'reception': mapping_score_vi.get(args[2]) if args[2] else None,
|
133 |
'exercise_format_understanding': args[3] if args[3] else "",
|
134 |
'exercise_format_not_understanding': args[4] if args[4] else "",
|
@@ -171,7 +173,7 @@ with gr.Blocks() as demo:
|
|
171 |
]
|
172 |
with gr.Group():
|
173 |
review += [
|
174 |
-
gr.
|
175 |
]
|
176 |
with gr.Group():
|
177 |
review += [
|
@@ -230,7 +232,7 @@ with gr.Blocks() as demo:
|
|
230 |
]
|
231 |
with gr.Group():
|
232 |
review += [
|
233 |
-
gr.
|
234 |
]
|
235 |
with gr.Group():
|
236 |
review += [
|
@@ -274,6 +276,7 @@ with gr.Blocks() as demo:
|
|
274 |
|
275 |
greet_btn.click(gen_math, inputs=[*review], outputs=[evaluation])
|
276 |
|
|
|
277 |
# with gr.Tab("IELTS"):
|
278 |
# with gr.Row():
|
279 |
# # --- Nhóm các thành phần nhập liệu ---
|
|
|
108 |
}
|
109 |
|
110 |
def gen_english(*args):
|
111 |
+
style = [mapping_style_en.get(x).lower() for x in args[1]]
|
112 |
input_dict = {
|
113 |
'title': "Cô" if args[0] == "Female teacher" else "Thầy" if args[0] else None,
|
114 |
+
'style': ", ".join(style) if len(args[1])!= 0 else None,
|
115 |
'reception': mapping_score_en.get(args[2]) if args[2] else None,
|
116 |
'participate_activities': mapping_score_en.get(args[3]) if args[3] else None,
|
117 |
'remember_apply_vocab_grama': mapping_score_en.get(args[4]) if args[4] else None,
|
|
|
127 |
return response["evaluation"].replace("**", '"')
|
128 |
|
129 |
def gen_math(*args):
|
130 |
+
style = [x.lower() for x in args[1]]
|
131 |
input_dict = {
|
132 |
'title': "Cô" if args[0] == "Cô giáo" else "Thầy" if args[0] else None,
|
133 |
+
'style': ", ".join(style) if len(args[1])!= 0 else None,
|
134 |
'reception': mapping_score_vi.get(args[2]) if args[2] else None,
|
135 |
'exercise_format_understanding': args[3] if args[3] else "",
|
136 |
'exercise_format_not_understanding': args[4] if args[4] else "",
|
|
|
173 |
]
|
174 |
with gr.Group():
|
175 |
review += [
|
176 |
+
gr.CheckboxGroup(["Close, friendly", "Short, concise", "Emotions"], value="Close, friendly", label="Evaluative Tone", show_label=True),
|
177 |
]
|
178 |
with gr.Group():
|
179 |
review += [
|
|
|
232 |
]
|
233 |
with gr.Group():
|
234 |
review += [
|
235 |
+
gr.CheckboxGroup(["Gần gũi, thân thiện", "Ngắn gọn, xúc tích", "Nhiều cảm xúc"], value="Gần gũi, thân thiện", label="Giọng văn đánh giá", show_label=True),
|
236 |
]
|
237 |
with gr.Group():
|
238 |
review += [
|
|
|
276 |
|
277 |
greet_btn.click(gen_math, inputs=[*review], outputs=[evaluation])
|
278 |
|
279 |
+
|
280 |
# with gr.Tab("IELTS"):
|
281 |
# with gr.Row():
|
282 |
# # --- Nhóm các thành phần nhập liệu ---
|