To translate the sample letter into Spanish, invoke the script using the following command:
bash translate.bash my_text en es Sara
where my_text is the English file that you want to translate to Spanish, and Sara is the name of the Spanish-speaking friend.
See Translation shell and parameterized template files for the files that the example uses:
Figure 17. Examples of running the script for Spanish and Chinese translations
Each translation (for example, English to Spanish or Spanish to English) takes about 34 seconds for this small example and configuration.
Note: Memory management in CUDA for measuring execution time is out of the scope of this white paper.
Perform the translations for all the models in this example:
Figure 18. Running the script for languages
The last section of the output includes the translation times. For example, for our Spanish translation, the output ends as shown in the following figure:
Figure 19. Output of translation time to Spanish
The following figure shows the contents of the working directory after running the script:
Figure 20. Working directory after running the script
For sample translations of the English my_text file with parameterized names, see Translated files.