-
Notifications
You must be signed in to change notification settings - Fork 559
Add Talemaader pair classification task #2621
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||||||||||||||||||||||||||
| from __future__ import annotations | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| from mteb.abstasks.AbsTaskPairClassification import AbsTaskPairClassification | ||||||||||||||||||||||||||||||||
| from mteb.abstasks.TaskMetadata import TaskMetadata | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| class TalemaaderPC(AbsTaskPairClassification): | ||||||||||||||||||||||||||||||||
| metadata = TaskMetadata( | ||||||||||||||||||||||||||||||||
| name="TalemaaderPC", | ||||||||||||||||||||||||||||||||
| description="""\ | ||||||||||||||||||||||||||||||||
| The Danish Language and Literature Society has developed a dataset for evaluating language models in Danish. | ||||||||||||||||||||||||||||||||
| The dataset contains a total of 1000 Danish idioms and fixed expressions with transferred meanings based on the Danish Dictionary's collection of fixed expressions with associated definitions. | ||||||||||||||||||||||||||||||||
| For each of the 1000 idioms and fixed expressions, three false definitions have also been prepared. | ||||||||||||||||||||||||||||||||
| The dataset can be used to test the performance of language models in identifying correct definitions for Danish idioms and fixed expressions. | ||||||||||||||||||||||||||||||||
| """, | ||||||||||||||||||||||||||||||||
| reference="https://sprogteknologi.dk/dataset/1000-talemader-evalueringsdatasaet", | ||||||||||||||||||||||||||||||||
| dataset={ | ||||||||||||||||||||||||||||||||
| "path": "mteb/talemaader_pc", | ||||||||||||||||||||||||||||||||
| "revision": "e714d53c059ca83d56c41d22f800da8245bb87fc", | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| type="PairClassification", | ||||||||||||||||||||||||||||||||
| category="s2s", | ||||||||||||||||||||||||||||||||
| modalities=["text"], | ||||||||||||||||||||||||||||||||
| eval_splits=["test"], | ||||||||||||||||||||||||||||||||
| eval_langs=["dan-Latn"], | ||||||||||||||||||||||||||||||||
| main_score="max_accuracy", | ||||||||||||||||||||||||||||||||
| date=("2024-11-20", "2024-11-20"), | ||||||||||||||||||||||||||||||||
| domains=["Academic", "Written"], | ||||||||||||||||||||||||||||||||
| task_subtypes=[], | ||||||||||||||||||||||||||||||||
| license="cc-by-4.0", | ||||||||||||||||||||||||||||||||
| annotations_creators="derived", | ||||||||||||||||||||||||||||||||
| dialect=[], | ||||||||||||||||||||||||||||||||
| sample_creation="created", | ||||||||||||||||||||||||||||||||
| bibtex_citation=""" | ||||||||||||||||||||||||||||||||
| @misc{DSLDK1000Talemader, | ||||||||||||||||||||||||||||||||
| title = {1000 danske talemåder - evalueringsdatasæt}, | ||||||||||||||||||||||||||||||||
| author = {{Det Danske Sprog- og Litteraturselskab}}, | ||||||||||||||||||||||||||||||||
| year = {2024}, | ||||||||||||||||||||||||||||||||
| howpublished = {Sprogteknologi.dk}, | ||||||||||||||||||||||||||||||||
| url = {https://sprogteknologi.dk/dataset/1000-talemader-evalueringsdatasaet}, | ||||||||||||||||||||||||||||||||
| note = {CC-BY licensed dataset of 1000 Danish sayings and expressions}, | ||||||||||||||||||||||||||||||||
| publisher = {Digitaliseringsstyrelsen \& Det Danske Sprog- og Litteraturselskab}, | ||||||||||||||||||||||||||||||||
| language = {Danish} | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| """, | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| def dataset_transform(self): | ||||||||||||||||||||||||||||||||
| _dataset = {} | ||||||||||||||||||||||||||||||||
| for split in self.metadata.eval_splits: | ||||||||||||||||||||||||||||||||
| hf_dataset = self.dataset[split] | ||||||||||||||||||||||||||||||||
| _dataset[split] = [ | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| "sentence1": hf_dataset["sentence1"], | ||||||||||||||||||||||||||||||||
| "sentence2": hf_dataset["sentence2"], | ||||||||||||||||||||||||||||||||
| "labels": hf_dataset["label"], | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| self.dataset = _dataset | ||||||||||||||||||||||||||||||||
|
Comment on lines
+48
to
+59
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't remove this because PCEvaluator expects each column to be a list of samples (it's due to legacy PC formatting within mteb, we never changed it):
Removing this leads to error and the task not running.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, maybe then we can change it like it's done in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be great just to use the columns - but that might be a v2 thing Also, I believe it should be possible just to specify the columns of the labels (instead of reformatting)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, if we have this line we won't need this function. But it's in v2, right? We're compelting issue #2608 on main no?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wouldn't break anything, so I think we can add it directly to main |
||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.