SW_DevBabelfish - fablab-wue/piTelex GitHub Wiki

Device Module "Babelfish"

Module Information

[!IMPORTANT] This package is still experimental and only integrated into the Testing branch. Experience reports to the author (see below) are welcome!

Dependencies

PythonModule Install Anaconda
openai pip3 install openai --break-system-packages conda install openai

Command Line Arguments

None.

Config File Parameter

Parameter Default Type/Range Description
openai_api_key none string Your personal api key at openai.com
language none string target language

Description

Wikipedia writes: โ€œThe Babel Fish is a fictional creature from the novel The Hitchhiker's Guide to the Galaxy by Douglas Adams, which has since become a well-known symbol for machine-based translation systems. The babel fish is described in the novel as a small creature that can be inserted into the ear and enables the wearer to understand all spoken languages. Adams explains this concept by describing the babelfish as a symbiote that feeds on external brainwaves and secretes their meaning directly into the wearer's brain in the form of telepathic energy. Douglas Adams based the name Babel fish on the biblical story of the Tower of Babel and the subsequent Babylonian confusion of languages from the Book of Genesis.โ€

piTelex will be able to do this too:

  • You will need an OpenAI API key. The key can be obtained from https://platform.openai.com/ for small money.

  • Install the openai python module. In Debian 13 (trixie), the openai module is part of the distro, so it is sufficient to call apt:

    $ sudo apt install python3-openai
    

    For Debian 12 (bookworm) and previous you must install it by the python installer pip3.

    [!NOTE] If pip3is not installed, it can be installed with sudo apt install python3-pip

    $ pip3 install openai --break-system-packages
    
  • Activate and configure the Babelfish module in piTelex' configuration file (telex.json), see below for an example.

        "babelfish": {
          "type": "babelfish",
          "enable": true,
          "openai_api_key": "sk-proj-naturally_your_not_mine._but_it_is_not_expensive",
          "language": "deutsch"    #YOUR Language. Babelfish will translate all incoming telex to this language
           }
    
  • (Re-)Start piTelex.

If you now receive a telex, e.g. in English or Swahili, it will be printed out as usual. After receiving the telex, the machine starts up again and prints out the translation...

[!NOTE] Contributed by Wolfram Henkel. Your enthusiastic thanks to telex 38718 are welcome.