-
Notifications
You must be signed in to change notification settings - Fork 565
[v2] add similarity_fn in ModelMeta #1759
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
Merged
KennethEnevoldsen
merged 27 commits into
embeddings-benchmark:v2.0.0
from
sam-hey:fix_contriever
Jan 17, 2025
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
d71718b
add dotwrapper
Samoed d50fd88
lint
Samoed 7d1e949
make cleaner
Samoed 9e9a111
add poc similarity_fn in ModelMeta
sam-hey e4a692f
ref: rename EvaluationFunction to ScoringFunction
sam-hey 1865345
make cos_sim default
sam-hey f34f110
Revert "make cleaner"
sam-hey 49a954e
Revert "add dotwrapper"
sam-hey d9ebe97
lint
sam-hey 4c89681
fix: _run_eval no co tracking
sam-hey fae6e31
Merge remote-tracking branch 'mteb/v2.0.0' into fix_contriever
sam-hey 6298d75
fix: bm25s
sam-hey 5a023d6
add enum to models
sam-hey 8ad1e88
add mapping st sim fn name to mteb sim fn name
sam-hey 700ad58
fix model meta use new fn for sim operators
sam-hey 8cffb6a
add max_sim
sam-hey bf0cf07
fix: colbert & rm similarity_fn_name
sam-hey 3391e1e
ci: skip AfriSentiLID for now (#1785)
isaac-chung 7bb43ab
Merge branch 'v2.0.0' into fix_contriever
sam-hey 4fabb09
test: add test for bm25s and ColBERT
sam-hey 1442673
lint
sam-hey bb4beec
feat: add mapping for max_sim from pylate
sam-hey 0f923c1
test: bm25s skip
sam-hey f4779c7
fix: MaxSim as max_sim match pylate & rm Enum in models
sam-hey 89d1ae8
Merge remote-tracking branch 'mteb/v2.0.0' into fix_contriever
sam-hey 07f4d6a
rm enum
sam-hey 6c425f4
update tests skip
sam-hey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import pytest | ||
|
|
||
| import mteb | ||
| from mteb import MTEB | ||
| from mteb.abstasks import AbsTask | ||
|
|
||
| from .mock_tasks import MockRetrievalTask | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("model", ["colbert-ir/colbertv2.0"]) | ||
| @pytest.mark.parametrize("task", [MockRetrievalTask()]) | ||
| def test_colbert_model_e2e(task: AbsTask, model: str): | ||
| pytest.importorskip("pylate", reason="pylate not installed") | ||
| eval_splits = ["test"] | ||
| model = mteb.get_model(model) | ||
| evaluation = MTEB(tasks=[task]) | ||
|
|
||
| results = evaluation.run( | ||
| model, | ||
| eval_splits=eval_splits, | ||
| corpus_chunk_size=500, | ||
| ) | ||
| result = results[0] | ||
|
|
||
| assert result.scores["test"][0]["ndcg_at_1"] == 1.0 | ||
|
|
||
|
|
||
| def test_bm25s_e2e(): | ||
| # fails for dataset smaller then 1000 | ||
| pytest.importorskip("bm25s", reason="bm25s not installed") | ||
| pytest.importorskip("Stemmer", reason="PyStemmer not installed") | ||
|
|
||
| model = mteb.get_model("bm25s") | ||
| tasks = mteb.get_tasks(tasks=["NFCorpus"]) | ||
| eval_splits = ["test"] | ||
|
|
||
| evaluation = MTEB(tasks=tasks) | ||
|
|
||
| results = evaluation.run(model, eval_splits=eval_splits) | ||
| result = results[0] | ||
|
|
||
| assert result.scores["test"][0]["ndcg_at_1"] == 0.42879 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.