您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

快速入门:生成、部署和使用翻译的自定义模型Quickstart: Build, deploy, and use a custom model for translation

本文提供的分步说明介绍如何使用自定义翻译生成一个翻译系统。This article provides step-by-step instructions to build a translation system with Custom Translator.

先决条件Prerequisites

  1. 若要使用自定义翻译门户,需要通过 Microsoft 帐户Azure AD 帐户(在 Azure 上托管的组织帐户)进行登录。To use the Custom Translator Portal, you will need a Microsoft account or Azure AD account (organization account hosted on Azure) to sign in.

  2. 通过 Azure 门户完成的对文本翻译 API 的订阅。A subscription to the Translator Text API via the Azure portal. 需要文本翻译 API 订阅密钥才能与自定义翻译中的工作区相关联。You will need the Translator Text API subscription key to associate with your workspace in Custom Translator. 请参阅如何注册文本翻译 APISee how to sign up for the Translator Text API.

  3. 上面两项都有了以后,请登录到自定义翻译门户。When you have both of the above, sign in to the Custom Translator portal. 进入自定义翻译门户以后,请导航到“设置”页,可以在其中将 Microsoft 文本翻译 API 订阅密钥与工作区相关联。Once on the Custom Translator portal, navigate to the Settings page where you can associate your Microsoft Translator Text API subscription key with your workspace.

创建一个项目Create a project

在自定义翻译门户登陆页中,单击“新建项目”。On the Custom Translator portal landing page, click New Project. 在对话框中,可以输入所需的项目名称、语言对、类别,以及其他相关字段。On the dialog you can enter your desired project name, language pair, and category, as well as other relevant fields. 然后,保存项目。Then, save your project. 有关更多详细信息,请访问创建项目For more details, visit Create Project.

创建项目

上传文档Upload documents

接下来,上传训练优化测试文档设置。Next, upload training, tuning and testing document sets. 可以上传并行文档和组合文档。You can upload both parallel and combo documents. 还可以上传字典You can also upload dictionary.

可以通过文档选项卡或特定项目的页面上传文档。You can upload documents from either the documents tab or from a specific project's page.

上传文档

上传文档时,请选择文档类型(训练、优化或测试)以及语言对。When uploading documents, choose the document type (training, tuning, or testing), and the language pair. 上传并行文档时,需额外指定文档名称。When uploading parallel documents, you'll need to additionally specify a document name. 有关更多详细信息,请访问上传文档For more details, visit Upload document.

创建模型Create a model

所有必需文档都上传以后,下一步是生成模型。When all your required documents are uploaded the next step is to build your model.

选择已创建的项目。Select the project you've created. 将会看到已上传的所有文档,这些文档与此项目共享一个语言对。You'll see all the documents you've uploaded that share a language pair with this project. 选择要包括在模型中的文档。Select the documents that you want included in your model. 可以选择训练优化测试数据,或者只选择训练数据,让自定义翻译自动为模型生成优化和测试设置。You can select training, tuning, and testing data or select just training data and let Custom Translator automatically build tuning and test sets for your model.

创建模型

选择完所需文档以后,请单击“创建模型”按钮,创建模型并开始训练。When you've finished selecting your desired documents, click Create Model button to create your model and start training. 可以在“模型”选项卡中查看训练的状态,以及所有模型的详细信息。You can see the status of your training, and details for all the models you've trained, in the Models tab.

有关更多详细信息,请访问创建模型For more details, visit Create a Model.

分析模型Analyze your model

训练成功完成以后,请检查结果。Once your training has completed successfully, inspect the results. BLEU 分数是一个指标,指示翻译的质量。The BLEU score is one metric that indicates the quality of your translation. 也可手动比较通过自定义模型进行的翻译与测试集中提供的翻译,方法是导航到“测试”选项卡,然后单击“系统结果”。You can also manually compare the translations made with your custom model to the translations provided in your test set by navigating to the "Test" tab and clicking "System Results." 手动检查这其中的一些翻译可以很好地了解系统的翻译质量。Manually inspecting a few of these translations will give you a good idea of the quality of translation produced by your system. 有关更多详细信息,请访问系统测试结果For more details, visit System Test Results.

部署训练的模型Deploy a trained model

准备部署训练的模型时,请单击“部署”按钮。When you are ready to deploy your trained model, click the "Deploy" button. 每个项目可以有一个部署的模型。可以在“状态”列中查看部署的状态。You can have one deployed model per project, and you can view the status of your deployment in the Status column. 有关更多详细信息,请访问模型部署For more details, visit Model Deployment

部署训练的模型

使用已部署的模型Use a deployed model

部署的模型可以通过 Microsoft 文本翻译 API V3 进行访问,方法是指定 CategoryIDDeployed models can be accessed via the Microsoft Translator Text API V3 by specifying the CategoryID. 有关文本翻译 API 的详细信息,可查看 API 参考网页。More information about the Translator Text API can be found on the API Reference webpage.

后续步骤Next steps