[ML] Adds Explain Functionality to LTR Rescoring
Adds explain functionality to LTR rescoring.
The explanations will be output (using the explain=true flag in the query) and will be per result hit describing the query and the features used in the rescoring as well as the weights that contributed to the rescoring:
"_explanation": {
"value": 20,
"description": "rescored using LTR model ltr-model",
"details": [
{
"value": 1,
"description": "first pass query score",
"details": [
{
"value": 1,
"description": "*:*",
"details": []
}
]
},
{
"value": 0,
"description": "extracted features",
"details": [
{
"value": 1,
"description": "feature value for [type_tv]",
"details": []
},
{
"value": 300,
"description": "feature value for [cost]",
"details": []
},
{
"value": 2,
"description": "feature value for [two]",
"details": []
}
]
}
]
}
Also - I'm trying to add the team labels, but keep getting:
elasticsearchmachine removed Team:ML Team:Search Relevance labels now
Pinging @elastic/es-search-relevance (Team:Search Relevance)
The label is added automatically based on the are of your PR. I added :Search Relevance/Ranking as area and elasticmachine added the right team automatically.
I will review your PR tomorrow
I will merge the PR since @markjhoy is out for the next few days.
Great work!!!