【问题标题】:Using glossary with a custom model in Google AutoML translation在 Google AutoML 翻译中使用带有自定义模型的词汇表
【发布时间】:2019-11-19 18:41:25
【问题描述】:

我在 Google AutoML 语言翻译中构建了一个自定义模型和一个词汇表。有没有办法同时使用自定义模型和词汇表?如果是这样,request.json 应该是什么样的?

【问题讨论】:

    标签: model request machine-translation google-cloud-automl glossary


    【解决方案1】:

    您完全可以同时使用词汇表和 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"
      }
    }
    

    【讨论】:

    • 嗨,戴尔,我面临着完全相同的问题。我需要将 AutoML 训练的模型与词汇表结合起来。从谷歌文档中我看到不可能将它们结合起来。这个库npmjs.com/package/@google-cloud/automl 也不能提供作为输入参数的词汇表。你有什么建议吗?
    【解决方案2】:

    我不知道如何请求,但我用另一种方式代替。

    • 从“词汇表”中获取翻译。
    • 使用翻译作为自定义模型源文本。

    就像这样: text = "你要翻译" → text2(使用词汇表) → final_result (自定义模型)

    希望对你有所帮助

    【讨论】:

      【解决方案3】:

      “你想翻译”→ text2(使用词汇表)→ final_result(自定义模型)听起来很有趣。我试试看。

      【讨论】:

        猜你喜欢
        • 2020-10-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多