-
Notifications
You must be signed in to change notification settings - Fork 482
dataset: fracas added #2990
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
Closed
Closed
dataset: fracas added #2990
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7904595
fracas added
MedAmineYoussef 3d5596e
Update mteb/tasks/PairClassification/fra/FraCaS.py
MedAmineYoussef 0282c39
Update FraCaS.py
MedAmineYoussef 7de0d14
Update mteb/tasks/PairClassification/fra/FraCaS.py
MedAmineYoussef f9be37e
Update FraCaS.py
MedAmineYoussef 9646205
Update adding_a_dataset.md
MedAmineYoussef e90b6c9
revert
KennethEnevoldsen 079db8f
fixed comments
KennethEnevoldsen 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from datasets import load_dataset | ||
from mteb.abstasks.AbsTaskPairClassification import AbsTaskPairClassification | ||
from mteb.abstasks.TaskMetadata import TaskMetadata | ||
|
||
class FracasTask(AbsTaskPairClassification): | ||
KennethEnevoldsen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
metadata = TaskMetadata( | ||
name="fracas", | ||
KennethEnevoldsen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
description=( | ||
"Natural language inference on FRACAS: " | ||
"prédit si une hypothèse découle (entailment) ou non d'une prémisse." | ||
), | ||
KennethEnevoldsen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
reference="https://huggingface.co/datasets/maximoss/fracas", | ||
dataset={"path": "maximoss/fracas", "revision": "main"}, | ||
Samoed marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
type="PairClassification", | ||
category="s2s", | ||
modalities=["text"], | ||
eval_splits=["train"], # FRACAS ne propose que ce split | ||
eval_langs=["fra-Latn"], | ||
main_score="max_accuracy", | ||
date=("2025-08-05", "2025-08-05"), | ||
Samoed marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
domains=["Academic"], | ||
task_subtypes=["Textual Entailment"], | ||
license="cc-by-4.0", | ||
annotations_creators="human-annotated", | ||
dialect=[], | ||
sample_creation="found", | ||
MedAmineYoussef marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
bibtex_citation=r""" | ||
@inproceedings{fracas2025, | ||
author = {Maxim Oss and Collaborateurs}, | ||
title = {FRACAS: A French NLI dataset}, | ||
booktitle = {Imaginary Conference on French NLP}, | ||
year = {2025}, | ||
} | ||
""", | ||
) | ||
|
||
def load_data(self, **kwargs): | ||
Samoed marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
"""Charge le DatasetDict HF puis transforme en self.dataset.""" | ||
if getattr(self, "data_loaded", False): | ||
return | ||
self.dataset = load_dataset( | ||
self.metadata.dataset["path"], | ||
revision=self.metadata.dataset["revision"], | ||
) | ||
self.dataset_transform() | ||
self.data_loaded = True | ||
|
||
def dataset_transform(self): | ||
""" | ||
Construit self.dataset sous la forme : | ||
{ | ||
'fra-Latn': { | ||
'train': [ | ||
{ | ||
'sentence1': [...], # liste de prémisses | ||
'sentence2': [...], # liste d’hypothèses | ||
'labels': [...], # liste de 0/1 | ||
} | ||
] | ||
} | ||
} | ||
""" | ||
out: dict[str, dict[str, list[dict[str, list]]]] = {} | ||
for lang in self.hf_subsets: # ['fra-Latn'] | ||
out[lang] = {} | ||
for split in self.metadata.eval_splits: # ['train'] | ||
ds = self.dataset[split] | ||
# Affiche les labels pour debugging | ||
print("FRACAS labels disponibles :", sorted(set(ds["label"]))) | ||
MedAmineYoussef marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# Filtrer hors 'undef' | ||
ds = ds.filter(lambda x: x["label"] != "undef") | ||
# Remapper '1'→1 (positif), '0' et '2'→0 (négatif) | ||
ds = ds.map(lambda ex: {"label": 1 if ex["label"] == "1" else 0}) | ||
# Construire la liste contenant UN dict de listes alignées | ||
out[lang][split] = [ | ||
{ | ||
"sentence1": ds["premises"], | ||
"sentence2": ds["hypothesis"], | ||
"labels": ds["label"], | ||
} | ||
] | ||
self.dataset = out |
Empty file.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match task name