Skip to content

Commit 9506019

Browse files
committed
add new glossary article
1 parent d2eafb5 commit 9506019

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Create and use glossary (custom dictionary) with Document Translation
3+
description: How to create and use a glossary (custom dictionary) with Document Translation.
4+
ms.topic: how-to
5+
manager: nitinme
6+
ms.author: lajanuar
7+
author: laujan
8+
ms.date: 03/13/2023
9+
---
10+
11+
# Create and use a glossary with Document Translation
12+
13+
A glossary is a custom dictionary that you create for the Document Translation service to use during the translation process. Common use cases for glossaries include:
14+
15+
* **Domain-specific terminology**. Designate specific meanings for your unique context.
16+
17+
* **Name brand preservation**. Restrict Document Translation from translating product name brands by using a glossary with the same source and target text.
18+
19+
* **Specify translation for words with several meanings**. Choose a specific translation for polysemantic words.
20+
21+
## Create, upload, and use a glossary file
22+
23+
1. 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). The following 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.:
24+
25+
:::image type="content" source="../media/key-endpoint.png" alt-text="Screenshot showing the key and endpoint fields in the Azure portal.":::
26+
27+
***Get supported glossary formats request***
28+
29+
```powershell
30+
@"
31+
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
32+
$headers.Add("Ocp-Apim-Subscription-Key", "your-document-translation-key")
33+
34+
$response = Invoke-RestMethod 'your-document-translation-endpoint/translator/text/batch/v1.0/glossaries/formats' -Method 'GET' -Headers $headers
35+
$response | ConvertTo-Json
36+
"@
37+
```
38+
39+
***Example glossary file tab-separated values (.tsv)***
40+
41+
:::image type="content" source="../media/tsv-file.png" alt-text="Example of a TSV formatted glossary file formatted":::
42+
43+
In this English-source glossary, the words can have different meanings depending upon the context in which they are used. The glossary provides translations for each word in the file to help ensure accurate translations.
44+
45+
For instance, if 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 geographic meaning. Similarly, the word "Crane" can refer to either a bird or a machine.
46+
47+
1. Next, Upload your glossary: upload your glossary to your Azure Blob Storage account.
56.5 KB
Loading
6.7 KB
Loading

0 commit comments

Comments
 (0)