GithubHelp home page GithubHelp logo

translation_transcript_service's Introduction

Overview

Overview

๐Ÿ’พ Installation

Setup conda

Open a shell script and create a new python environment.

conda create --name translator python=3.9

conda activate translator

git clone https://github.com/stephanj/translation_transcript_service.git

Install the required Python modules

cd translation_transcript_service/src/main/server

pip3 install -r requirements.txt

Open AI KEY

Set your OpenAI key in .env

echo "OPENAI_API_KEY='sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx'"  > .env

Get your OpenAI key from https://platform.openai.com/account/api-keys

ElevenLabs KEY (Optional)

For the summary audio you need to have an ElevenLabs key, but this is optional.

https://beta.elevenlabs.io/speech-synthesis click on the profile menu itme.

Add this key in the config.js file.

config.js

Create a config.js file in src/main/webapp/js which holds your ElevenLabs key. This is used to convert the transcript summary and turn it into audio which is played on the Summary slide.

const config = {
    audioKey: '0e5cbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'    
};

๐Ÿ”ง Export your slides to HTML

Keynote

You need to update the exported HTML slides to include the translation buttons and related javascript code.

In the generated index.html file add the following:

The css for the buttons and translation text layout

    <link rel="stylesheet" href="../../webapp/css/styles.css">  

The actual buttons in the header. Place this right underneath the body tag.

<body id="body" bgcolor="black">
    <div class="container">
        <div id="translatedText"></div>
        <div class="filler">
            <label for="source-lang">From</label>
            <select id="source-lang">
                <option value="en">English</option>
                <option value="nl">Dutch</option>
                <option value="fr">French</option>
                <option value="es">Spanish</option>
                <option value="gr">Greek</option>
                <option value="it">Italian</option>
                <option value="ja">Japanese</option>
                <option value="zh">Chinese</option>
                <option value="ar">Arabic</option>
            </select>
            <label for="target-lang">To</label>
            <select id="target-lang">
                <option value="fr">French</option>
                <option value="nl">Dutch</option>
                <option value="es">Spanish</option>
                <option value="en">English</option>
                <option value="gr">Greek</option>
                <option value="it">Italian</option>
                <option value="ja">Japanese</option>
                <option value="zh">Chinese</option>
                <option value="ar">Arabic</option>
            </select>
            <button id="start">Start</button>
            <button id="stop" disabled>Stop</button>
        </div>
    </div>    

And at the end of the HTML tag add the needed javascript import.

        <script src="assets/player/main.js"></script>           <!-- already there                       -->

        <script src="../../webapp/js/config.js"></script>       <!-- the config with the elevenLabs key  -->
        <script src="../../webapp/js/translator.js"></script>   <!-- the translator script               -->

PowerPoint

I don't use PowerPoint, so maybe someone else can do this?

๐Ÿš€ Start WebSocket

  1. Start the websocket python app which will accept audio chuncks from the browser.
    python3 websocket.py
  1. Open the updated index.html which contains the slides.
  2. Select the from/to languages and press "Start".

Every 20 seconds the audio is pushed to the python app, it converts the webm to text using Whisper and asks ChatGPT to translate it.

translation_transcript_service's People

Contributors

stephanj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.