elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

[ML] Adds Explain Functionality to LTR Rescoring

Open markjhoy opened this issue 1 year ago • 4 comments

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": []
                                }
                            ]
                        }
                    ]
                }

markjhoy avatar Aug 23 '24 15:08 markjhoy

Also - I'm trying to add the team labels, but keep getting: elasticsearchmachine removed Team:ML Team:Search Relevance labels now

markjhoy avatar Aug 26 '24 14:08 markjhoy

Pinging @elastic/es-search-relevance (Team:Search Relevance)

elasticsearchmachine avatar Aug 27 '24 15:08 elasticsearchmachine

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.

afoucret avatar Aug 27 '24 15:08 afoucret

I will review your PR tomorrow

afoucret avatar Aug 27 '24 15:08 afoucret

I will merge the PR since @markjhoy is out for the next few days.

Great work!!!

afoucret avatar Aug 29 '24 13:08 afoucret