model - 在 Google AutoML 翻译中使用带有自定义模型的词汇表
问题描述
我在 Google AutoML 语言翻译中构建了一个自定义模型和一个词汇表。有没有办法同时使用自定义模型和词汇表?如果是这样,request.json 应该是什么样的?
解决方案
您完全可以同时使用词汇表和 AutoML。发出帖子请求:
POST https://translation.googleapis.com/v3/projects/project-number-or-id/locations/us-central1:translateText
有了这个有效载荷。模型应该指向您的 AutoML 模型路径,而词汇表配置应该指向您的词汇表 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"
}
}
推荐阅读
- devexpress-mvc - Devexpress 单选按钮列表项更改颜色
- r - 将 cor.test 的结果重新格式化为数据框
- amazon-web-services - AWS Cognito 池触发器
- elasticsearch - Elasticsearch 查询消耗 100% 的 CPU
- logstash - 将字符串转换为十进制值 Logstash 变异
- html - 引导导航栏切换按钮不显示内容
- sql-server - 从多列中的多行返回结果 SQL Server
- opencl - 编写部分和 GPU 内核
- python - 相同的 CSS,不同的浏览器结果和 bs4 .select() 方法
- javascript - ERROR Uncaught SyntaxError: Unexpected token
我有以下 JS 脚本:
jQuery(document).ready(function($) { $("#idSelect").change(function(event) { var valor = $(this).val();