readme
Browse files
README.md
CHANGED
|
@@ -1,50 +1,56 @@
|
|
| 1 |
---
|
| 2 |
title: mrr
|
| 3 |
-
datasets:
|
| 4 |
-
-
|
| 5 |
tags:
|
| 6 |
- evaluate
|
| 7 |
- metric
|
| 8 |
-
description: "
|
|
|
|
| 9 |
sdk: gradio
|
| 10 |
sdk_version: 3.19.1
|
| 11 |
app_file: app.py
|
| 12 |
pinned: false
|
| 13 |
---
|
| 14 |
|
| 15 |
-
# Metric Card for
|
| 16 |
-
|
| 17 |
-
***Module Card Instructions:*** *Fill out the following subsections. Feel free to take a look at existing metric cards if you'd like examples.*
|
| 18 |
|
| 19 |
## Metric Description
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
## How to Use
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
### Inputs
|
| 28 |
-
|
| 29 |
-
- **
|
|
|
|
| 30 |
|
| 31 |
### Output Values
|
|
|
|
| 32 |
|
| 33 |
-
*Explain what this metric outputs and provide an example of what the metric output looks like. Modules should return a dictionary with one or multiple key-value pairs, e.g. {"bleu" : 6.02}*
|
| 34 |
-
|
| 35 |
-
*State the range of possible values that the metric's output can take, as well as what in that range is considered good. For example: "This metric can take on any value between 0 and 100, inclusive. Higher scores are better."*
|
| 36 |
-
|
| 37 |
-
#### Values from Popular Papers
|
| 38 |
-
*Give examples, preferrably with links to leaderboards or publications, to papers that have reported this metric, along with the values they have reported.*
|
| 39 |
-
|
| 40 |
-
### Examples
|
| 41 |
-
*Give code examples of the metric being used. Try to include examples that clear up any potential ambiguity left from the metric description above. If possible, provide a range of examples that show both typical and atypical results, as well as examples where a variety of input parameters are passed.*
|
| 42 |
|
| 43 |
## Limitations and Bias
|
| 44 |
*Note any known limitations or biases that the metric has, with links and references if possible.*
|
| 45 |
|
| 46 |
## Citation
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: mrr
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- evaluate
|
| 5 |
- metric
|
| 6 |
+
description: "This is the mean reciprocal rank (mrr) metric for retrieval systems.
|
| 7 |
+
It is the average of the precision scores computer after each relevant document is got. You can refer to [here](https://amenra.github.io/ranx/metrics/#mean-average-precision)"
|
| 8 |
sdk: gradio
|
| 9 |
sdk_version: 3.19.1
|
| 10 |
app_file: app.py
|
| 11 |
pinned: false
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Metric Card for map
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## Metric Description
|
| 17 |
+
This is the mean average precision (map) metric for retrieval systems.
|
| 18 |
+
It is the average of the precision scores computer after each relevant document is got. You can refer to [here](https://amenra.github.io/ranx/metrics/#mean-average-precision)
|
| 19 |
|
| 20 |
## How to Use
|
| 21 |
+
```python
|
| 22 |
+
>>> my_new_module = evaluate.load("mrr")
|
| 23 |
+
>>> references= [json.dumps({"q_1":{"d_1":1, "d_2":2} }),
|
| 24 |
+
json.dumps({"q_2":{"d_2":1, "d_3":2, "d_5":3}})]
|
| 25 |
+
>>> predictions = [json.dumps({"q_1": { "d_1": 0.8, "d_2": 0.9}}),
|
| 26 |
+
json.dumps({"q_2": {"d_2": 0.9, "d_1": 0.8, "d_5": 0.7, "d_3": 0.3}})]
|
| 27 |
+
>>> results = my_new_module.compute(references=references, predictions=predictions)
|
| 28 |
+
>>> print(results)
|
| 29 |
+
{'mrr': 1.0}
|
| 30 |
+
```
|
| 31 |
### Inputs
|
| 32 |
+
- **predictions:** a list of dictionaries where each dictionary consists of document relevancy scores produced by the model for a given query. One dictionary per query. The dictionaries should be converted to string.
|
| 33 |
+
- **references:** a lift of list of dictionaries where each dictionary consists of the relevant order for the documents for a given query in a sorted relevancy order. The dictionaries should be converted to string.
|
| 34 |
+
- **k:** an optional paramater whose default is None to calculate mrr@k
|
| 35 |
|
| 36 |
### Output Values
|
| 37 |
+
- **mrr (`float`):** mean reciprocal rank. Minimum possible value is 0. Maximum possible value is 1.0
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
## Limitations and Bias
|
| 41 |
*Note any known limitations or biases that the metric has, with links and references if possible.*
|
| 42 |
|
| 43 |
## Citation
|
| 44 |
+
```bibtex
|
| 45 |
+
@inproceedings{ranx,
|
| 46 |
+
author = {Elias Bassani},
|
| 47 |
+
title = {ranx: {A} Blazing-Fast Python Library for Ranking Evaluation and Comparison},
|
| 48 |
+
booktitle = {{ECIR} {(2)}},
|
| 49 |
+
series = {Lecture Notes in Computer Science},
|
| 50 |
+
volume = {13186},
|
| 51 |
+
pages = {259--264},
|
| 52 |
+
publisher = {Springer},
|
| 53 |
+
year = {2022},
|
| 54 |
+
doi = {10.1007/978-3-030-99739-7\_30}
|
| 55 |
+
}
|
| 56 |
+
```
|