It is recommended to create a Python virtual environment before proceeding. You can read more about how to set it up here.
-
Install Dependencies:
pip install -r requirements.txt
-
Install Autopep8 Pre-commit Hook:
pre-commit install
To train a new translation model, run the following command:
python model_utilities trainOnce the model is trained, you can evaluate it by running:
python model_utilities evaluateTo use the trained model for translation, execute the following command:
python model_utilities translate <text to translate>The model will translate from Polish to Kashubian by default. To translate in reverse, call:
python model_utilities translate <text to translate> trueFor debug purposes, you can simply call:
python model_utilities translateThis will translate "Wsiądźmy do tego autobusu" from Polish to Kashubian.
All key settings for the model, such as the pretrained model to be used, output model names, and training parameters, can be configured in the config.ini file.
The batch size setting in the config.ini file should match the memory capacity of the device being used for training. For example, if you are using a GPU with 8GB of memory, set:
BatchSize=8