Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NLP] Support the different mask tokens used by NLP models for Fill Mask #97453

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

maxhniebergall
Copy link
Member

@maxhniebergall maxhniebergall commented Jul 7, 2023

This change adds a mask_token field to the GET _ml/trained_models API, as an enhancement to support kibana#159577.

The mask_token field reveals the particular mask token for needed each model deployed. Below is an example inference_config component of the API response, with the new mask_token field within fill_mask.

      "inference_config": {
        "fill_mask": {
          "vocabulary": {
            "index": ".ml-inference-native-000001"
          },
          "tokenization": {
            "roberta": {
              "do_lower_case": false,
              "with_special_tokens": true,
              "max_sequence_length": 512,
              "truncate": "first",
              "span": -1,
              "add_prefix_space": false
            }
          },
          "num_top_classes": 5,
          "mask_token": "<mask>"
        }
      },

@maxhniebergall maxhniebergall marked this pull request as draft July 7, 2023 13:59
@davidkyle davidkyle added the :ml Machine learning label Jul 7, 2023
@maxhniebergall maxhniebergall self-assigned this Jul 7, 2023
@maxhniebergall maxhniebergall marked this pull request as ready for review July 7, 2023 20:25
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Jul 7, 2023
@maxhniebergall maxhniebergall changed the title draft of fill mask changes, currently blocked by YAML tests error [NLP] Support the different mask tokens used by NLP models for Fill Mask Jul 7, 2023
@elasticsearchmachine
Copy link
Collaborator

Hi @maxhniebergall, I've created a changelog YAML for you.

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

This largely looks good now.

One more thing that needs changing is the current reference docs. We need a new entry for mask_token immediately before this line:

@elasticsearchmachine
Copy link
Collaborator

Hi @maxhniebergall, I've updated the changelog YAML for you.

@maxhniebergall
Copy link
Member Author

@elasticsearchmachine run elasticsearch-ci/rest-compatibility

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@maxhniebergall maxhniebergall merged commit 3a41138 into main Jul 11, 2023
1 check passed
@maxhniebergall maxhniebergall deleted the 987-add-mask-token-support branch July 11, 2023 18:42
maxhniebergall added a commit to elastic/elasticsearch-specification that referenced this pull request Jul 12, 2023
…ask (#2178)

Adds the specification for the new mask token field added in elastic/elasticsearch#97453, which enables users and Kibana to see the mask token for a particular model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :ml Machine learning Team:ML Meta label for the ML team v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants