Skip to content

Commit 6122b1a

Browse files
Merge pull request #230529 from laujan/69934-create-use-glossaries-DT
69934 create use glossaries dt
2 parents 06b8f3a + e98dd57 commit 6122b1a

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed

articles/cognitive-services/Translator/document-translation/how-to-guides/cognitive-services-rest-samples/curl/Translator/translate-with-glossary.json

Whitespace-only changes.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Create and use a glossary with Document Translation
3+
description: How to create and use a glossary with Document Translation.
4+
ms.topic: how-to
5+
manager: nitinme
6+
ms.author: lajanuar
7+
author: laujan
8+
ms.date: 03/14/2023
9+
---
10+
11+
# Use glossaries with Document Translation
12+
13+
A glossary is a list of terms with definitions 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 language translation. Common use cases for glossaries include:
14+
15+
* **Context-specific terminology**. Create a glossary that designates specific meanings for your unique context.
16+
17+
* **No translation**. For example, you can 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 poly​semantic words.
20+
21+
## Create, upload, and use a glossary file
22+
23+
1. **Create your glossary file.** Create a file in a supported format (preferably tab-separated values) that contains all the terms and phrases you want to use in your translation.
24+
25+
To check if your file format is supported, *see* [Get supported glossary formats](../reference/get-supported-glossary-formats.md).
26+
27+
The following English-source glossary contains words that can have different meanings depending upon the context in which they're used. The glossary provides the expected translation for each word in the file to help ensure accuracy.
28+
29+
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 `shore` to reflect its topographical meaning. Similarly, the word `Crane` can refer to either a `bird` or a `machine`.
30+
31+
***Example glossary .tsv file: English-to-French***
32+
33+
```tsv
34+
Bank Banque
35+
Card Carte
36+
Crane Grue
37+
Office Office
38+
Tiger Tiger
39+
US United States
40+
```
41+
42+
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.
43+
44+
1. **Specify your glossary in the translation request.** Include the **`glossary URL`**, **`format`**, and **`version`** in your **`POST`** request:
45+
46+
:::code language="json" source="../../../../../cognitive-services-rest-samples/curl/Translator/translate-with-glossary.json" range="1-23" highlight="13-15":::
47+
48+
### Case sensitivity
49+
50+
By default, Azure Cognitive Services Translator service API is **case-sensitive**, meaning that it matches terms in the source text based on case.
51+
52+
* **Partial sentence application**. When your glossary is applied to **part of a sentence**, the Document Translation API checks whether the glossary term matches the case in the source text. If the casing doesn't match, the glossary isn't applied.
53+
54+
* **Complete sentence application**. 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.
55+
56+
## Next steps
57+
58+
Try the Document Translation how-to guide to asynchronously translate whole documents using a programming language of your choice:
59+
60+
> [!div class="nextstepaction"]
61+
> [Use Document Translation REST APIs](use-rest-api-programmatically.md)
56.5 KB
Loading
6.7 KB
Loading

articles/cognitive-services/Translator/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ items:
149149
- name: Create and use managed identities
150150
displayName: batch,azure active directory,azure ad,azure role-based access control,azure RBAC,sas,assignment,role,owner,user access administrator,contributor
151151
href: document-translation/how-to-guides/create-use-managed-identities.md
152+
- name: Create and use glossaries
153+
displayName: glossary, dictionary, case-sensitive, match
154+
href: document-translation/how-to-guides/create-use-glossaries.md
152155
- name: Reference
153156
items:
154157
- name: Document Translation REST APIs

0 commit comments

Comments
 (0)