Skip to content

[ML] Adds trained model testing for additional pytorch models#129209

Merged
jgowdyelastic merged 33 commits intoelastic:mainfrom
jgowdyelastic:fixing-text-classification-model-testing
Apr 29, 2022
Merged

[ML] Adds trained model testing for additional pytorch models#129209
jgowdyelastic merged 33 commits intoelastic:mainfrom
jgowdyelastic:fixing-text-classification-model-testing

Conversation

@jgowdyelastic
Copy link
Copy Markdown
Member

@jgowdyelastic jgowdyelastic commented Apr 1, 2022

Adds trained model testing UI for remaining pytorch models.: fill_mask, text_classification, text_embedding and zero_shot_classification

Follows on from #128359

Also refactors the code to make the components more reusable.

Fill mask

image

Text classification

image

Text embedding

image

Zero shot classification

image

@jgowdyelastic jgowdyelastic changed the title [ML] Fixing text classification testing in the UI [ML] Fixing text classification model testing in the UI Apr 1, 2022
@jgowdyelastic
Copy link
Copy Markdown
Member Author

@elasticmachine merge upstream

@jgowdyelastic
Copy link
Copy Markdown
Member Author

@elasticmachine merge upstream

@jgowdyelastic
Copy link
Copy Markdown
Member Author

@elasticmachine merge upstream

@jgowdyelastic jgowdyelastic changed the title [ML] Fixing text classification model testing in the UI [ML] Additional testing of trained model in UI Apr 27, 2022
@jgowdyelastic jgowdyelastic marked this pull request as ready for review April 27, 2022 13:31
@jgowdyelastic jgowdyelastic requested a review from a team as a code owner April 27, 2022 13:31
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

import React, { FC } from 'react';
import { Observable } from 'rxjs';
import useObservable from 'react-use/lib/useObservable';
import { MLJobEditor } from '../../../../jobs/jobs_list/components/ml_job_editor';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this wrapper around the Ace editor is now used in places other than for jobs, would be good to rename it in a follow-up.


const LangIdentOutput: FC<{ inferrer: LangIdentInference }> = ({ inferrer }) => {
const result = useObservable(inferrer.inferenceResult$);
if (!result) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this and the condition on line 28 be in the same block as they both return null?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a small comment but code LGTM ⚡

@peteharverson
Copy link
Copy Markdown
Contributor

Not related to the changes here, but would be good to sort the options in the Type dropdown alphabetically.

image

<LangIdentOutput inferrer={inferrer} />
);

const LangIdentOutput: FC<{ inferrer: LangIdentInference }> = ({ inferrer }) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the lang_ident testing, the output tab never renders for me (even with very short input strings). The results are shown in the raw output tab, but nothing in the other tab.

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6026a96

protected abstract getInputComponent(): JSX.Element;
protected abstract getOutputComponent(): JSX.Element;

protected abstract infer(): Promise<TInferResponse>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably one for a follow-up, but shouldn't the Test model action be disabled if the model isn't started?

image

will give an error Trained model [bert-base-uncased] is not deployed when trying to use Test on a stopped model.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 4b033e3

Copy link
Copy Markdown
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes LGTM

@jgowdyelastic jgowdyelastic enabled auto-merge (squash) April 29, 2022 11:15
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 1568 1581 +13

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 3.3MB 3.3MB +8.8KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jgowdyelastic

@jgowdyelastic jgowdyelastic merged commit c539923 into elastic:main Apr 29, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Apr 29, 2022
kertal pushed a commit to kertal/kibana that referenced this pull request May 24, 2022
* [ML] Fixing text classification testing in the UI

* disabling unsupported models

* code clean up

* small refactor

* adding zero shot classification

* translation id

* adding text embedding

* adding fill_mask

* translation id

* code clean up

* adding observable for inference

* refactoring for observables

* removing comment

* refactor

* removing num_top_classes override

* adding optional num_top_classes

* translations

* removing any

* updating error type

* removing any type

* correcting type

* combining checks

* fixing lang ident

* added start check

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@lcawl lcawl changed the title [ML] Additional testing of trained model in UI [ML] Adds trained model testing for additional pytorch models Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:3rd Party Models ML 3rd party models :ml release_note:feature Makes this part of the condensed release notes v8.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants