Skip to content

A simple implement to translate the .srt/.vtt caption with Open AI API

Notifications You must be signed in to change notification settings

MIBlue119/caption_translator

Repository files navigation

Caption Translator

Usage

  • install dependencies pip install -r requirements.txt

  • Set your openai api key with export OPENAI_API_KEYOPENAI="sxxxxxxxx"

  • Arguments

    • Necessary
      • --file_path: Set the transcript file path. Current only support .vtt and .srt format
    • Options
      • --text_engine: Set the open ai text engine. Default text engine is gpt-3.5-turbo
      • --language: Set the target translated language. Default language is japanese
        • support other language korean / german / traditional chinese / simplified chinese / french /dutch
      • --test: Whether to test part of content
      • --test_num: How many number of contents do you want to summarize?
  • Example

    $python -m caption_translator.app --file_path ./examples/EP108_humanosis_Podcast.vtt --test --language ja
    

Resources

Prompt

Summarize the following text.

Text:
"""
Two independent experiments reported their results this morning at CERN, Europe's high-energy physics laboratory near Geneva in Switzerland. Both show convincing evidence of a new boson particle weighing around 125 gigaelectronvolts, which so far fits predictions of the Higgs previously made by theoretical physicists.

"As a layman I would say: 'I think we have it'. Would you agree?" Rolf-Dieter Heuer, CERN's director-general, asked the packed auditorium. The physicists assembled there burst into applause.
"""

Summary:

About

A simple implement to translate the .srt/.vtt caption with Open AI API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages