Skip to content

Commit c2facb7

Browse files
committed
edit for review
1 parent 219dd4b commit c2facb7

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

articles/cognitive-services/Translator/document-translation/how-to-guides/create-use-glossary-dictionary.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.date: 03/14/2023
1010

1111
# Create and use a glossary with Document Translation
1212

13-
A glossary is a custom dictionary that you create for the Document Translation service to use during the translation process. Currently, the glossary feature supports one-to-one source-to-target (not one-to-many language) language translations. Common use cases for glossaries include:
13+
A glossary is a custom dictionary that you create for the Document Translation service to use during the translation process. Currently, the glossary feature supports one-to-one (not one-to-many language) source-to-target language translation. Common use cases for glossaries include:
1414

1515
* **Domain-specific terminology**. Create a glossary that designates specific meanings for your unique context.
1616

@@ -28,37 +28,39 @@ When your glossary is applied to **part of a sentence**, the Document Translatio
2828

2929
#### Complete sentence application
3030

31-
When your glossary is applied to a **complete sentence**, the service becomes **case-insensitive**. It matches the glossary term regardless of its casing in the source text. This provision applies the correct results for use cases involving idioms and quotes.
31+
When your glossary is applied to a **complete sentence**, the service becomes **case-insensitive**. It matches the glossary term regardless of its case in the source text. This provision applies the correct results for use cases involving idioms and quotes.
3232

3333
## Create, upload, and use a glossary file
3434

35-
1. **Create your glossary file.** Create a file in a supported format that contains all the terms and phrases you want to use in your translation. You can check to see if your format is supported using the [Get supported glossary formats](../reference/get-supported-glossary-formats.md). To follow, is a sample REST API call using PowerShell. Update `your-document-translation-key` and `your-document-translation-endpoint` with values from the Azure portal. Only one key is necessary to make an API call.
35+
1. **Create your glossary file.** Create a file in a supported format that contains all the terms and phrases you want to use in your translation.
3636

37-
:::image type="content" source="../media/key-endpoint.png" alt-text="Screenshot showing the key and endpoint fields in the Azure portal.":::
37+
* You can check to see if your format is supported using the [Get supported glossary formats](../reference/get-supported-glossary-formats.md).
3838

39-
***Get supported glossary formats request***
39+
* To follow, is a sample REST API call using PowerShell. To use the sample, update `your-document-translation-key` and `your-document-translation-endpoint` with values from the Azure portal. Only one key is necessary to make an API call.
4040

41-
```powershell
42-
@"
43-
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
44-
$headers.Add("Ocp-Apim-Subscription-Key", "your-document-translation-key")
41+
***Get supported glossary formats request***
4542

46-
$response = Invoke-RestMethod 'your-document-translation-endpoint/translator/text/batch/v1.0/glossaries/formats' -Method 'GET' -Headers $headers
47-
$response | ConvertTo-Json
48-
"@
49-
```
43+
```powershell
44+
@"
45+
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
46+
$headers.Add("Ocp-Apim-Subscription-Key", "your-document-translation-key")
5047
51-
***Example glossary file tab-separated values (.tsv)***
48+
$response = Invoke-RestMethod 'your-document-translation-endpoint/translator/text/batch/v1.0/glossaries/formats' -Method 'GET' -Headers $headers
49+
$response | ConvertTo-Json
50+
"@
51+
```
5252
53-
:::image type="content" source="../media/tsv-file.png" alt-text="Example of a TSV formatted glossary file formatted":::
53+
In the following English-source glossary, the words can have different meanings depending upon the context in which they're used. The glossary provides translations for each word in the file to help ensure accurate translations.
5454
55-
In this English-source glossary, the words can have different meanings depending upon the context in which they're used. The glossary provides translations for each word in the file to help ensure accurate translations.
55+
For instance, when the word `Bank` appears in a financial document, it would be translated as `Banque` to reflect its financial meaning. If the word `Bank` appears in a geography document, it might be translated as `land beside a river` to reflect its topographical meaning. Similarly, the word `Crane` can refer to either a `bird` or a `machine`.
5656
57-
For instance, when the word `Bank` appears in a financial document, it would be translated as `Banque` to reflect its financial meaning. If the word `Bank` appears in a geography document, it might be translated as `land beside a river` to reflect its topographical meaning. Similarly, the word `Crane` can refer to either a `bird` or a `machine`.
57+
***Example glossary file tab-separated values (.tsv)***
58+
59+
:::image type="content" source="../media/tsv-file.png" alt-text="Example of a TSV formatted glossary file formatted":::
5860
59-
1. **Upload your glossary to the Azure storage**. To complete this step, you need an [Azure Blob Storage account](https://ms.portal.azure.com/#create/Microsoft.StorageAccount) with [containers](/azure/storage/blobs/storage-quickstart-blobs-portal?branch=main#create-a-container) to store and organize your blob data within your storage account.
61+
1. **Upload your glossary to Azure storage**. To complete this step, you need an [Azure Blob Storage account](https://ms.portal.azure.com/#create/Microsoft.StorageAccount) with [containers](/azure/storage/blobs/storage-quickstart-blobs-portal?branch=main#create-a-container) to store and organize your blob data within your storage account.
6062
61-
1. **Specify your glossary in the translation request.** Include the glossary URL, format, and version in your **`POST`** request:
63+
1. **Specify your glossary in the translation request.** Include the **`glossary URL`**, **`format`**, and **`version`** in your **`POST`** request:
6264
6365
:::code language="json" source="translate-with-glossary.json" range="1-23" highlight="13-15":::
6466

0 commit comments

Comments
 (0)