Skip to content

Commit 8891da2

Browse files
authored
Merge pull request #243974 from laujan/123434-custom-translator-qs
123434 add VNet service endpoint support for custom translator
2 parents e615923 + 311cf43 commit 8891da2

File tree

8 files changed

+132
-18
lines changed

8 files changed

+132
-18
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: Enable Virtual Network service endpoints with Custom Translator service
3+
titleSuffix: Azure Cognitive Services
4+
description: This article describes how to use Custom Translator service with an Azure Virtual Network service endpoint.
5+
services: cognitive-services
6+
author: laujan
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: translator-text
10+
ms.date: 07/05/2023
11+
ms.author: moelghaz
12+
ms.topic: how-to
13+
---
14+
15+
# Enable Custom Translator through Azure Virtual Network
16+
17+
In this article, we show you how to set up and use VNet service endpoints with Custom Translator.
18+
19+
Azure Virtual Network (VNet) [service endpoints](../../../../virtual-network/virtual-network-service-endpoints-overview.md) securely connect your Azure service resources to your virtual networks over an optimized route via the Azure global network. Service endpoints enable private IP addresses within your virtual network to reach the endpoint of an Azure service without the need for a public IP address on the virtual network.
20+
21+
For more information, see [Azure Virtual Network overview](../../../../virtual-network/virtual-networks-overview.md)
22+
23+
> [!NOTE]
24+
> Before you start, review [how to use virtual networks with Cognitive Services](../../../cognitive-services-virtual-networks.md).
25+
26+
To set up a Translator resource for VNet service endpoint scenarios, you need the resources:
27+
28+
* [A regional Translator resource (global isn't supported)](../../create-translator-resource.md).
29+
* [VNet and networking settings for the Translator resource](#configure-virtual-networks-resource-networking-settings).
30+
31+
## Configure virtual networks resource networking settings
32+
33+
To start, you need to add all virtual networks that are allowed access via the service endpoint to the Translator resource networking properties. To enable access to a Translator resource via the VNet, you need to enable the `Microsoft.CognitiveServices` service endpoint type for the required subnets of your virtual network. Doing so routes all subnet traffic related to Cognitive Services through the private global network. If you intend to access any other Cognitive Services resources from the same subnet, make sure these resources are also configured to allow your virtual network.
34+
35+
> [!NOTE]
36+
>
37+
> * If a virtual network isn't added as *allowed* in the Translator resource networking properties, it won't have access to the Translator resource via the service endpoint, even if the `Microsoft.CognitiveServices` service endpoint is enabled for the virtual network.
38+
> * If the service endpoint is enabled but the virtual network isn't allowed, the Translator resource won't be accessible for the virtual network through a public IP address, regardless of your other network security settings.
39+
> * Enabling the `Microsoft.CognitiveServices` endpoint routes all traffic related to Cognitive Services through the private global network. Thus, the virtual network should be explicitly allowed to access the resource.
40+
> * This guidance applies for all Cognitive Services resources, not just for Translator resources.
41+
42+
Let's get started:
43+
44+
1. Navigate to the [Azure portal](https://portal.azure.com/) and sign in to your Azure account.
45+
46+
1. Select a regional Translator resource.
47+
48+
1. From the **Resource Management** group in the left side panel, select **Networking**.
49+
50+
:::image type="content" source="../media/how-to/resource-management-networking.png" alt-text="Screenshot of the networking selection under Resource Management in the Azure portal.":::
51+
52+
1. From the **Firewalls and virtual networks** tab, choose **Selected Networks and Private Endpoints**.
53+
54+
:::image type="content" source="../media/how-to/firewalls-virtual-network.png" alt-text="Screenshot of the firewalls and virtual network page in the Azure portal.":::
55+
56+
> [!NOTE]
57+
> To use Virtual Network service endpoints, you need to select the **Selected Networks and Private Endpoints** network security option. No other options are supported.
58+
59+
1. Select **Add existing virtual network** or **Add new virtual network** and provide the required parameters.
60+
61+
* Complete the process by selecting **Add** for an existing virtual network or **Create** for a new one.
62+
63+
* If you add an existing virtual network, the `Microsoft.CognitiveServices` service endpoint is automatically enabled for the selected subnets.
64+
65+
* If you create a new virtual network, the **default** subnet is automatically configured to the `Microsoft.CognitiveServices` service endpoint. This operation can take few minutes.
66+
67+
> [!NOTE]
68+
> As described in the [previous section](#configure-virtual-networks-resource-networking-settings), when you configure a virtual network as *allowed* for the Translator resource, the `Microsoft.CognitiveServices` service endpoint is automatically enabled. If you later disable it, you need to re-enable it manually to restore the service endpoint access to the Translator resource (and to other Cognitive Services resources).
69+
70+
1. Now, when you choose the **Selected Networks and Private Endpoints** tab, you can see your enabled virtual network and subnets under the **Virtual networks** section.
71+
72+
1. How to check the service endpoint
73+
74+
* From the **Resource Management** group in the left side panel, select **Networking**.
75+
76+
* Select your **virtual network** and then select the desired **subnet**.
77+
78+
:::image type="content" source="../media/how-to/select-subnet.png" alt-text="Screenshot of subnet selection section in the Azure portal.":::
79+
80+
* A new **Subnets** window appears.
81+
82+
* Select **Service endpoints** from the **Settings** menu located on the left side panel.
83+
84+
:::image type="content" source="../media/how-to/service-endpoints.png" alt-text="Screenshot of the **Subnets** selection from the **Settings** menu in the Azure portal.":::
85+
86+
1. From the **Settings** menu in the left side panel, choose **Service Endpoints** and, in the main window, check that your virtual network subnet is included in the `Microsoft.CognitiveServices` list.
87+
88+
## Use the Custom Translator portal
89+
90+
The following table describes Custom Translator project accessibility per Translator resource **Networking****Firewalls and virtual networks** security setting:
91+
92+
:::image type="content" source="../media/how-to/allow-network-access.png" alt-text="Screenshot of allowed network access section in the Azure portal.":::
93+
94+
> [!IMPORTANT]
95+
> If you configure **Selected Networks and Private Endpoints** via the **Networking****Firewalls and virtual networks** tab, you can't use the Custom Translator portal and your Translator resource. However, you can still use the Translator resource outside of the Custom Translator portal.
96+
97+
| Translator resource network security setting | Custom Translator portal accessibility |
98+
|--|--|
99+
| All networks | No restrictions |
100+
| Selected Networks and Private Endpoints | Accessible from allowed VNET IP addresses |
101+
| Disabled | Not accessible |
102+
103+
To use Custom Translator without relaxing network access restrictions on your production Translator resource, consider this workaround:
104+
105+
* Create another Translator resource for development that can be used on a public network.
106+
107+
* Prepare your custom model in the Custom Translator portal on the development resource.
108+
109+
* Copy the model on your development resource to your production resource using [Custom Translator non-interactive REST API](https://microsofttranslator.github.io/CustomTranslatorApiSamples/) `workspaces``copy authorization and models``copy functions`.
110+
111+
Congratulations! You learned how to use Azure VNet service endpoints with Custom Translator.
112+
113+
## Learn more
114+
115+
Visit the [**Custom Translator API**](https://microsofttranslator.github.io/CustomTranslatorApiSamples/) page to view our non-interactive REST APIs.
56.5 KB
Loading
109 KB
Loading
18.4 KB
Loading
115 KB
Loading
28.4 KB
Loading

articles/cognitive-services/Translator/custom-translator/quickstart.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,30 @@ author: laujan
66
manager: nitinme
77
ms.service: cognitive-services
88
ms.subservice: translator-text
9-
ms.date: 11/04/2022
9+
ms.date: 07/05/2023
1010
ms.author: lajanuar
1111
ms.topic: quickstart
1212
---
1313
# Quickstart: Build, publish, and translate with custom models
1414

15-
Translator is a cloud-based neural machine translation service that is part of the Azure Cognitive Services family of REST API that can be used with any operating system. Translator powers many Microsoft products and services used by thousands of businesses worldwide to perform language translation and other language-related operations. In this quickstart, you'll learn to build custom solutions for your applications across all [supported languages](../language-support.md).
15+
Translator is a cloud-based neural machine translation service that is part of the Azure Cognitive Services family of REST API that can be used with any operating system. Translator powers many Microsoft products and services used by thousands of businesses worldwide to perform language translation and other language-related operations. In this quickstart, learn to build custom solutions for your applications across all [supported languages](../language-support.md).
1616

1717
## Prerequisites
1818

19-
To use the [Custom Translator](https://portal.customtranslator.azure.ai/) portal, you'll need the following resources:
19+
To use the [Custom Translator](https://portal.customtranslator.azure.ai/) portal, you need the following resources:
2020

2121
* A [Microsoft account](https://signup.live.com).
2222

2323
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
2424
* Once you have an Azure subscription, [create a Translator resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
25-
* You'll need the key and endpoint from the resource to connect your application to the Translator service. You'll paste your key and endpoint into the code below later in the quickstart. You can find these values on the Azure portal **Keys and Endpoint** page:
25+
* You need the key and endpoint from the resource to connect your application to the Translator service. Paste your key and endpoint into the code later in the quickstart. You can find these values on the Azure portal **Keys and Endpoint** page:
2626

2727
:::image type="content" source="../media/keys-and-endpoint-portal.png" alt-text="Screenshot: Azure portal keys and endpoint page.":::
2828

2929
For more information, *see* [how to create a Translator resource](../how-to-create-translator-resource.md).
3030

3131
## Custom Translator portal
3232

33-
>[!Note]
34-
>Custom Translator does not support creating workspace for a Translator Text API resource created inside an [Enabled VNet](../../../api-management/api-management-using-with-vnet.md?tabs=stv2).
35-
3633
Once you have the above prerequisites, sign in to the [Custom Translator](https://portal.customtranslator.azure.ai/) portal to create workspaces, build projects, upload files, train models, and publish your custom solution.
3734

3835
You can read an overview of translation and custom translation, learn some tips, and watch a getting started video in the [Azure AI technical blog](https://techcommunity.microsoft.com/t5/azure-ai/customize-a-translation-to-make-sense-in-a-specific-context/ba-p/2811956).
@@ -41,11 +38,11 @@ You can read an overview of translation and custom translation, learn some tips,
4138

4239
1. [**Create a workspace**](#create-a-workspace). A workspace is a work area for composing and building your custom translation system. A workspace can contain multiple projects, models, and documents. All the work you do in Custom Translator is done inside a specific workspace.
4340

44-
1. [**Create a project**](#create-a-project). A project is a wrapper for models, documents, and tests. Each project includes all documents that are uploaded into that workspace with the correct language pair. For example, if you have both an English-to-Spanish project and a Spanish-to-English project, the same documents will be included in both projects.
41+
1. [**Create a project**](#create-a-project). A project is a wrapper for models, documents, and tests. Each project includes all documents that are uploaded into that workspace with the correct language pair. For example, if you have both an English-to-Spanish project and a Spanish-to-English project, the same documents are included in both projects.
4542

4643
1. [**Upload parallel documents**](#upload-documents). Parallel documents are pairs of documents where one (target) is the translation of the other (source). One document in the pair contains sentences in the source language and the other document contains sentences translated into the target language. It doesn't matter which language is marked as "source" and which language is marked as "target"—a parallel document can be used to train a translation system in either direction.
4744

48-
1. [**Train your model**](#train-your-model). A model is the system that provides translation for a specific language pair. The outcome of a successful training is a model. When you train a model, three mutually exclusive document types are required: training, tuning, and testing. If only training data is provided when queuing a training, Custom Translator will automatically assemble tuning and testing data. It will use a random subset of sentences from your training documents, and exclude these sentences from the training data itself. A 10,000 parallel sentence is the minimum requirement to train a model.
45+
1. [**Train your model**](#train-your-model). A model is the system that provides translation for a specific language pair. The outcome of a successful training is a model. When you train a model, three mutually exclusive document types are required: training, tuning, and testing. If only training data is provided when queuing a training, Custom Translator automatically assembles tuning and testing data. It uses a random subset of sentences from your training documents, and excludes these sentences from the training data itself. A 10,000 parallel sentence is the minimum requirement to train a model.
4946

5047
1. [**Test (human evaluate) your model**](#test-your-model). The testing set is used to compute the [BLEU](beginners-guide.md#what-is-a-bleu-score) score. This score indicates the quality of your translation system.
5148

@@ -82,9 +79,9 @@ You can read an overview of translation and custom translation, learn some tips,
8279

8380
## Create a project
8481

85-
Once the workspace is created successfully, you'll be taken to the **Projects** page.
82+
Once the workspace is created successfully, you're taken to the **Projects** page.
8683

87-
You'll create English-to-German project to train a custom model with only a [training](training-and-model.md#training-document-type-for-custom-translator) document type.
84+
You create English-to-German project to train a custom model with only a [training](training-and-model.md#training-document-type-for-custom-translator) document type.
8885

8986
1. Select **Create project**.
9087

@@ -102,9 +99,7 @@ You'll create English-to-German project to train a custom model with only a [tra
10299

103100
## Upload documents
104101

105-
In order to create a custom model, you need to upload all or a combination of [training](training-and-model.md#training-document-type-for-custom-translator), [tuning](training-and-model.md#tuning-document-type-for-custom-translator), [testing](training-and-model.md#testing-dataset-for-custom-translator), and [dictionary](concepts/dictionaries.md) document types.
106-
107-
In this quickstart, you'll upload [training](training-and-model.md#training-document-type-for-custom-translator) documents for customization.
102+
In order to create a custom model, you need to upload all or a combination of [training](training-and-model.md#training-document-type-for-custom-translator), [tuning](training-and-model.md#tuning-document-type-for-custom-translator), [testing](training-and-model.md#testing-dataset-for-custom-translator), and [dictionary](concepts/dictionaries.md) document types for customization.
108103

109104
>[!Note]
110105
> You can use our sample training, phrase and sentence dictionaries dataset, [Customer sample English-to-German datasets](https://github.com/MicrosoftTranslator/CustomTranslatorSampleDatasets), for this quickstart. However, for production, it's better to upload your own training dataset.
@@ -153,9 +148,9 @@ Now you're ready to train your English-to-German model.
153148

154149
1. After successful model training, select **Model details** from the left navigation menu.
155150

156-
1. Select the model name *en-de with sample data*. Review training date/time, total training time, number of sentences used for training, tuning, testing, and dictionary. Check whether the system generated the test and tuning sets. You'll use the `Category ID` to make translation requests.
151+
1. Select the model name *en-de with sample data*. Review training date/time, total training time, number of sentences used for training, tuning, testing, and dictionary. Check whether the system generated the test and tuning sets. You use the `Category ID` to make translation requests.
157152

158-
1. Evaluate the model [BLEU](beginners-guide.md#what-is-a-bleu-score) score. The test set **BLEU score** is the custom model score and **Baseline BLEU** is the pre-trained baseline model used for customization. A higher **BLEU score** means higher translation quality using the custom model.
153+
1. Evaluate the model [BLEU](beginners-guide.md#what-is-a-bleu-score) score. The test set **BLEU score** is the custom model score and **Baseline BLEU** is the pretrained baseline model used for customization. A higher **BLEU score** means higher translation quality using the custom model.
159154

160155
>[!Note]
161156
>If you train with our shared customer sample datasets, BLEU score will be different than the image.
@@ -168,7 +163,7 @@ Once your training has completed successfully, inspect the test set translated s
168163

169164
1. Select **Test model** from the left navigation menu.
170165
2. Select "en-de with sample data"
171-
3. Human evaluate translation from **New model** (custom model), and **Baseline model** (our pre-trained baseline used for customization) against **Reference** (target translation from the test set)
166+
3. Human evaluate translation from **New model** (custom model), and **Baseline model** (our pretrained baseline used for customization) against **Reference** (target translation from the test set)
172167

173168
## Publish your model
174169

@@ -193,4 +188,4 @@ Publishing your model makes it available for use with the Translator API. A proj
193188
## Next steps
194189

195190
> [!div class="nextstepaction"]
196-
> [Learn how to manage workspaces](how-to/create-manage-workspace.md)
191+
> [Learn how to manage workspaces](how-to/create-manage-workspace.md)

articles/cognitive-services/Translator/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ items:
233233
- name: Copy a custom model
234234
displayName: copy, publish, move, workspace
235235
href: custom-translator/how-to/copy-model.md
236+
- name: Enable private virtual networks
237+
displayName: vnet, service endpoints, private network, global, backbone
238+
href: custom-translator/how-to/enable-vnet-service-endpoint.md
239+
236240
- name: Concepts
237241
items:
238242
- name: Customization

0 commit comments

Comments
 (0)