pbr-private/translate.sh

20 lines
430 B
Bash
Raw Normal View History

2022-05-22 16:47:22 +02:00
#!/bin/bash
# first arg should be text to translate
# second (optional) arg should be additional dictionary
mkdir data
cp "$1" data/text.txt
if [ ! -z "$2" ]
then
: cp "$2" data/dictionary.tsv
fi
2022-05-29 19:32:42 +02:00
# TODO inject dictionary - current model does not utilize additional dictionary anyway
docker build -t translator .
docker run --name trslt translator
docker cp trslt:/app/translation_output.txt .
docker rm trslt
2022-05-22 16:47:22 +02:00
rm -rf data
2022-05-29 19:32:42 +02:00