From 974a7c367976ef6f1a3d6f800876120f0e904a1c Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 18 May 2022 18:02:59 -0700 Subject: [PATCH 1/4] [ML] Add placeholder text for testing NER models --- .../test_models/models/ner/ner_inference.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts index 13f07d8c88770b..84d2f0615b1c4d 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts @@ -52,7 +52,13 @@ export class NerInference extends InferenceBase { } public getInputComponent(): JSX.Element { - return getGeneralInputComponent(this); + const placeholder = i18n.translate( + 'xpack.ml.trainedModels.testModelsFlyout.ner.inputText', + { + defaultMessage: 'Enter a phrase to test.', + } + ); + return getGeneralInputComponent(this, placeholder); } public getOutputComponent(): JSX.Element { From b0ea9e76d34651b801b904f163e36a95e2ac458d Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 18 May 2022 18:15:57 -0700 Subject: [PATCH 2/4] [ML] Add placeholder text for testing text classification models --- .../test_models/models/ner/ner_inference.ts | 2 +- .../models/text_classification/fill_mask_inference.ts | 4 ++-- .../models/text_classification/lang_ident_inference.ts | 8 +++++++- .../text_classification/text_classification_inference.ts | 8 +++++++- .../models/text_embedding/text_embedding_inference.ts | 8 +++++++- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts index 84d2f0615b1c4d..bb98c2d8e28bfa 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts @@ -55,7 +55,7 @@ export class NerInference extends InferenceBase { const placeholder = i18n.translate( 'xpack.ml.trainedModels.testModelsFlyout.ner.inputText', { - defaultMessage: 'Enter a phrase to test.', + defaultMessage: 'Enter a phrase to test', } ); return getGeneralInputComponent(this, placeholder); diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts index bb4feaffffb388..e26c7a1b326f70 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts @@ -55,9 +55,9 @@ export class FillMaskInference extends InferenceBase public getInputComponent(): JSX.Element { const placeholder = i18n.translate( - 'xpack.ml.trainedModels.testModelsFlyout.langIdent.inputText', + 'xpack.ml.trainedModels.testModelsFlyout.fillMask.inputText', { - defaultMessage: 'Mask token: [MASK]. e.g. Paris is the [MASK] of France.', + defaultMessage: 'Enter a phrase to test. Use [MASK] as a placeholder for the missing words.', } ); diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts index a56d4a3598a66d..8503c965083601 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts @@ -44,7 +44,13 @@ export class LangIdentInference extends InferenceBase } public getInputComponent(): JSX.Element { - return getGeneralInputComponent(this); + const placeholder = i18n.translate( + 'xpack.ml.trainedModels.testModelsFlyout.textEmbedding.inputText', + { + defaultMessage: 'Enter a phrase to test', + } + ); + return getGeneralInputComponent(this, placeholder); } public getOutputComponent(): JSX.Element { From d756ad650a062228dae6630f0c076b8ea0ababb3 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 19 May 2022 01:25:30 +0000 Subject: [PATCH 3/4] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- .../test_models/models/ner/ner_inference.ts | 9 +++------ .../models/text_classification/fill_mask_inference.ts | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts index bb98c2d8e28bfa..0987a43ffb6d31 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts @@ -52,12 +52,9 @@ export class NerInference extends InferenceBase { } public getInputComponent(): JSX.Element { - const placeholder = i18n.translate( - 'xpack.ml.trainedModels.testModelsFlyout.ner.inputText', - { - defaultMessage: 'Enter a phrase to test', - } - ); + const placeholder = i18n.translate('xpack.ml.trainedModels.testModelsFlyout.ner.inputText', { + defaultMessage: 'Enter a phrase to test', + }); return getGeneralInputComponent(this, placeholder); } diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts index e26c7a1b326f70..b9c1c724ca3485 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/fill_mask_inference.ts @@ -57,7 +57,8 @@ export class FillMaskInference extends InferenceBase const placeholder = i18n.translate( 'xpack.ml.trainedModels.testModelsFlyout.fillMask.inputText', { - defaultMessage: 'Enter a phrase to test. Use [MASK] as a placeholder for the missing words.', + defaultMessage: + 'Enter a phrase to test. Use [MASK] as a placeholder for the missing words.', } ); From 285f69208ffb1c8f5bc49acfb891ccc4a2560825 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 19 May 2022 18:26:05 -0700 Subject: [PATCH 4/4] Add missing import statements --- .../models_management/test_models/models/ner/ner_inference.ts | 2 +- .../models/text_classification/lang_ident_inference.ts | 1 + .../models/text_classification/text_classification_inference.ts | 1 + .../models/text_embedding/text_embedding_inference.ts | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts index 0987a43ffb6d31..7d780559fb47dc 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/ner/ner_inference.ts @@ -6,7 +6,7 @@ */ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; - +import { i18n } from '@kbn/i18n'; import { InferenceBase, InferResponse } from '../inference_base'; import { getGeneralInputComponent } from '../text_input'; import { getNerOutputComponent } from './ner_output'; diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts index 8503c965083601..155b696fa7665a 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/lang_ident_inference.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { i18n } from '@kbn/i18n'; import { InferenceBase, InferenceType } from '../inference_base'; import { processResponse } from './common'; import { getGeneralInputComponent } from '../text_input'; diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/text_classification_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/text_classification_inference.ts index e8378536513a8a..bb05d67d300aa3 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/text_classification_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_classification/text_classification_inference.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { i18n } from '@kbn/i18n'; import { InferenceBase } from '../inference_base'; import { processResponse } from './common'; import type { TextClassificationResponse, RawTextClassificationResponse } from './common'; diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_embedding/text_embedding_inference.ts b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_embedding/text_embedding_inference.ts index e82972b16b7870..735c5817bc9a84 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_embedding/text_embedding_inference.ts +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/models/text_embedding/text_embedding_inference.ts @@ -7,6 +7,7 @@ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { i18n } from '@kbn/i18n'; import { InferenceBase, InferResponse } from '../inference_base'; import { getGeneralInputComponent } from '../text_input'; import { getTextEmbeddingOutputComponent } from './text_embedding_output';