pietrolesci
commited on
Commit
•
5a0dcad
1
Parent(s):
eb74e89
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Overview
|
2 |
+
|
3 |
+
Proposed by
|
4 |
+
```latex
|
5 |
+
@InProceedings{glockner_acl18,
|
6 |
+
author = {Glockner, Max and Shwartz, Vered and Goldberg, Yoav},
|
7 |
+
title = {Breaking NLI Systems with Sentences that Require Simple Lexical Inferences},
|
8 |
+
booktitle = {The 56th Annual Meeting of the Association for Computational Linguistics (ACL)},
|
9 |
+
month = {July},
|
10 |
+
year = {2018},
|
11 |
+
address = {Melbourne, Australia}
|
12 |
+
}
|
13 |
+
```
|
14 |
+
|
15 |
+
Original dataset available [here](https://github.com/BIU-NLP/Breaking_NLI).
|
16 |
+
|
17 |
+
|
18 |
+
## Dataset curation
|
19 |
+
Labels encoded with the following mapping `{"entailment": 0, "neutral": 1, "contradiction": 2}`
|
20 |
+
and made available in the `label` column.
|
21 |
+
|
22 |
+
|
23 |
+
## Code to create the dataset
|
24 |
+
```python
|
25 |
+
import pandas as pd
|
26 |
+
from datasets import Features, Value, ClassLabel, Dataset, Sequence
|
27 |
+
|
28 |
+
|
29 |
+
# load data
|
30 |
+
with open("<path to folder>/dataset.jsonl", "r") as fl:
|
31 |
+
data = fl.read().split("\n")
|
32 |
+
df = pd.DataFrame([eval(i) for i in data if len(i) > 0])
|
33 |
+
|
34 |
+
# encode labels
|
35 |
+
df["label"] = df["gold_label"].map({"entailment": 0, "neutral": 1, "contradiction": 2})
|
36 |
+
|
37 |
+
# cast to dataset
|
38 |
+
features = Features({
|
39 |
+
"sentence1": Value(dtype="string", id=None),
|
40 |
+
"category": Value(dtype="string", id=None),
|
41 |
+
"gold_label": Value(dtype="string", id=None),
|
42 |
+
"annotator_labels": Sequence(feature=Value(dtype="string", id=None), length=3),
|
43 |
+
"pairID": Value(dtype="int32", id=None),
|
44 |
+
"sentence2": Value(dtype="string", id=None),
|
45 |
+
"label": ClassLabel(num_classes=3, names=["entailment", "neutral", "contradiction"]),
|
46 |
+
})
|
47 |
+
ds = Dataset.from_pandas(df, features=features)
|
48 |
+
ds.push_to_hub("breaking_nli", token="<token>", split="all")
|
49 |
+
```
|