Skip to content

Commit

Permalink
[ML] Add placeholder text for testing text classification models
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed May 19, 2022
1 parent 974a7c3 commit b0ea9e7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class NerInference extends InferenceBase<NerResponse> {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export class FillMaskInference extends InferenceBase<TextClassificationResponse>

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.',
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ export class LangIdentInference extends InferenceBase<TextClassificationResponse
}

public getInputComponent(): JSX.Element {
return getGeneralInputComponent(this);
const placeholder = i18n.translate(
'xpack.ml.trainedModels.testModelsFlyout.langIdent.inputText',
{
defaultMessage: 'Enter a phrase to test',
}
);
return getGeneralInputComponent(this, placeholder);
}

public getOutputComponent(): JSX.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export class TextClassificationInference extends InferenceBase<TextClassificatio
}

public getInputComponent(): JSX.Element {
return getGeneralInputComponent(this);
const placeholder = i18n.translate(
'xpack.ml.trainedModels.testModelsFlyout.textClassification.inputText',
{
defaultMessage: 'Enter a phrase to test',
}
);
return getGeneralInputComponent(this, placeholder);
}

public getOutputComponent(): JSX.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ export class TextEmbeddingInference extends InferenceBase<TextEmbeddingResponse>
}

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 {
Expand Down

0 comments on commit b0ea9e7

Please sign in to comment.