Skip to content

Commit 96d94ac

Browse files
committed
CLU container update
1 parent 4dfdce4 commit 96d94ac

File tree

3 files changed

+71
-6
lines changed

3 files changed

+71
-6
lines changed

articles/ai-services/cognitive-services-container-support.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Azure AI containers provide the following set of Docker containers, each of whic
5656
| [Language service][ta-containers-pii] | **Personally Identifiable Information (PII) detection** ([image](https://mcr.microsoft.com/en-us/product/azure-cognitive-services/textanalytics/pii/tags))| Detect and redact personally identifiable information entities from text. | Generally available. <br>This container can also [run in disconnected environments](containers/disconnected-containers.md). |
5757
| [Language service][ta-containers-cner] | **Custom Named Entity Recognition** ([image](https://mcr.microsoft.com/product/azure-cognitive-services/textanalytics/customner/about))| Extract named entities from text, using a custom model you create using your data. | Generally available |
5858
| [Language service][ta-containers-summarization] | **Summarization** ([image](https://mcr.microsoft.com/product/azure-cognitive-services/textanalytics/summarization/about))| Summarize text from various sources. | Public preview. <br>This container can also [run in disconnected environments](containers/disconnected-containers.md). |
59+
| [Language service][ta-containers-clu] | **Conversational Language Understanding** ([image](https://mcr.microsoft.com/product/azure-cognitive-services/textanalytics/clu/about))| Interpret conversational language. | Generally Available. <br>This container can also [run in disconnected environments](containers/disconnected-containers.md). |
5960
| [Translator][tr-containers] | **Translator** ([image](https://mcr.microsoft.com/product/azure-cognitive-services/translator/text-translation/about))| Translate text in several languages and dialects. | Generally available. Gated - [request access](https://aka.ms/csgate-translator). <br>This container can also [run in disconnected environments](containers/disconnected-containers.md). |
6061

6162
### Speech containers
@@ -132,6 +133,7 @@ Install and explore the functionality provided by containers in Azure AI service
132133
[ta-containers-cner]: language-service/custom-named-entity-recognition/how-to/use-containers.md
133134
[ta-containers-summarization]: language-service/summarization/how-to/use-containers.md
134135
[ta-containers-ner]: language-service/named-entity-recognition/how-to/use-containers.md
135-
[ta-containers-pii]: language-service/personally-identifiable-information//how-to/use-containers.md
136+
[ta-containers-pii]: language-service/personally-identifiable-information/how-to/use-containers.md
137+
[ta-contatiners-clu]: language-service/conversational-language-understanding/how-to/use-containers.md
136138
[tr-containers]: translator/containers/translator-how-to-install-container.md
137139
[request-access]: https://aka.ms/csgate

articles/ai-services/containers/disconnected-containers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Containers enable you to run Azure AI services APIs in your own environment, and
2828
* [Summarization](../language-service/summarization/how-to/use-containers.md)
2929
* [Named Entity Recognition](../language-service/named-entity-recognition/how-to/use-containers.md)
3030
* [Personally Identifiable Information (PII) detection](../language-service/personally-identifiable-information/how-to/use-containers.md)
31+
* [Conversational Language Understanding (CLU)](../language-service/conversational-language-understanding/how-to/use-containers.md)
3132
* [Azure AI Vision - Read](../computer-vision/computer-vision-how-to-install-containers.md)
3233
* [Document Intelligence](../../ai-services/document-intelligence/containers/disconnected.md)
3334

@@ -90,6 +91,7 @@ See the following documentation for steps on downloading and configuring the con
9091
* [Language Detection](../language-service/language-detection/how-to/use-containers.md#run-the-container-disconnected-from-the-internet)
9192
* [Named Entity Recognition](../language-service/named-entity-recognition/how-to/use-containers.md#run-the-container-disconnected-from-the-internet)
9293
* [Personally Identifiable Information (PII) detection](../language-service/personally-identifiable-information/how-to/use-containers.md#run-the-container-disconnected-from-the-internet)
94+
* [Conversational Language Understanding (CLU)](../language-service/conversational-language-understanding/how-to/use-containers.md#run-the-container-disconnected-from-the-internet)
9395

9496
## Environment variable names in Kubernetes deployments
9597
Some Azure AI Containers, for example Translator, require users to pass environmental variable names that include colons (`:`) when running the container. This will work fine when using Docker, but Kubernetes does not accept colons in environmental variable names.

articles/ai-services/language-service/conversational-language-understanding/how-to/use-containers.md

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,74 @@ It is recommended to have a CPU with AVX-512 instruction set, for the best exper
4545

4646
| | Minimum host specs | Recommended host specs |
4747
|---------------------|------------------------|------------------------|
48-
| **CLU** | 1 core, 2GB memory | 4 cores, 8GB memory |
48+
| **CLU** | 1 core, 2GB memory | 4 cores, 8GB memory |
4949

5050
CPU core and memory correspond to the `--cpus` and `--memory` settings, which are used as part of the `docker run` command.
5151

52+
## Export your Conversational Language Understanding model
53+
54+
Before you proceed with running the docker image, you will need to export your own trained model to expose it to your container. Use the following command to extract your model and replace the placeholders below with your own values:
55+
56+
|Placeholder |Value|Format or example|
57+
|------------|-----|-----------------|
58+
|**{API_KEY}** |The key for your Language resource. You can find it on your resource's **Key and endpoint** page, on the Azure portal.|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
59+
|**{ENDPOINT_URI}**|The endpoint for accessing the Conversational Language Understanding API. You can find it on your resource's **Key and endpoint** page, on the Azure portal.|https://<your-custom-subdomain>.cognitiveservices.azure.com|
60+
|**{PROJECT_NAME}**|The name of the project containing the model that you want to export. You can find it on your projects tab in the Language Studio portal.|myProject|
61+
|**{TRAINED_MODEL_NAME}** |The name of the trained model you want to export. You can find your trained models on your model evaluation tab under your project in the Language Studio portal|myTrainedModel
62+
|**{EXPORTED_MODEL_NAME}** |The name to assign for the new exported model created.|myExportedModel |
63+
64+
```bash
65+
curl --location --request PUT '{ENDPOINT_URI}/language/authoring/analyze-conversations/projects/{PROJECT_NAME}/exported-models/{EXPORTED_MODEL_NAME}?api-version=2024-11-15-preview'\
66+
--header 'Ocp-Apim-Subscription-Key: {API_KEY}'\
67+
--header 'Content-Type: application/json'\
68+
--data-raw '{
69+
    "TrainedModelLabel": "{TRAINED_MODEL_NAME}"
70+
}'
71+
```
72+
5273
## Get the container image with `docker pull`
5374

54-
The CLU container image can be found on the `mcr.microsoft.com` container registry syndicate. It resides within the `azure-cognitive-services/textanalytics/` repository and is named `clu`. The fully qualified container image name is, `mcr.microsoft.com/azure-cognitive-services/textanalytics/clu`
75+
The CLU container image can be found on the `mcr.microsoft.com` container registry syndicate. It resides within the `azure-cognitive-services/language/` repository and is named `clu`. The fully qualified container image name is, `mcr.microsoft.com/azure-cognitive-services/language/clu`
5576

56-
To use the latest version of the container, you can use the `latest` tag, which is for English. You can also find a full list of containers for supported languages using the [tags on the MCR](https://mcr.microsoft.com/product/azure-cognitive-services/textanalytics/clu/tags).
77+
To use the latest version of the container, you can use the `latest` tag, which is for English. You can also find a full list of containers for supported languages using the [tags on the MCR](https://mcr.microsoft.com/product/azure-cognitive-services/language/clu/tags).
5778

5879
The latest CLU container is available in several languages. To download the container for the English container, use the command below.
5980

6081
```
61-
docker pull mcr.microsoft.com/azure-cognitive-services/textanalytics/clu:latest
82+
docker pull mcr.microsoft.com/azure-cognitive-services/language/clu:latest
6283
```
6384

6485
[!INCLUDE [Tip for using docker list](../../../includes/cognitive-services-containers-docker-list-tip.md)]
6586

87+
## Run the container in download model mode
88+
89+
After creating the exported model in the section above, users will have to run the container in order to download the deployment package that was created specifically for their exported models.
90+
91+
|Placeholder|Value|Format or example|
92+
|-----------|-----|-----------------|
93+
|**{API_KEY}** |The key for your Language resource. You can find it on your resource's **Key and endpoint** page, on the Azure portal. |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| 
94+
|**{ENDPOINT_URI}**|The endpoint for accessing the API. You can find it on your resource's **Key and endpoint** page, on the Azure portal.  |https://<your-custom-subdomain>.cognitiveservices.azure.com  |
95+
|**{IMAGE_TAG}**|The image tag representing the language of the container you want to run. Make sure this matches the `docker pull` command you used.  |latest  |
96+
|**{LOCAL_CLU_PORT}** |Port number assigned for the container in local machine. |5000 |
97+
|**{LOCAL_MODEL_DIRECTORY}** |Absolute directory in host machine where exported models will be saved in. |C:\usr\local\myDeploymentPackage |
98+
|**{PROJECT_NAME}** |Name of the project that the exported model belongs to |myProject |
99+
|**{EXPORTED_MODEL_NAME}** |Exported model to be downloaded |myExportedModel |
100+
101+
```bash
102+
docker run --rm -it -p {LOCAL_CLU_PORT}:80 \
103+
mcr.microsoft.com/azure-cognitive-services/language/clu:{IMAGE_TAG} \ 
104+
-v {LOCAL_MODEL_DIRECTORY}:/DeploymentPackage \
105+
Billing={ENDPOINT_URI} \ 
106+
ApiKey={API_KEY} \
107+
downloadmodel \
108+
projectName={PROJECT_NAME} \
109+
exportedModelName={EXPORTED_MODEL_NAME}
110+
```
111+
112+
DO NOT alter the downloaded files. Even altering the name or folder structure can affect the integrity of the container and might break it.
113+
114+
Repeat those steps to download as many models as you'd like to test. They can belong to different projects and have different exported model names.
115+
66116
## Run the container with `docker run`
67117

68118
Once the container is on the host computer, use the [docker run](https://docs.docker.com/engine/reference/commandline/run/) command to run the containers. The container will continue to run until you stop it. Replace the placeholders below with your own values:
@@ -79,10 +129,14 @@ To run the CLU container, execute the following `docker run` command. Replace th
79129
| **{API_KEY}** | The key for your Language resource. You can find it on your resource's **Key and endpoint** page, on the Azure portal. |`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`|
80130
| **{ENDPOINT_URI}** | The endpoint for accessing the API. You can find it on your resource's **Key and endpoint** page, on the Azure portal. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
81131
| **{IMAGE_TAG}** | The image tag representing the language of the container you want to run. Make sure this matches the `docker pull` command you used. | `latest` |
132+
|**{LOCAL_CLU_PORT}** |Port number assigned for the container in local machine. |5000 |
133+
|**{LOCAL_NER_PORT}** |Port number of the NER container. See Run NER Container section below. |5001 (Has to be different that the above port number) |
134+
|**{LOCAL_LOGGING_DIRECTORY}** |Absolute directory in host machine where that logs will be saved in. |C:\usr\local\mylogs |
135+
|**{LOCAL_MODEL_DIRECTORY}** |Absolute directory in host machine where exported models are saved in. |C:\usr\local\myDeploymentPackage |
82136

83137
```bash
84138
docker run --rm -it -p 5000:5000 --memory 8g --cpus 1 \
85-
mcr.microsoft.com/azure-cognitive-services/textanalytics/clu:{IMAGE_TAG} \
139+
mcr.microsoft.com/azure-cognitive-services/language/clu:{IMAGE_TAG} \
86140
Eula=accept \
87141
Billing={ENDPOINT_URI} \
88142
ApiKey={API_KEY}
@@ -97,6 +151,13 @@ This command:
97151

98152
[!INCLUDE [Running multiple containers on the same host](../../../includes/cognitive-services-containers-run-multiple-same-host.md)]
99153

154+
## Running NER Container
155+
CLU relies on NER to handle prebuilt entities. The CLU container will work properly without NER if users decide not to integrate it. NER billing is disabled when it’s used through CLU, no extra charges are generated unless a call is made directly to NER’s container.
156+
157+
To set NER up in CLU container
158+
- Follow the [NER container documentation](../../named-entity-recognition/how-to/use-containers.md).
159+
- When running CLU container, make sure to set the parameter `Ner_Url `so that `Ner_Url=http://host.docker.internal:{LOCAL_NER_PORT}`
160+
100161
## Query the container's prediction endpoint
101162

102163
The container provides REST-based query prediction endpoint APIs.

0 commit comments

Comments
 (0)