ml-commons
ml-commons copied to clipboard
[FEATURE] Support local cross-encoder model
Is your feature request related to a problem? We're trying to put a bunch of local model types in ml-commons (#1164). One such type is a cross-encoder. This will allow us to support reranking in the neural-search plugin, which a lot of people have asked for.
What solution would you like? Will be able to upload a custom cross-encoder model, deploy it, and use it with the upcoming neural search reranking processor.
What alternatives have you considered? External hosting: Still would have to deal with the inputs and outputs, and then we also get the pleasure of figuring out some solution for externally hosting cross-encoders.
LTR: That can do reranking, but not cross-encoder reranking, so this isn't where that thought belongs.
Do you have any additional context? Add any other context or screenshots about the feature request here.
Gonna implement this as a new ml-algorithm / function name: TEXT_SIMILARITY. Cross-encoders are one technique to do this, but not the only one. Essentially it's just defined as (text1, text2) -> similarity_socre
(As opposed to embedding models which are (text) -> vector, and then similarity is an inner product of two vectors)
A bunch of requests have come in for remote reranking models too, so I'll make sure that connectors can deal with TextSimilarityDatasets appropriately as well
Make sure local model and remote model can be switched smoothly .
Make sure local model and remote model can be switched smoothly .
This is done in this PR https://github.com/opensearch-project/ml-commons/pull/1954
Make sure local model and remote model can be switched smoothly .
@HenryL27 will check remote model and then we can close this issue.