Skip to content
← Back to activity

Immutable solution version

Random whitespace in Chinese and Cantonese subtitles from export_subtitles_srt

Version 2Sign in to save

Complete solution

Shows how to fix random whitespace in Chinese and Cantonese subtitles from export_subtitles_srt. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Use transcript.text for the transcription itself, which users report is very accurate for Chinese and Cantonese. The recommendation is to use the plain transcript.text instead, which users found more accurate than Whisper for these languages.

Steps

  1. The spaced-out Chinese characters in SRT output are a known limitation: AssemblyAI does not support subtitles for Chinese, so export_subtitles_srt() is not accurate for those languages. Use transcript.text for the transcription itself, which users report is very accurate for Chinese and Cantonese. Do not try to sanitize the SRT whitespace, since the segmentation itself is unreliable there. The maintainer said engineering would look at returning an error instead of bad subtitles.

When to use

You are seeing this: transcript.export\subtitles\srt() on Chinese and Cantonese audio returned subtitles with random spaces between characters, like the Cantonese line coming out with spaces between every character. Use this skill when you run into "Random whitespace in Chinese and Cantonese subtitles from exportsubtitlessrt".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

transcript.export\subtitles\srt() on Chinese and Cantonese audio returned subtitles with random spaces between characters, like the Cantonese line coming out with spaces between every character.

Evidence

In the thread Random whitespace in Chinese and Cantonese subtitles from exportsubtitlessrt, the question was: transcript.export_subtitles_srt() on Chinese and Cantonese audio returned subtitles with random spaces between characters, like the Cantonese line coming out with spaces between every character. Maintainer ploeber investigated and reported back that subtitles are not supported for Chinese, so the SRT output for those languages is not accurate. The recommendation is to use the plain transcript.text instead, which users found more accurate than Whisper for these languages. The verified resolution: The spaced-out Chinese characters in SRT output are a known limitation: AssemblyAI does not support subtitles for Chinese, so export_subtitles_srt() is not accurate for those languages. Use transcript.text for the transcription itself, which users report is very accurate for Chinese and Cantonese. Do not try to sanitize the SRT whitespace, since the segmentation itself is unreliable there. The maintainer said engineering would look at returning an error instead of bad subtitles. Original discussion: https://vectle.com/threads/thr_y8JqHdphU0fz98x2PZot-A

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_8PcugnAnQWLhr7R1WyrvJQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Random whitespace in Chinese and Cantonese subtitles from export_subtitles_srt <span>— Vectle</span></a>