## Overview The original dataset can be found [here](https://github.com/swarnaHub/ConjNLI). It has been proposed in [ConjNLI: Natural Language Inference Over Conjunctive Sentences](https://aclanthology.org/2020.emnlp-main.661/). This dataset is a stress test for natural language inference over conjunctive sentences, where the premise differs from the hypothesis by conjuncts removed, added, or replaced. ## Dataset curation No curation is performed. This dataset is "as-is". The label mapping is the usual `{"entailment": 0, "neutral": 1, "contradiction": 2}` used in NLI datasets. ## Code to create the dataset ```python import pandas as pd from datasets import Dataset, ClassLabel, Value, Features, DatasetDict # download data from repo https://github.com/swarnaHub/ConjNLI paths = { "train": "/ConjNLI-master/data/NLI/adversarial_train_15k.tsv", "dev": "/ConjNLI-master/data/NLI/conj_dev.tsv", "test": "/ConjNLI-master/data/NLI/conj_test.tsv", } if __name__ =="__main__": dataset_splits = {} for split, path in paths.items(): # read dataset split df = pd.read_csv(paths[split], sep="\t") # encode labels using the default mapping used by other nli datasets # i.e, entailment: 0, neutral: 1, contradiction: 2 df.columns = df.columns.str.lower() if not "test" in path: df["label"] = df["label"].map({"entailment": 0, "neutral": 1, "contradiction": 2}) else: df["label"] = -1 # cast to dataset features = Features({ "premise": Value(dtype="string", id=None), "hypothesis": Value(dtype="string", id=None), "label": ClassLabel(num_classes=3, names=["entailment", "neutral", "contradiction"]), }) dataset = Dataset.from_pandas(df, features=features) dataset_splits[split] = dataset conj_nli = DatasetDict(dataset_splits) conj_nli.push_to_hub("pietrolesci/conj_nli", token="") ```