Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

5.1 KB
Raw Blame
Create natural, concise, aligned bilingual subtitle pairs for each input sentence_id.

Required constraints:
- EVERY source string must fit max_source_characters and EVERY target string must fit max_target_characters. The current limit is {{MAX_TARGET_CHARS}} Unicode grapheme clusters per side, including all spaces and punctuation. This is a character limit, not a word or token limit.
- Cover the source exactly once, in order. Preserve spelling, punctuation, internal spaces, repeated words, and false starts. Only insert segment boundaries; never clean up or rewrite source text.
- Each pair needs meaningful, nonempty source AND target text. Never use blank or punctuation-only placeholders. Each side must be one line, without line-break characters or formatting tags.
- Preserve the full meaning: names, numbers, negation, uncertainty, conditions, and temporal relationships. Context fields help interpretation only; do not translate their content.
- Write the target as fluent spoken subtitle language on the first pass. Do not copy source-language grammar, add translationese, or preserve unnecessary repetition. Keep the speaker's tone and omit only nonsemantic spoken fillers when the application allows it.
- Prefer a native-sounding complete target sentence before choosing subtitle boundaries. Natural phrasing must never remove a fact, qualifier, name, number, unit, or relationship from the source.

Work in this order:
1. Read the complete input. If both complete texts fit their limits, keep one pair. Otherwise choose SMALL consecutive source phrases first. For a 60-character limit, prefer natural phrases around 30-45 characters on the longer side, leaving a margin below the ceiling; a meaningful phrase may be longer if it still fits the hard limit. For other limits, scale the working size. Do not cut by a fixed number of words. Look ahead before choosing each cut: keep names, numbers with units, short noun phrases, and short verb-complement groups together by cutting BEFORE the group when needed. Never leave a conjunction, preposition, or short pronoun hanging at the end of a segment when it belongs with the next phrase. A long clause must span multiple pairs. Keeping a whole clause together never justifies exceeding a hard limit. Avoid leaving a short pronoun or verb without its immediate continuation.
2. Translate the phrases together as one coherent utterance. Keep each pair meaningful and align it as closely as the languages allow. Word order may differ across languages: when exact word-for-word pairing would require an overlong or empty segment, preserve short meaningful phrases in each language and judge correspondence over a small group of adjacent pairs. Approximate pairing within that group is preferable to an overlong line or an empty target. Do not repeat or omit content. If a target is too long, split it and the corresponding source again. Short phrases can be parts of a sentence; they do not need to be independent complete sentences. Avoid isolated function words or dangling fragments.
3. If target_text is provided, it is an existing translation to preserve verbatim. Only repartition source and target into matching phrases; do not retranslate, improve, add, remove, or change punctuation in target_text. Otherwise output the translation once through the target segments. Do not return a target_text field.
4. Check each pair separately: source length within its limit, target length within its limit, both meaningful, exact source coverage, no missing or repeated translated meaning. Fix offending pairs before returning. Choose shorter phrases if counting is uncertain; do not rely on the application to shorten them.

Source and target segments are each concatenated with an EMPTY separator. Preserve necessary word spaces at segment edges, preferably as trailing spaces. A boundary adds no space. For example, ["Read the ", "report."] forms "Read the report." Do not insert spaces inside words or into scripts that do not use them. Never split inside a grapheme cluster, including combining marks or joined emoji.

Example: the source has no punctuation; both limits are 60 characters.
Input: at the end of each day I check the task list and move unfinished items to tomorrow
Output:
{"sentences":[{"sentence_id":"example","segments":[{"source":"at the end of each day ","target":"每天结束时,"},{"source":"I check the task list ","target":"我会检查任务清单,"},{"source":"and move unfinished items to tomorrow","target":"把未完成的事项移到明天。"}]}]}

A long clause may need a boundary before its predicate. Example with a 60-character limit and no source punctuation:
Input: because updating the shared calendar does not have a fixed deadline
Output:
{"sentences":[{"sentence_id":"example","segments":[{"source":"because updating the shared calendar ","target":"因为更新共享日历"},{"source":"does not have a fixed deadline","target":"没有固定的截止日期。"}]}]}

Return every input sentence_id exactly once in input order. Output only JSON, without Markdown, counts, explanations, or extra fields:
{"sentences":[{"sentence_id":"input ID","segments":[{"source":"source phrase","target":"corresponding translation"}]}]}