-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Feature Request] Use ml_inference request processor output in normalization-processor #16775
Comments
I think we can address this with the Essentially, I think we would need the following changes:
I think OpenSearch core is providing the required building block (the @martin-gaievski, @mingshl, @owaiskazi19 -- what do y'all think? |
I think this approach is generic enough, there isn't much of coupling between two processors. I do have one concern regarding instantiation of the normalization processor. New processor instance is created by the Processor.Factory, validation of initial parameters like weights is responsibility of this factory. It does not have access to PipelineProcessingContext, from what I've seen only processor has such access. This means we need to make the validation logic more complex and take into account all possible cases, e.g. search pipeline can be created by a separate call or it's part of the search request. |
Good to see this feature ask. Although, this is a very specific case, applicable only for reading the output of the ml-inference processor and passing it as input to the normalization processor. As part of the enhancements planned for Search Pipelines, we have been discussing a generic solution for passing the output of one processor as input to another processor. The PipelineProcessingContext in the core is definitely a good place to act as a mediator between the processors. However, we will need to incorporate the output of one processor and convert it into a readable format that is compatible with the input requirements of the next processor. |
Is your feature request related to a problem? Please describe
I'm currently facing the challenge to use the output of an
ml_inference
request processor in anormalization-processor
as part of a hybrid search scenario.In this particular case the output of the
ml_inference
request processor are two floats. What currently is supported is using the output in aquery_template
. For example, using the floats as field values is possible.Example pipeline definition:
Using the model output in a hybrid search scenario and the floats as part of the
normalization-processor
does not work however. The query does return results butnormalization
is not applied.Describe the solution you'd like
Ideally, I'd like to use the output of an
ml_inference
request processor anywhere in the query including search pipeline processors.Related component
Search
Describe alternatives you've considered
No response
Additional context
This is potentially related to opensearch-project/ml-commons#2841
Some testing done as part of asking this question on the #ml OpenSearch Slack channel: https://opensearch.slack.com/archives/C05BGJ1N264/p1732270893567709
Github branch with a notebook based example: https://github.com/o19s/opensearch-hybrid-search-optimization/blob/ml-inference-in-os/notebooks/ML%20Inference%20in%20OS.ipynb
The text was updated successfully, but these errors were encountered: