Skip to content

Commit 9371e35

Browse files
committed
resolve pr comments
1 parent 14eae3b commit 9371e35

File tree

2 files changed

+23
-37
lines changed

2 files changed

+23
-37
lines changed

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

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
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.
2+
title: Create and use a glossary with Document Translation
3+
description: How to create and use a glossary with Document Translation.
44
ms.topic: how-to
55
manager: nitinme
66
ms.author: lajanuar
@@ -10,49 +10,23 @@ ms.date: 03/14/2023
1010

1111
# Create and use glossaries 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 (not one-to-many language) source-to-target language translation. Common use cases for glossaries include:
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:
1414

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

17-
* **Name brand preservation**. Restrict Document Translation from translating product name brands by using a glossary with the same source and target text.
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.
1818

1919
* **Specify translation for words with several meanings**. Choose a specific translation for poly​semantic words.
2020

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 case in the source text. This provision applies the correct results for use cases involving idioms and quotes.
32-
3321
## Create, upload, and use a glossary file
3422

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.
36-
37-
* You can check to see if your format is supported using the [Get supported glossary formats](../reference/get-supported-glossary-formats.md).
38-
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.
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.
4024

41-
***Get supported glossary formats request***
25+
* To check if your format is supported *see** [Get supported glossary formats](../reference/get-supported-glossary-formats.md).
4226

43-
```powershell
44-
@"
45-
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
46-
$headers.Add("Ocp-Apim-Subscription-Key", "your-document-translation-key")
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.
4728

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-
```
52-
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.
54-
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`.
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`.
5630

5731
***Example glossary file tab-separated values (.tsv)***
5832

@@ -64,6 +38,18 @@ When your glossary is applied to a **complete sentence**, the service becomes **
6438

6539
:::code language="json" source="translate-with-glossary.json" range="1-23" highlight="13-15":::
6640

41+
### Case sensitivity
42+
43+
By default, Azure Cognitive Services Translator service API is **case-sensitive**, meaning that it matches terms in the source text based on case.
44+
45+
#### Partial sentence application
46+
47+
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.
48+
49+
#### Complete sentence application
50+
51+
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.
52+
6753
## Next steps
6854

6955
Try the Document Translation how-to guide to asynchronously translate whole documents using a programming language of your choice:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"language": "fr",
1111
"glossaries": [
1212
{
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",
13+
"glossaryUrl": "https://my.blob.core.windows.net/glossaries/en-fr.tsv?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": "tsv",
1515
"version": "1.2"
1616
}
1717
]

0 commit comments

Comments
 (0)