Skip to content

Commit c13b49a

Browse files
committed
Update config
1 parent b5c68b3 commit c13b49a

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ Try running this example command from the root of the repository:
5353
go run ./cmd/GoSubAI generate -config ./config/translate_to_eng.json -input ./data/HVOR_BLIR_DET_AV_PENGA.srt
5454
```
5555

56+
You can also try this setup, which includes context in the translation and often leads to better results:
57+
58+
```sh
59+
go run ./cmd/GoSubAI generate -config ./config/translate_to_eng_with_context.json -input ./data/HVOR_BLIR_DET_AV_PENGA.srt
60+
```
61+
5662
### Run Unit Tests
5763

5864
To run unit tests, use the following command:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"HostUrl": "default",
3+
"Model": "mistral",
4+
"PropertyName": "translated_text",
5+
"SystemPrompt": "Input format: `Context: {PREVIOUS_TEXT} {TEXT}` `Task: Translate {TEXT} to English, short and clear.` Rules: Use {PREVIOUS_TEXT} only as context. Output only the translation of {TEXT}. No explanations, no context, no extra words.",
6+
"Prompt": "Context: '{PREVIOUS_TEXT} {TEXT}'\nTask: Translate '{TEXT}' to English, short and clear.",
7+
"Template": "{TEXT}\n----\n{GENERATED_TEXT}",
8+
"Debug": true
9+
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"HostUrl": "default",
3-
"Model": "mistral",
3+
"Model": "llama3.2",
44
"PropertyName": "translated_text",
5-
"SystemPrompt": "Input format: `Context: {PREVIOUS_TEXT} {TEXT}` `Task: Translate {TEXT} to English, short and clear.` Rules: Use {PREVIOUS_TEXT} only as context. Output only the translation of {TEXT}. No explanations, no context, no extra words.",
6-
"Prompt": "Context: '{PREVIOUS_TEXT} {TEXT}'\nTask: Translate '{TEXT}' to English, short and clear.",
5+
"SystemPrompt": "You are a subtitle translation assistant. Translate subtitles into the target language specified by the user.\n\n- Translate the text literally.\n- Do not add, remove, or guess words.\n- If the text is incomplete, translate it as-is.\n\n⚠️ Very important: The tag ##TAG## must always be copied exactly, in the same position.\n- Never remove it.\n- Never move it.\n- Never translate it.\n- Output is invalid if ##TAG## is missing or changed.\n\n### Examples\n\nInput: \"Bonjour##TAG##comment tu vas aujourd'hui?\"\nOutput: \"Hello##TAG##how are you today?\"\n\nInput: \"##TAG##Oui, j'arrive.\"\nOutput: \"##TAG##Yes, I'm coming.\"\n\nInput: \"Non##TAG##pas du tout.\"\nOutput: \"No##TAG##not at all.\"",
6+
"Prompt": "Translate this to english: '{PREVIOUS_TEXT} ##TAG## {TEXT}'",
77
"Template": "{TEXT}\n----\n{GENERATED_TEXT}",
8+
"Regex": "##TAG##(.*)",
9+
"RegexRetryLimit": 25,
810
"Debug": true
911
}

config/translate_to_eng_with_context_div.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)