Spaces:
Running on Zero
Running on Zero
github-actions[bot] commited on
Commit Β·
ffee483
1
Parent(s): 5b7cd5f
deploy: switch to chatterbox requirements @ c80cad4
Browse files- steps/s3_translate.py +12 -10
steps/s3_translate.py
CHANGED
|
@@ -29,8 +29,9 @@ def _translate_batch(segments: list[dict], target_language: str) -> list[dict]:
|
|
| 29 |
f"Numbered lines with a spoken duration in brackets, e.g.: 1. [4.6s] Hello there\n\n"
|
| 30 |
|
| 31 |
f"OUTPUT FORMAT:\n"
|
| 32 |
-
f"A JSON array of strings β one per input line, in order.
|
| 33 |
-
f
|
|
|
|
| 34 |
|
| 35 |
f"βββββββββββββββββββββββββββββββββββββ\n"
|
| 36 |
f"SCORING RUBRIC β evaluate every line against these before outputting:\n"
|
|
@@ -61,17 +62,18 @@ def _translate_batch(segments: list[dict], target_language: str) -> list[dict]:
|
|
| 61 |
f" β Pass: the emotional texture is preserved even if the words are completely different\n\n"
|
| 62 |
|
| 63 |
f"[5] TRANSLATION PURITY β weight: MEDIUM\n"
|
| 64 |
-
f"
|
| 65 |
-
f"
|
| 66 |
-
f"
|
| 67 |
-
f"
|
| 68 |
-
f"
|
| 69 |
|
| 70 |
f"[6] WORD-FOR-WORD TRAP β weight: HIGH (avoid this)\n"
|
| 71 |
f" Do NOT translate word by word. No one speaks that way.\n"
|
| 72 |
-
f" β Fail
|
| 73 |
-
f" β Pass
|
| 74 |
-
f"
|
|
|
|
| 75 |
|
| 76 |
f"βββββββββββββββββββββββββββββββββββββ\n"
|
| 77 |
f"BEFORE RETURNING OUTPUT:\n"
|
|
|
|
| 29 |
f"Numbered lines with a spoken duration in brackets, e.g.: 1. [4.6s] Hello there\n\n"
|
| 30 |
|
| 31 |
f"OUTPUT FORMAT:\n"
|
| 32 |
+
f"A JSON array of {target_language} strings β one per input line, in order. "
|
| 33 |
+
f"No numbering, no brackets, no extra text.\n"
|
| 34 |
+
f'Shape: ["<first line translated into {target_language}>", "<second line translated into {target_language}>"]\n\n'
|
| 35 |
|
| 36 |
f"βββββββββββββββββββββββββββββββββββββ\n"
|
| 37 |
f"SCORING RUBRIC β evaluate every line against these before outputting:\n"
|
|
|
|
| 62 |
f" β Pass: the emotional texture is preserved even if the words are completely different\n\n"
|
| 63 |
|
| 64 |
f"[5] TRANSLATION PURITY β weight: MEDIUM\n"
|
| 65 |
+
f" Every word in the output must be {target_language}. No words from the original "
|
| 66 |
+
f"language should leak through.\n"
|
| 67 |
+
f" This includes: filler words (Oh, Hmm, Well, So, Right when not native to "
|
| 68 |
+
f"{target_language}), names used as exclamations, brand-style interjections. "
|
| 69 |
+
f"Find the {target_language} equivalent every time.\n\n"
|
| 70 |
|
| 71 |
f"[6] WORD-FOR-WORD TRAP β weight: HIGH (avoid this)\n"
|
| 72 |
f" Do NOT translate word by word. No one speaks that way.\n"
|
| 73 |
+
f" β Fail: a literal one-to-one rendering that preserves the source word order\n"
|
| 74 |
+
f" β Pass: a restructured line that reads naturally in {target_language} "
|
| 75 |
+
f"while keeping the same meaning\n"
|
| 76 |
+
f" Restructure freely. {target_language} has its own natural word order β use it.\n\n"
|
| 77 |
|
| 78 |
f"βββββββββββββββββββββββββββββββββββββ\n"
|
| 79 |
f"BEFORE RETURNING OUTPUT:\n"
|