Skip to main content

Use OpenAI's whisper to generate subtitles in multiple languages for the purpose of language learning

Project description

Language learning application that uses openai's whisper to generate foreign language and English subtitles for videos simultaneously to help with language learning.

Installation

> pip install llsubtitles

Usage

To use llsubtitles first you need a foreign language .mp4 file. I recommend using yt-dlp to download content for language learning. Once you have a .mp4 file you can use llsubtitles to generate subtitles for it.

# Using chinese content for this example
> llsubtitles --language Chinese --model small --combined --definitions --pinyin example.mp4

--language: Refers to the language used by openai's whisper to generate subtitles.
--model: The model used by whisper. See their documentation for more options.
--combined: If this flag is used, the subtitles will be generated in both the foreign language and English.
--definitions: If this flag is used, the subtitles will include definitions for the foreign language words.
--pinyin: Optional flag for Chinese learners, if this flag is used, the subtitles will include pinyin for the Chinese words.

Note, you should make sure that you have pytorch set up correctly to use Cuda if you're using an Nvidia GPU. See pytorch's documentation for more information. This will greatly improve performance.

Credits

Chinese English dictionary is courtesy of cedict

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llsubtitles-1.0.1.tar.gz (3.6 MB view hashes)

Uploaded Source

Built Distribution

llsubtitles-1.0.1-py3-none-any.whl (3.7 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page