Skip to content

Commit

Permalink
[ML] Changes inference config help text and link (#122537)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
szabosteve and kibanamachine authored Jan 12, 2022
1 parent 776e9b3 commit 4193c26
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,29 @@ import { FieldsConfig, to, from, EDITOR_PX_HEIGHT } from './shared';
const { emptyField, isJsonField } = fieldValidators;

const INFERENCE_CONFIG_DOCS = {
regression: {
documentation: {
linkLabel: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.regressionLinkLabel',
{ defaultMessage: 'regression' }
),
},
classification: {
linkLabel: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.classificationLinkLabel',
{ defaultMessage: 'classification' }
'xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.documentationLinkLabel',
{ defaultMessage: 'documentation' }
),
},
};

const getInferenceConfigHelpText = (
regressionDocsLink: string,
classificationDocsLink: string
): React.ReactNode => {
function getInferenceConfigHelpText(documentationDocsLink: string): React.ReactNode {
return (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigurationHelpText"
defaultMessage="Contains the inference type and its options. There are two types: {regression} and {classification}."
defaultMessage="Contains the inference type and its options. Refer to the {documentation} for the available configuration options."
values={{
regression: (
<EuiLink external target="_blank" href={regressionDocsLink}>
{INFERENCE_CONFIG_DOCS.regression.linkLabel}
</EuiLink>
),
classification: (
<EuiLink external target="_blank" href={classificationDocsLink}>
{INFERENCE_CONFIG_DOCS.classification.linkLabel}
documentation: (
<EuiLink external target="_blank" href={documentationDocsLink}>
{INFERENCE_CONFIG_DOCS.documentation.linkLabel}
</EuiLink>
),
}}
/>
);
};
}

const fieldsConfig: FieldsConfig = {
/* Required fields config */
Expand Down Expand Up @@ -151,8 +137,7 @@ const fieldsConfig: FieldsConfig = {

export const Inference: FunctionComponent = () => {
const { services } = useKibana();
const regressionDocsLink = services.documentation.getRegressionUrl();
const classificationDocsLink = services.documentation.getClassificationUrl();
const documentationDocsLink = services.documentation.getDocumentationUrl();
return (
<>
<UseField config={fieldsConfig.model_id} component={Field} path="fields.model_id" />
Expand Down Expand Up @@ -182,7 +167,7 @@ export const Inference: FunctionComponent = () => {
<UseField
config={{
...fieldsConfig.inference_config,
helpText: getInferenceConfigHelpText(regressionDocsLink, classificationDocsLink),
helpText: getInferenceConfigHelpText(documentationDocsLink),
}}
component={XJsonEditor}
componentProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = {
defaultMessage: 'Inference',
}),
typeDescription: i18n.translate('xpack.ingestPipelines.processors.description.inference', {
defaultMessage:
'Uses a pre-trained data frame analytics model to infer against incoming data.',
defaultMessage: 'Uses a trained model to infer against incoming data.',
}),
getDefaultDescription: ({
model_id: modelId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class DocumentationService {
private dissectKeyModifiersUrl: string = '';
private classificationUrl: string = '';
private regressionUrl: string = '';
private documentationUrl: string = '';

public setup(docLinks: DocLinksStart): void {
const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL, links } = docLinks;
Expand All @@ -35,6 +36,7 @@ export class DocumentationService {
this.dissectKeyModifiersUrl = links.ingest.dissectKeyModifiers;
this.classificationUrl = links.ingest.inferenceClassification;
this.regressionUrl = links.ingest.inferenceRegression;
this.documentationUrl = links.ingest.inference;
}

public getEsDocsBasePath() {
Expand Down Expand Up @@ -80,6 +82,10 @@ export class DocumentationService {
public getRegressionUrl() {
return this.regressionUrl;
}

public getDocumentationUrl() {
return this.documentationUrl;
}
}

export const documentationService = new DocumentationService();
29 changes: 13 additions & 16 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -4178,6 +4178,19 @@
"visTypePie.editors.pie.showTopLevelOnlyLabel": "トップレベルのみ表示",
"visTypePie.editors.pie.showValuesLabel": "値を表示",
"visTypePie.editors.pie.valueFormatsLabel": "値",
"visTypePie.labelPositions.insideOrOutsideText": "内部または外部",
"visTypePie.labelPositions.insideText": "内部",
"visTypePie.legendPositions.bottomText": "一番下",
"visTypePie.legendPositions.leftText": "左",
"visTypePie.legendPositions.rightText": "右",
"visTypePie.legendPositions.topText": "トップ",
"visTypePie.pie.metricTitle": "スライスサイズ",
"visTypePie.pie.pieDescription": "全体に対する比率でデータを比較します。",
"visTypePie.pie.pieTitle": "円",
"visTypePie.pie.segmentTitle": "スライスの分割",
"visTypePie.pie.splitTitle": "チャートを分割",
"visTypePie.valuesFormats.percent": "割合を表示",
"visTypePie.valuesFormats.value": "値を表示",
"expressionPie.pieVis.function.dimension.buckets": "スライス",
"expressionPie.pieVis.function.args.addLegendHelpText": "グラフ凡例を表示",
"expressionPie.pieVis.function.args.addTooltipHelpText": "スライスにカーソルを置いたときにツールチップを表示",
Expand Down Expand Up @@ -4205,24 +4218,11 @@
"expressionPie.pieLabels.function.args.values.help": "スライス内の値を定義します",
"expressionPie.pieLabels.function.args.valuesFormat.help": "値の形式を定義します",
"expressionPie.pieVis.function.help": "パイビジュアライゼーション",
"visTypePie.labelPositions.insideOrOutsideText": "内部または外部",
"visTypePie.labelPositions.insideText": "内部",
"expressionPie.legend.filterForValueButtonAriaLabel": "値でフィルター",
"expressionPie.legend.filterOptionsLegend": "{legendDataLabel}、フィルターオプション",
"expressionPie.legend.filterOutValueButtonAriaLabel": "値を除外",
"visTypePie.legendPositions.bottomText": "一番下",
"visTypePie.legendPositions.leftText": "左",
"visTypePie.legendPositions.rightText": "右",
"visTypePie.legendPositions.topText": "トップ",
"expressionPie.negativeValuesFound": "円/ドーナツグラフは負の値では表示できません。",
"expressionPie.noResultsFoundTitle": "結果が見つかりませんでした",
"visTypePie.pie.metricTitle": "スライスサイズ",
"visTypePie.pie.pieDescription": "全体に対する比率でデータを比較します。",
"visTypePie.pie.pieTitle": "円",
"visTypePie.pie.segmentTitle": "スライスの分割",
"visTypePie.pie.splitTitle": "チャートを分割",
"visTypePie.valuesFormats.percent": "割合を表示",
"visTypePie.valuesFormats.value": "値を表示",
"visTypeTable.defaultAriaLabel": "データ表ビジュアライゼーション",
"visTypeTable.function.adimension.buckets": "バケット",
"visTypeTable.function.args.bucketsHelpText": "バケットディメンション構成",
Expand Down Expand Up @@ -13554,10 +13554,7 @@
"xpack.ingestPipelines.pipelineEditor.inferenceForm.fieldMapHelpText": "ドキュメントフィールド名をモデルの既知のフィールド名にマッピングします。モデルのどのマッピングよりも優先されます。",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.fieldMapInvalidJSONError": "無効なJSON",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.fieldMapLabel": "フィールドマップ(任意)",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.classificationLinkLabel": "分類",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.regressionLinkLabel": "回帰",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigLabel": "推論構成(任意)",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigurationHelpText": "推論タイプとオプションが含まれます。{regression}と{classification}の2種類あります。",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.modelIDFieldHelpText": "推論するモデルのID。",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.modelIDFieldLabel": "モデルID",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.patternRequiredError": "モデルID値は必須です。",
Expand Down
29 changes: 13 additions & 16 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4210,6 +4210,19 @@
"visTypePie.editors.pie.showTopLevelOnlyLabel": "仅显示顶级",
"visTypePie.editors.pie.showValuesLabel": "显示值",
"visTypePie.editors.pie.valueFormatsLabel": "值",
"visTypePie.labelPositions.insideOrOutsideText": "内部或外部",
"visTypePie.labelPositions.insideText": "内部",
"visTypePie.legendPositions.bottomText": "底部",
"visTypePie.legendPositions.leftText": "左",
"visTypePie.legendPositions.rightText": "右",
"visTypePie.legendPositions.topText": "顶部",
"visTypePie.pie.metricTitle": "切片大小",
"visTypePie.pie.pieDescription": "以整体的比例比较数据。",
"visTypePie.pie.pieTitle": "饼图",
"visTypePie.pie.segmentTitle": "拆分切片",
"visTypePie.pie.splitTitle": "拆分图表",
"visTypePie.valuesFormats.percent": "显示百分比",
"visTypePie.valuesFormats.value": "显示值",
"expressionPie.pieVis.function.dimension.buckets": "切片",
"expressionPie.pieVis.function.args.addLegendHelpText": "显示图表图例",
"expressionPie.pieVis.function.args.addTooltipHelpText": "在切片上悬浮时显示工具提示",
Expand Down Expand Up @@ -4237,24 +4250,11 @@
"expressionPie.pieLabels.function.args.values.help": "定义切片内的值",
"expressionPie.pieLabels.function.args.valuesFormat.help": "定义值的格式",
"expressionPie.pieVis.function.help": "饼图可视化",
"visTypePie.labelPositions.insideOrOutsideText": "内部或外部",
"visTypePie.labelPositions.insideText": "内部",
"expressionPie.legend.filterForValueButtonAriaLabel": "筛留值",
"expressionPie.legend.filterOptionsLegend": "{legendDataLabel}, 筛选选项",
"expressionPie.legend.filterOutValueButtonAriaLabel": "筛除值",
"visTypePie.legendPositions.bottomText": "底部",
"visTypePie.legendPositions.leftText": "左",
"visTypePie.legendPositions.rightText": "右",
"visTypePie.legendPositions.topText": "顶部",
"expressionPie.negativeValuesFound": "饼图/圆环图无法使用负值进行呈现。",
"expressionPie.noResultsFoundTitle": "找不到结果",
"visTypePie.pie.metricTitle": "切片大小",
"visTypePie.pie.pieDescription": "以整体的比例比较数据。",
"visTypePie.pie.pieTitle": "饼图",
"visTypePie.pie.segmentTitle": "拆分切片",
"visTypePie.pie.splitTitle": "拆分图表",
"visTypePie.valuesFormats.percent": "显示百分比",
"visTypePie.valuesFormats.value": "显示值",
"visTypeTable.defaultAriaLabel": "数据表可视化",
"visTypeTable.function.adimension.buckets": "存储桶",
"visTypeTable.function.args.bucketsHelpText": "存储桶维度配置",
Expand Down Expand Up @@ -13734,10 +13734,7 @@
"xpack.ingestPipelines.pipelineEditor.inferenceForm.fieldMapHelpText": "将文档字段名称映射到模型的已知字段名称。优先于模型中的任何映射。",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.fieldMapInvalidJSONError": "JSON 无效",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.fieldMapLabel": "字段映射(可选)",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.classificationLinkLabel": "分类",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.regressionLinkLabel": "回归",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigLabel": "推理配置(可选)",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigurationHelpText": "包含推理类型及其选项。有两种类型:{regression} 和 {classification}。",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.modelIDFieldHelpText": "推理所根据的模型的 ID。",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.modelIDFieldLabel": "模型 ID",
"xpack.ingestPipelines.pipelineEditor.inferenceForm.patternRequiredError": "需要模型 ID 值。",
Expand Down

0 comments on commit 4193c26

Please sign in to comment.