Skip to content
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

[8.15] Add recall and NDCG operations in msmarco-v2-vector #710

Open
wants to merge 2 commits into
base: 8.15
Choose a base branch
from

Conversation

gareth-ellis
Copy link
Member

Backport of #610

This change adds an operation called knn-recall that computes the following metrics:
  * Recall
  * NDCG
  * Avg number of nodes visited during search

Given the size of the corpus, the true top N values used for recall operations have been approximated offline for each query as follows:
```
{
    "knn": {
        "field": "emb",
        "query_vector": query['emb'],
        "k": 10000,
        "num_candidates": 10000
    },
    "rescore": {
        "window_size": 10000,
        "query": {
            "query_weight": 0,
                "rescore_query": {
                    "script_score": {
                        "query": {
                            "match_all": {}
                        },
                    "script": {
                        "source": "double value = dotProduct(params.query_vector, 'emb'); return sigmoid(1, Math.E, -value);",
                        "params": {
                            "query_vector": vec
                        }
                    }
                }
            }
        }
    }
}
```
This means that the computed recall is measured against the system's best possible approximate neighbor run rather than the actual top N.

For the relevance metrics, the `qrels.tsv` file contains annotations for all the queries listed in `queries.json`. This file is generated from the original training data available at [ir_datasets/msmarco_passage_v2](https://ir-datasets.com/msmarco-passage-v2.html#msmarco-passage-v2/train).

(cherry picked from commit b6f3535)
@gareth-ellis gareth-ellis requested a review from a team December 6, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants