Update README.md
Browse files
README.md
CHANGED
|
@@ -29,3 +29,28 @@ configs:
|
|
| 29 |
- split: test
|
| 30 |
path: data/test-*
|
| 31 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
- split: test
|
| 30 |
path: data/test-*
|
| 31 |
---
|
| 32 |
+
Employing the COIR evaluation framework's dataset version, utilize the code below for assessment:
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
import coir
|
| 36 |
+
from coir.data_loader import get_tasks
|
| 37 |
+
from coir.evaluation import COIR
|
| 38 |
+
from coir.models import YourCustomDEModel
|
| 39 |
+
|
| 40 |
+
model_name = "intfloat/e5-base-v2"
|
| 41 |
+
|
| 42 |
+
# Load the model
|
| 43 |
+
model = YourCustomDEModel(model_name=model_name)
|
| 44 |
+
|
| 45 |
+
# Get tasks
|
| 46 |
+
#all task ["codetrans-dl","stackoverflow-qa","apps","codefeedback-mt","codefeedback-st","codetrans-contest","synthetic-
|
| 47 |
+
# text2sql","cosqa","codesearchnet","codesearchnet-ccr"]
|
| 48 |
+
tasks = get_tasks(tasks=["codetrans-contest"])
|
| 49 |
+
|
| 50 |
+
# Initialize evaluation
|
| 51 |
+
evaluation = COIR(tasks=tasks,batch_size=128)
|
| 52 |
+
|
| 53 |
+
# Run evaluation
|
| 54 |
+
results = evaluation.run(model, output_folder=f"results/{model_name}")
|
| 55 |
+
print(results)
|
| 56 |
+
```
|