Translating datasets using Google Cloud Translate
Using the Google Cloud Translation service requires creating a project in the Google Cloud portal, selecting the billing account (in case the free limit for API access is exceeded), and enabling the Cloud Translation API on the project. To authenticate API requests, run gcloud auth application-default login
in your terminal – this will prompt you to enter your Google Cloud username and password in a browser.
Some useful links below to install gcloud
and set up Google Cloud Translate
.
Now clone this repo and execute the following scripts to set up the environment.
cd processing
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Finally translate the data by running:
python3 translate.py
In this case, the dataset is in Chinese (simplified) and the records are exports to China from each Asian country between 2005 to 2023, acquired from official Chinese state website for the Belt and Road project.