Skip to content

aihpi/leichte-sprache

Repository files navigation

hpi_logo.png dabb_logo.png

Leichte Sprache

Simplify German language!

Locally-run tool to simplify German into "Leichte Sprache" (easy language) based on Large Language Models (LLMs).

LeichteSprache

The browser interface is designed for intuitive use, allowing experimentation with different models and approaches. The implementation focuses on simplicity, low-level components and modularity, allowing developers and Python enthusiasts to modify and build upon.

Key Features

  • Simplifies complex German text into easy-to-understand language
  • Browser-based interface for intuitive usage
  • Local execution for privacy and control
  • Configurable parameters for output customization

Installation

Install the basic tool

Download or clone the repository.

Follow the installation instructions


Usage

  • Start the tool [*]
$ python3 app.py
  • Open the provided URL on your web browser
  • Write or paste a text to simplify
  • Enjoy

Key Settings

  • Model: Select the desired Model
  • Use Rules (checkbox): Click for adding Leichte Sprache rules to the prompt sent to the LLM.

Additional Input parameters for the LLMs

  • Top k: Ranks the output tokens in descending order of probability, selects the first k tokens to create a new distribution, and it samples the output from it. Higher values result in more diverse answers, and lower values will produce more conservative answers.

  • Temp: This affects the “randomness” of the answers by scaling the probability distribution of the output elements. Increasing the temperature will make the model answer more creatively.


[*] If you chose the installation with a virtual environment, remember to activate it before starting the application by running $ source .myvenv/bin/activate

Performance consideration: On notebooks/PCs with dedicated GPUs, all the set models should run properly and fast. On a standard notebook, or if you encounter any memory of performance issues, prioritize the models based on llama 3.2 as they are smaller than the models based on llama 3.1 and need less hardware requirements.


Extra Tools

There are additional command line input tools that you can use to batch process data.


Development

Before committing, format the code using Black:

$ black -t py311 -S -l 99 .

Linters:

  • Pylance
  • flake8 (args: --max-line-length=100 --extend-ignore=E401,E501,E741)

For more detailed logging, set the LOG_LEVEL environment variable:

$ export LOG_LEVEL='DEBUG'

License

GPLv3


BMBF_non_transparent.jpeg

This is an artefact from a collaboration between DigitalAgentur Brandenburg and KI-Servicezentrum Berlin-Brandenburg. DigitalAgentur Brandenburg is funded by the Ministry for Economic Affairs, Labour and Energy of the State of Brandenburg. KI-Servicezentrum Berlin-Brandenburg is funded by the Federal Ministry of Education and Research under the funding code 01IS22092.