Skip to content

Commit 387350d

Browse files
committed
some changes
1 parent df666a4 commit 387350d

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

articles/machine-learning/how-to-responsible-ai-text-insights.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ ms.custom: responsible-ml, build-2023, devx-track-python
1717

1818
[!INCLUDE [dev v2](includes/machine-learning-dev-v2.md)]
1919

20-
The [Responsible AI (RAI) dashboard](concept-responsible-ai-dashboard.md) brings together several RAI tools in a single interface to help inform data-driven decisions about your models. Understanding natural language processing (NLP) models can be different from assessing tabular data. RAI dashboard debugging and visualizations now support text data.
20+
The [Responsible AI (RAI) dashboard](concept-responsible-ai-dashboard.md) brings together several RAI tools in a single interface to help inform data-driven decisions about your models. Understanding natural language processing (NLP) models can be different from assessing tabular data. RAI dashboard model debugging and visualizations now support text data.
2121

22-
The Responsible AI text dashboard provides several mature RAI tools in the areas of error analysis, model interpretability, unfairness assessment, and mitigation. The dashboard supports a holistic assessment and debugging of NLP models for making informed business decisions.
22+
The Responsible AI text dashboard provides several mature RAI tools in the areas of error analysis, model interpretability, unfairness assessment, and mitigation. The dashboard supports holistic assessment and debugging of NLP models to aid in making informed business decisions.
2323

24-
This article describes how the Responsible AI text insights component generates a Responsible AI text dashboard by using a pipeline job. The following sections provide specifications and requirements for the text insights component and example code snippets in YAML and Python.
24+
This article describes the Responsible AI text insights component and how to use it in a pipeline job to generate a Responsible AI text dashboard. The following sections provide specifications and requirements for the text insights component and example code snippets in YAML and Python.
2525

2626
> [!IMPORTANT]
2727
> The Responsible AI text dashboard is currently in public preview. This preview is provided without a service-level agreement, and isn't recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
@@ -34,30 +34,30 @@ The Azure Machine Learning Responsible AI text insights component assembles gene
3434

3535
- All models must be registered in Azure Machine Learning.
3636
- MLflow models with a sklearn (scikit-learn) or PyTorch flavor and HuggingFace models are supported.
37-
- The training and test dataset inputs must be in mltable format.
38-
- For performance reason, the test dataset is restricted to 5,000 rows of the visualization UI.
37+
- The training and test dataset inputs must be in `mltable` format.
38+
- The test dataset is restricted to 5,000 rows of the visualization UI, for performance reasons.
3939

4040
### Parameters
4141

42-
The Responsible AI text insights `task_type` parameter supports the following scenarios:
42+
The Responsible AI text insights component supports the following scenarios through the `task_type` parameter:
4343

4444
| Name | Description | Parameter value |
4545
|---------------------------------|-----------------------------------------------------|---------------------------------------------|
46-
| Text Classification | Predict classes for the given text content | `task_type="text_classification"` |
47-
| Multi-label Text Classification | Predict multiple classes for the given text content | `task_type="multilabel_text_classification"` |
48-
| Text Question Answering | Evaluate a question answering model on the text dataset | `task_type="question_answering"` |
46+
| Text Classification | Predicts classes for the given text content | `task_type="text_classification"` |
47+
| Multi-label Text Classification | Predicts multiple classes for the given text content | `task_type="multilabel_text_classification"` |
48+
| Text Question Answering | Evaluates a question answering model on the text dataset | `task_type="question_answering"` |
4949

50-
The Responsible AI text insights component accepts the following other parameters:
50+
The component accepts the following optional parameters:
5151

5252
| Parameter name | Description | Type |
5353
|----------------|-------------|------|
54-
| `title` | (Optional) Brief description of the dashboard. | String |
55-
| `classes` | (Optional) The full list of class labels in the training dataset. | List of strings |
56-
| `maximum_rows_for_test_dataset` | (Optional) The maximum number of rows allowed in the test dataset, for performance reasons. Defaults to 5,000. | Integer |
54+
| `title` | Brief description of the dashboard. | String |
55+
| `classes` | The full list of class labels in the training dataset. | List of strings |
56+
| `maximum_rows_for_test_dataset` | The maximum number of rows allowed in the test dataset. Defaults to 5,000. | Integer |
5757
| `target_column_name` | The name of the column in the input datasets that the model is trying to predict. | String |
5858
| `enable_explanation` | Enable generating an explanation for the model. | Boolean |
5959
| `enable_error_analysis` | Enable generating an error analysis for the model. | Boolean|
60-
| `use_model_dependency` | The Responsible AI environment doesn't include the model dependencies. When set to `True`, installs the model dependency packages. | Boolean |
60+
| `use_model_dependency` | The Responsible AI environment doesn't include the model dependencies by default. When set to `True`, installs the model dependency packages. | Boolean |
6161
| `use_conda` | Installs the model dependency packages using `conda` if set to `True`, otherwise uses `pip`. | Boolean |
6262

6363
### Ports
@@ -68,21 +68,22 @@ The Responsible AI text insights component has three major input ports:
6868
- The training dataset
6969
- The test dataset
7070

71-
The easiest way to supply the input model is to register the model and reference the same model in the `model_input` port of the Responsible AI text insights component.
72-
73-
The training and test datasets don't have to be, but can be the same dataset.
71+
The training and test datasets don't have to be, but can be the same dataset. The easiest way to supply the model input is to register the model and reference the same model in the `model_input` port of the Responsible AI text insights component.
7472

7573
There are two output ports:
7674

7775
- The `dashboard` port contains the completed `RAITextInsights` object.
7876
- The `ux_json` port contains the data required to display a minimal dashboard.
7977

78+
### Pipeline job
79+
80+
To create the Responsible AI text dashboard, you can define the RAI components in a pipeline and submit the pipeline job.
81+
8082
# [YAML](#tab/yaml)
8183

82-
You can specify the pipeline as a YAML file, as in the following example, and submit it by using the Azure CLI command line.
84+
You can specify the pipeline as a YAML file, as in the following example, and submit it by using the Azure CLI `az ml job create` command.
8385

8486
```yml
85-
jobs:
8687
analyse_model:
8788
type: command
8889
component: azureml://registries/AzureML/components/rai_text_insights/versions/2
@@ -106,15 +107,15 @@ jobs:
106107
107108
The Responsible AI text dashboard uses the [Responsible AI Text SDK for Python](https://github.com/microsoft/responsible-ai-toolbox/tree/main/responsibleai_text).
108109
109-
First, load the RAI component:
110+
In your Python script, load the RAI text insights component:
110111
111112
```python
112113
rai_text_insights_component = ml_client_registry.components.get(
113114
name="rai_text_insights", version=version_string
114115
)
115116
```
116117

117-
Then, inside the pipeline, initiate the RAI Text Insights as in the following example:
118+
Inside the pipeline, initiate the RAI text insights as in the following example:
118119

119120
```python
120121
rai_text_job = rai_text_insights_component(

0 commit comments

Comments
 (0)