Create a `Mastr.translate` method
FlorianK13 opened this issue · comments
Florian Kotthoff commented
Description of the issue
We could now implement a translation method for the Mastr database, where all columns are translated to english. Thanks to LLMs like chatgpt we would not need to translate it on our own.
Ideas of solution
- Create a list of all distinct column names of all tables.
- Pass this list to chatGPT asking for a translation of every item.
- Create a dictionary with translations. If new columns are added and not available in the dict, they shall not be translated.
Workflow checklist
- I am aware of the workflow in CONTRIBUTING.md
Florian Kotthoff commented
I think this could be solved as follows:
- Get a list of all column names from all tables, either by connecting to an existing database or by using the
orm.py
file and according sqlalchemy methods. - Transfer this list to a set.
- Go to your favourite LLM and create a translation dictionary from this set of column names.
- Implement a
Mastr.translate
method that takes the downloaded database, iterates over all tables and all columns and translates them. The database should then be renamed toopen_mastr_translated.db
so that theopen_mastr
module will not try to work with it again when writing new data to this database.