CoIR-team / coir

A Comprehensive Benchmark for Code Information Retrieval.
https://archersama.github.io/coir/
Apache License 2.0
63 stars 11 forks source link

关于复现你们的模型的问题 #6

Closed huguangcheng closed 2 months ago

huguangcheng commented 2 months ago

你好,请问如何复现你们论文中的实验,如下图所示: image

archersama commented 2 months ago

只需要follow我们的usage即可,另外,我们新更新了一版数据,所以论文中的图表结果有些问题,请参照leaderboard上的结果

import coir
from coir.data_loader import get_tasks
from coir.evaluation import COIR
from coir.models import YourCustomDEModel

model_name = "intfloat/e5-base-v2"

# Load the model
model = YourCustomDEModel(model_name=model_name)

# Get tasks
#all task ["codetrans-dl","stackoverflow-qa","apps","codefeedback-mt","codefeedback-st","codetrans-contest","synthetic-
# text2sql","cosqa","codesearchnet","codesearchnet-ccr"]
tasks = get_tasks(tasks=["codetrans-dl"])

# Initialize evaluation
evaluation = COIR(tasks=tasks,batch_size=128)

# Run evaluation
results = evaluation.run(model, output_folder=f"results/{model_name}")
print(results)
huguangcheng commented 2 months ago

好的