GithubHelp home page GithubHelp logo

Comments (1)

wangyuxinwhy avatar wangyuxinwhy commented on July 29, 2024 1

排序的指标和检索的指标在我的理解里没有什么不同,因为检索本质就是排序。只是不同的指标,衡量的使用场景不一样。mAP MRR nDCG 在 T2Ranking 数据集上,nDCG 会更好,因为有不同的关联分数。另外,无论是 bier 自己的实现还是 trec_eval 的实现,默认参数都是把大于等于 1 的当作相关,所以 qrels 中 0 分的样本是允许的,或者说是没有任何影响的,会被过滤掉。

至于 mAP@1 和 MRR@1 是不是应该相等?我认为如果是标准实现或者公认的算法上来讲,应该是相同的。 但 trec_eval 的实现上,这两者并不相等,具体原因你看下面的代码就明白了:

import pytrec_eval
import json

qrel = {
    'q1': {
        'd1': 0,
        'd2': 1,
        'd3': 0,
        'd4': 1
    },
}

run = {
    'q1': {
        'd1': 1.0,
        'd2': 3.0,
        'd3': 1.5,
        'd4': 3.0,
    }
}

evaluator = pytrec_eval.RelevanceEvaluator(
    qrel, {'map_cut.1', 'ndcg'}, relevance_level=1)

print(json.dumps(evaluator.evaluate(run), indent=1))

输出:

{
 "q1": {
  "ndcg": 1.0,
  "map_cut_1": 0.5
 }
}

按照标准的实现,map_cut_1 应该是 1 才对,但 trec_val 的实现没有在分母取 k 和 正例的最小值。

综上,MTEB-zh 的实现是符合通用标准或者说共识的,ReRanking 和 Retrieval 的超参数选择和 main score 也是合理的。不知道上面的回答,有没有解决您的疑问?

指标这个东西确实麻烦,需要深入代码和实现才能搞清楚,我当时也是看了好长时间,更别提 trec_val 还是 c++ 写的....

from uniem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.