【发布时间】:2019-11-19 18:41:25
【问题描述】:
我在 Google AutoML 语言翻译中构建了一个自定义模型和一个词汇表。有没有办法同时使用自定义模型和词汇表?如果是这样,request.json 应该是什么样的?
【问题讨论】:
标签: model request machine-translation google-cloud-automl glossary
我在 Google AutoML 语言翻译中构建了一个自定义模型和一个词汇表。有没有办法同时使用自定义模型和词汇表?如果是这样,request.json 应该是什么样的?
【问题讨论】:
标签: model request machine-translation google-cloud-automl glossary
您完全可以同时使用词汇表和 AutoML。发帖请求:
POST https://translation.googleapis.com/v3/projects/project-number-or-id/locations/us-central1:translateText
有了这个有效载荷。 Model 应该指向您的 AutoML 模型路径,glossaryConfig 应该指向您的词汇表 ID。
{
"model": "projects/project-number-or-id/locations/us-central1/models/TRL1395675701985363739",
"sourceLanguageCode": "en",
"targetLanguageCode": "ru",
"contents": "Dr. Watson, please discard your trash. You've shared unsolicited email with me. Let's talk about spam and importance ranking in a confidential mode.",
"glossaryConfig": {
"glossary": "projects/project-number/locations/us-central1/glossaries/glossary-id"
}
}
【讨论】:
我不知道如何请求,但我用另一种方式代替。
就像这样: text = "你要翻译" → text2(使用词汇表) → final_result (自定义模型)
希望对你有所帮助
【讨论】:
“你想翻译”→ text2(使用词汇表)→ final_result(自定义模型)听起来很有趣。我试试看。
【讨论】: