Skip to content
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

Add FaMTEB (Farsi/Persian Text Embedding Benchmark) #1843

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

mehran-sarmadi
Copy link

@mehran-sarmadi mehran-sarmadi commented Jan 20, 2025

We are a research team from Sharif University of Technology and MCINext Company developing a text embedding benchmark for the Persian language based on MTEB. So far, we have gathered around 63 datasets spanning 7 tasks (Classification, Clustering, Pair Classification, Reranking, Retrieval, STS, and Summary Retrieval), including a mix of existing, translated, and newly generated datasets. Notably, we are introducing the Summary Retrieval task for the first time, which focuses on identifying the correct summary of a paragraph from a set of candidates. We have also evaluated several Persian language models and text embeddings that support Persian for this benchmark.

We also open related PR for the results and leaderboard tab, and we are finalizing a paper on this work, which will be published in the near future.

Checklist

  • Run tests locally to make sure nothing is broken using make test.
  • Run the formatter to format the code using make lint.

Adding datasets checklist

Reason for dataset addition: ...

  • I have run the following models on the task (adding the results to the pr). These can be run using the mteb -m {model_name} -t {task_name} command.
    • sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
    • intfloat/multilingual-e5-small
  • I have checked that the performance is neither trivial (both models gain close to perfect scores) nor random (both models gain close to random scores).
  • If the dataset is too big (e.g. >2048 examples), considering using self.stratified_subsampling() under dataset_transform()
  • I have filled out the metadata object in the dataset file (find documentation on it here).
  • Run tests locally to make sure nothing is broken using make test.
  • Run the formatter to format the code using make lint.

@mehran-sarmadi mehran-sarmadi marked this pull request as ready for review January 25, 2025 14:41
Copy link
Collaborator

@Samoed Samoed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition! Can you add mock task of AbsTaskSummaryRetrieval task to https://github.com/embeddings-benchmark/mteb/blob/main/tests/test_benchmark/mock_tasks.py?

mteb/abstasks/AbsTaskSummaryRetrieval.py Outdated Show resolved Hide resolved
unique_summary: int


class AbsTaskSummaryRetrieval(AbsTask):
Copy link
Collaborator

@Samoed Samoed Jan 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could inherit from AbsTaskBitextmining to reuse the evaluate function?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This task is different from summarization task it involves identifying the exact summary of a given paragraph from a set of potential summaries. A model embeds sentences and determines the closest pairs using cosine similarity.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I know. It seems that you don't have parallel datasets in your tasks, maybe you can use evaluate from AbsTask?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This task is very similar to Bitextmining, so I think I can inherit the evaluate method from it. I can also do the same for the _similarity_search method in the SummaryRetrievalEvaluator.

scores[hf_subet] = self._evaluate_subset(
model,
data_split, # type: ignore
subsets=["text", "summary"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't use it anywhere

Suggested change
subsets=["text", "summary"],

Comment on lines 320 to 322
domains=[],
task_subtypes=[],
license="not specified",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fill more information about tasks?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes its ongoing

mteb/tasks/SummaryRetrieval/fas/FaMTEBSummaryRetrieval.py Outdated Show resolved Hide resolved
mteb/tasks/SummaryRetrieval/fas/FaMTEBSummaryRetrieval.py Outdated Show resolved Hide resolved
mteb/tasks/SummaryRetrieval/fas/FaMTEBSummaryRetrieval.py Outdated Show resolved Hide resolved
@Samoed
Copy link
Collaborator

Samoed commented Jan 25, 2025

Maybe we should move this PR to v2 branch?

@mehran-sarmadi
Copy link
Author

Maybe we should move this PR to v2 branch?

I haven’t checked the next version yet, so I’m not sure if any changes are needed. If needed, I’ll make the updates.

Comment on lines +1300 to +1310
"CQADupstackAndroidRetrieval-Fa",
"CQADupstackEnglishRetrieval-Fa",
"CQADupstackGamingRetrieval-Fa",
"CQADupstackGisRetrieval-Fa",
"CQADupstackMathematicaRetrieval-Fa",
"CQADupstackPhysicsRetrieval-Fa",
"CQADupstackProgrammersRetrieval-Fa",
"CQADupstackStatsRetrieval-Fa",
"CQADupstackTexRetrieval-Fa",
"CQADupstackUnixRetrieval-Fa",
"CQADupstackWebmastersRetrieval-Fa",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you add these datasets? Also FYI #1771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants