-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[ML][Inference] adds new default_field_map field to trained models #53294
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.function.Function; | ||
import java.util.function.Predicate; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
@@ -52,7 +53,11 @@ public static TrainedModelConfig createTestTrainedModelConfig() { | |
randomBoolean() ? null : TrainedModelInputTests.createRandomInput(), | ||
randomBoolean() ? null : randomNonNegativeLong(), | ||
randomBoolean() ? null : randomNonNegativeLong(), | ||
randomBoolean() ? null : randomFrom("platinum", "basic")); | ||
randomBoolean() ? null : randomFrom("platinum", "basic"), | ||
randomBoolean() ? null : | ||
Stream.generate(() -> randomAlphaOfLength(10)) | ||
.limit(randomIntBetween(1, 10)) | ||
.collect(Collectors.toMap(Function.identity(), (k) -> randomAlphaOfLength(10)))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 neat I never thought of building a random map this way |
||
} | ||
|
||
@Override | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1506,6 +1506,13 @@ The estimated number of operations to use the trained model. | |
`license_level`::: | ||
(string) | ||
The license level of the trained model. | ||
|
||
`default_field_mappings` ::: | ||
(object) | ||
A string to string mapping that contains the default field mappings to use | ||
when inferring against the model. Any field mapping described in the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a line here about multi fields which is the primary reason for this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For sure! |
||
inference configuration takes precedence. | ||
|
||
end::trained-model-configs[] | ||
|
||
tag::training-percent[] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer not to write empty collections.