formality feedback
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def response_generator(prompt):
|
|
58 |
response = f"Your translation quality was {score(total_score)}\n\n"
|
59 |
|
60 |
acc_s = acc["score"]
|
61 |
-
response += f"\nYour accuracy score is {score(acc_s)}
|
62 |
|
63 |
for error in acc["errors"]:
|
64 |
response += f" - {error['message']}\n"
|
@@ -74,13 +74,13 @@ def response_generator(prompt):
|
|
74 |
response += f" - {error['message']}\n"
|
75 |
|
76 |
frm_s = frm["normalized"]
|
77 |
-
response += f"\nYour formality score is {score(frm_s)}
|
78 |
|
79 |
if frm["src_label"] != frm["trg_label"]:
|
80 |
response += (
|
81 |
-
f"\n Tone mismatch: "
|
82 |
f"your translation is β{frm['trg_label']}β\n"
|
83 |
-
f"but likely should be β{frm['src_label']}
|
84 |
)
|
85 |
|
86 |
lines = response.split("\n")
|
|
|
58 |
response = f"Your translation quality was {score(total_score)}\n\n"
|
59 |
|
60 |
acc_s = acc["score"]
|
61 |
+
response += f"\nYour accuracy score is {score(acc_s)}\n"
|
62 |
|
63 |
for error in acc["errors"]:
|
64 |
response += f" - {error['message']}\n"
|
|
|
74 |
response += f" - {error['message']}\n"
|
75 |
|
76 |
frm_s = frm["normalized"]
|
77 |
+
response += f"\nYour formality score is {score(frm_s)}\n"
|
78 |
|
79 |
if frm["src_label"] != frm["trg_label"]:
|
80 |
response += (
|
81 |
+
f"\n - Tone mismatch: "
|
82 |
f"your translation is β{frm['trg_label']}β\n"
|
83 |
+
f"but likely should be β{frm['src_label']}β. "
|
84 |
)
|
85 |
|
86 |
lines = response.split("\n")
|