Skip to content

Commit 219dd4b

Browse files
committed
add new glossary article
1 parent 9506019 commit 219dd4b

File tree

2 files changed

+54
-8
lines changed

2 files changed

+54
-8
lines changed

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

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,34 @@ ms.topic: how-to
55
manager: nitinme
66
ms.author: lajanuar
77
author: laujan
8-
ms.date: 03/13/2023
8+
ms.date: 03/14/2023
99
---
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. 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 source-to-target (not one-to-many language) language translations. Common use cases for glossaries include:
1414

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

1717
* **Name brand preservation**. Restrict Document Translation from translating product name brands by using a glossary with the same source and target text.
1818

19-
* **Specify translation for words with several meanings**. Choose a specific translation for polysemantic words.
19+
* **Specify translation for words with several meanings**. Choose a specific translation for poly​semantic words.
20+
21+
## Case sensitivity
22+
23+
By default, Azure Cognitive Services Translator service API is **case-sensitive**, meaning that it matches terms in the source text based on case.
24+
25+
#### Partial sentence application
26+
27+
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.
28+
29+
#### Complete sentence application
30+
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.
2032

2133
## Create, upload, and use a glossary file
2234

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.:
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.
2436

2537
:::image type="content" source="../media/key-endpoint.png" alt-text="Screenshot showing the key and endpoint fields in the Azure portal.":::
2638

@@ -40,8 +52,19 @@ A glossary is a custom dictionary that you create for the Document Translation s
4052
4153
:::image type="content" source="../media/tsv-file.png" alt-text="Example of a TSV formatted glossary file formatted":::
4254
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.
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.
56+
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`.
58+
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.
60+
61+
1. **Specify your glossary in the translation request.** Include the glossary URL, format, and version in your **`POST`** request:
62+
63+
:::code language="json" source="translate-with-glossary.json" range="1-23" highlight="13-15":::
64+
65+
## Next steps
4466
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.
67+
Try the Document Translation how-to guide to asynchronously translate whole documents using a programming language of your choice:
4668
47-
1. Next, Upload your glossary: upload your glossary to your Azure Blob Storage account.
69+
> [!div class="nextstepaction"]
70+
> [Use Document Translation REST APIs](use-rest-api-programmatically.md)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"inputs": [
3+
{
4+
"source": {
5+
"sourceUrl": "https://my.blob.core.windows.net/source-en?sv=2019-12-12&st=2021-03-05T17%3A45%3A25Z&se=2021-03-13T17%3A45%3A00Z&sr=c&sp=rl&sig=SDRPMjE4nfrH3csmKLILkT%2Fv3e0Q6SWpssuuQl1NmfM%3D"
6+
},
7+
"targets": [
8+
{
9+
"targetUrl": "https://my.blob.core.windows.net/target-fr?sv=2019-12-12&st=2021-03-05T17%3A49%3A02Z&se=2021-03-13T17%3A49%3A00Z&sr=c&sp=wdl&sig=Sq%2BYdNbhgbq4hLT0o1UUOsTnQJFU590sWYo4BOhhQhs%3D",
10+
"language": "fr",
11+
"glossaries": [
12+
{
13+
"glossaryUrl": "https://my.blob.core.windows.net/glossaries/en-fr.xlf?sv=2019-12-12&st=2021-03-05T17%3A45%3A25Z&se=2021-03-13T17%3A45%3A00Z&sr=c&sp=rl&sig=BsciG3NWoOoRjOYesTaUmxlXzyjsX4AgVkt2AsxJ9to%3D",
14+
"format": "xliff",
15+
"version": "1.2"
16+
}
17+
]
18+
19+
}
20+
]
21+
}
22+
]
23+
}

0 commit comments

Comments
 (0)