add e2e UI notebook tests to covid19 event multilabel text classification notebook (#2282)

This commit is contained in:
Ilya Matiach 2023-08-29 17:12:16 -04:00 коммит произвёл GitHub
Родитель ab6bea8b10
Коммит f7bb1e8fd6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
13 изменённых файлов: 98 добавлений и 9 удалений

Просмотреть файл

@ -156,6 +156,7 @@ jobs:
run: |
yarn e2e-widget -n "responsibleaidashboard-DBPedia-text-classification-model-debugging" -f ${{ matrix.flights }}
yarn e2e-widget -n "responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging" -f ${{ matrix.flights }}
yarn e2e-widget -n "responsibleaidashboard-covid-event-multilabel-text-classification-model-debugging" -f ${{ matrix.flights }}
- name: Upload e2e test screen shot
if: always()

Просмотреть файл

@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
describeDatasetExplorer,
modelAssessmentDatasets
} from "@responsible-ai/e2e";
const datasetShape =
modelAssessmentDatasets.CovidTextClassificationModelDebugging;
describeDatasetExplorer(datasetShape, "CovidTextClassificationModelDebugging");

Просмотреть файл

@ -0,0 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
describeErrorAnalysis,
modelAssessmentDatasets
} from "@responsible-ai/e2e";
const datasetShape =
modelAssessmentDatasets.CovidTextClassificationModelDebugging;
describeErrorAnalysis(datasetShape, "CovidTextClassificationModelDebugging");

Просмотреть файл

@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
describeModelOverview,
modelAssessmentDatasets
} from "@responsible-ai/e2e";
const datasetShape =
modelAssessmentDatasets.CovidTextClassificationModelDebugging;
describeModelOverview(datasetShape, "CovidTextClassificationModelDebugging");

Просмотреть файл

@ -19,7 +19,8 @@ export interface IModelAssessmentData {
isRegression?: boolean;
isBinary?: boolean;
isObjectDetection?: boolean;
isMultiLabel?: boolean;
isImageMultiLabel?: boolean;
isTextMultiLabel?: boolean;
isImageClassification?: boolean;
isTextClassification?: boolean;
}
@ -207,5 +208,6 @@ export enum RAINotebookNames {
"FridgeMultilabelModelDebugging" = "responsibleaidashboard-fridge-multilabel-image-classification-model-debugging.py",
"FridgeObjectDetectionModelDebugging" = "responsibleaidashboard-fridge-object-detection-model-debugging.py",
"DBPediaTextClassificationModelDebugging" = "responsibleaidashboard-DBPedia-text-classification-model-debugging.py",
"BlbooksgenreTextClassificationModelDebugging" = "responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging.py"
"BlbooksgenreTextClassificationModelDebugging" = "responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging.py",
"CovidTextClassificationModelDebugging" = "responsibleaidashboard-covid-event-multilabel-text-classification-model-debugging.py"
}

Просмотреть файл

@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export const CovidTextClassificationModelDebugging = {
causalAnalysisData: {
hasCausalAnalysisComponent: false
},
checkDupCohort: false,
cohortDefaultName: "All data",
dataBalanceData: {
aggregateBalanceMeasuresComputed: false,
distributionBalanceMeasuresComputed: false,
featureBalanceMeasuresComputed: false
},
errorAnalysisData: {
hasErrorAnalysisComponent: true
},
featureImportanceData: {
hasFeatureImportanceComponent: false
},
featureNames: ["text"],
isTextMultiLabel: true,
modelOverviewData: {
featureCohortView: {
firstFeatureToSelect: "positive_words",
multiFeatureCohorts: 3,
secondFeatureToSelect: "negative_words",
singleFeatureCohorts: 3
},
hasModelOverviewComponent: true,
initialCohorts: [
{
metrics: {
exactMatchRatio: "0.958",
hammingScore: "0.333"
},
name: "All data",
sampleSize: "3"
}
],
newCohort: {
metrics: {
exactMatchRatio: "1",
hammingScore: "0.375"
},
name: "CohortCreateE2E-multilabel-text",
sampleSize: "2"
}
}
};

Просмотреть файл

@ -19,7 +19,7 @@ export const FridgeMultilabelModelDebugging = {
hasFeatureImportanceComponent: false
},
featureNames: ["image"],
isMultiLabel: true,
isImageMultiLabel: true,
modelOverviewData: {
hasModelOverviewComponent: true,
initialCohorts: [

Просмотреть файл

@ -7,6 +7,7 @@ import { IModelAssessmentData } from "../IModelAssessmentData";
import { BlbooksgenreTextClassificationModelDebugging } from "./BlbooksgenreTextClassificationModelDebugging";
import { CensusClassificationModelDebugging } from "./CensusClassificationModelDebugging";
import { CovidTextClassificationModelDebugging } from "./CovidTextClassificationModelDebugging";
import { DBPediaTextClassificationModelDebugging } from "./DBPediaTextClassificationModelDebugging";
import { DiabetesDecisionMaking } from "./DiabetesDecisionMaking";
import { DiabetesRegressionModelDebugging } from "./DiabetesRegressionModelDebugging";
@ -24,6 +25,7 @@ export const regExForNumbersWithBrackets = /^\((\d+)\)$/; // Ex: (60)
const modelAssessmentDatasets: { [name: string]: IModelAssessmentData } = {
BlbooksgenreTextClassificationModelDebugging,
CensusClassificationModelDebugging,
CovidTextClassificationModelDebugging,
DBPediaTextClassificationModelDebugging,
DiabetesDecisionMaking,
DiabetesRegressionModelDebugging,

Просмотреть файл

@ -33,11 +33,14 @@ export function describeModelOverview(
describe(testName, () => {
const isVision =
datasetShape.isObjectDetection ||
datasetShape.isMultiLabel ||
datasetShape.isImageMultiLabel ||
datasetShape.isImageClassification
? true
: false;
const isText = datasetShape.isTextClassification ? true : false;
const isText =
datasetShape.isTextClassification || datasetShape.isTextMultiLabel
? true
: false;
const isTabular = !isVision && !isText;
if (isNotebookTest) {
before(() => {

Просмотреть файл

@ -59,7 +59,7 @@ export function ensureAllModelOverviewDatasetCohortsViewBasicElementsArePresent(
"falseNegativeRate",
"selectionRate"
);
} else if (datasetShape.isMultiLabel) {
} else if (datasetShape.isTextMultiLabel || datasetShape.isImageMultiLabel) {
metricsOrder.push("exactMatchRatio", "hammingScore");
} else if (datasetShape.isObjectDetection) {
metricsOrder.push(

Просмотреть файл

@ -328,7 +328,7 @@ def test_responsibleaidashboard_dbpedia_text_classification_model_debugging():
@pytest.mark.text_notebooks
def test_responsibleaidashboard_covid19_event_text_model_debugging():
nb_path = TEXT
nb_name = ("responsibleaidashboard-covid19-event-multilabel-" +
nb_name = ("responsibleaidashboard-covid-event-multilabel-" +
"text-classification-model-debugging")
test_values = {}

Просмотреть файл

@ -29,10 +29,10 @@ const visionFileNames = [
];
const textFileNames = [
"responsibleaidashboard-DBPedia-text-classification-model-debugging",
"responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging"
"responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging",
"responsibleaidashboard-covid-event-multilabel-text-classification-model-debugging"
];
const ignoredFiles = [
"responsibleaidashboard-covid19-event-multilabel-text-classification-model-debugging",
"responsibleaidashboard-question-answering-model-debugging"
];
const fileNames = tabularFileNames