Pricing 
API Pricing

Try For Free Now

Dark

Light

NEW MODEL
Create New Model
Upload the bilingual file to generate the model.
Customization is only applicable to T-3MT engine.
Endpoint
Request details
POST
https://translate.rozetta-api.io/api/v1/training/train
Header
Header
Description
Content-Type
multipart/form-data
Body
Key
Required
Description
file
Training file. The file formats that can be used are xlsx and tmx. File should have 10 articles at least.
first_lang
First column language. Regardless of the order of the first column language and the second column language, You can generate either a model that translates a first-column language into a second-column language, or a model that translates a second-column language into a first-column language.
second_lang
Second column language.
field
Field ID. L000001 is the only field ID that can be specified except for translation between Japanese and English. For Japanese-English, please specify something other than L000001. To get full list of Field ID, please refer to GET T-3MT ENGINE FIELD section.
name
Model Name. Please give a model name.(If not specified, an appropriate model name will be automatically generated.)
Request Sample
curl --location --request POST 'https://translate.rozetta-api.io/api/v1/training/train' --header 'accessKey: YOUR_ACCESSKEY' --header 'signature: CREATED_SIGNATURE' --header 'nonce: 987' --header 'Content-Type: multipart/form-data' --form 'file=@"YOUR_FILE_PATH"' --form 'name="Sample"' --form 'firstLang="en"' --form 'secondLang="ja"' --form 'field="L120001"' --form 'contractId="YOUR_CONTRACT_ID"'
Response
Key
Description
name
Model Name.
jid
Job ID. You can query the generation status of the model.
Response Sample
{
  "name": "サンプルファイル翻訳",
  "jid": "J72739505"
}

api/v1/training/train
Train the model.
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');

const data = new FormData();

const authUtils = require('./utils/auth-utils');


data.append('file', fs.createReadStream('YOUR_FILE_PATH'));
data.append('name', 'Sample');
data.append('firstLang', 'en');
data.append('secondLang', 'ja');
data.append('field', 'L120001');
data.append('contractId', 'YOUR_CONTRACT_ID');

const authConfig = {
  accessKey: 'YOUR_ACCESS_KEY',
  secretKey: 'YOUR_SECRET_KEY',
  nonce: new Date().getTime().toString()
};

const path = '/api/v1/training/train';

const signature = authUtils.generateSignature(
  authConfig.nonce,
  path,
  authConfig.secretKey,
);

const config = {
  method: 'post',
  url: 'https://translate.rozetta-api.io/api/v1/training/train',
  headers: {
    accessKey: authConfig.accessKey,
    signature,
    nonce: authConfig.nonce,
    'Content-Type': 'multipart/form-data',
    ...data.getHeaders()
  },
  data : data
};

const main = async () => {
  try {
    const response = await axios(config)
    console.log(JSON.stringify(response.data));
  } catch (error) {
    console.log(error);
  }
}

main();
About the authentication, please refer to the authentication section.
You can get a full version of sample codes here
©️ 2019 Rozetta API  ・  Powered by Rozetta

Rozetta Corp.

^