Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 1.29 KB

README.md

File metadata and controls

43 lines (25 loc) · 1.29 KB

🎬 Subtitle Translation 🎬

This repo contains a tool to translate .str subtitles file from English to Spanish:

Sample

Requirements

  • A suitable conda environment named translate_subs can be created and activated with:
conda env create -f environment_subs.yml
conda activate translate_subs

Context

The idea is to convert a file containing English subtitles with the structure of a str file into the Spanish version of it. A translation model is used to get the predictions (text in Spanish).

About the structure of a .str file

Subtitle files considered for this tool are .srt files. The structure of these files is the following:

STRFILE

About the model

The model used for translation has been trained and host at HugginFace hub:

🤗Translation Model

How to

⚠️Note: original .srt must be saved as a .txt file.

The following scenario shows how to translate an original file with English subtitles into Spanish.

subtitle_translation>python translate_my_subs.py HTWJW_1.txt