pietrolesci
commited on
Commit
·
94c64c8
1
Parent(s):
2f914a5
Update README.md
Browse files
README.md
CHANGED
@@ -6,9 +6,10 @@ Original dataset is available on the HuggingFace Hub [here](https://huggingface.
|
|
6 |
This is the same as the `snli_format` split of the SciTail dataset available on the HuggingFace Hub (i.e., same data, same splits, etc).
|
7 |
The only differences are the following:
|
8 |
|
9 |
-
- selecting only the columns `["sentence1", "sentence2", "gold_label"]`
|
10 |
-
- renaming columns with the following mapping `{"sentence1": "premise", "sentence2": "hypothesis"
|
11 |
-
-
|
|
|
12 |
|
13 |
Note that there are 10 overlapping instances (as found by merging on columns "label", "premise", and "hypothesis") between
|
14 |
`train` and `test` splits.
|
@@ -29,16 +30,17 @@ for name, df_ in dd.items():
|
|
29 |
df = df[["sentence1", "sentence2", "gold_label"]]
|
30 |
|
31 |
# rename columns
|
32 |
-
df = df.rename(columns={"sentence1": "premise", "sentence2": "hypothesis"
|
33 |
|
34 |
# encode labels
|
35 |
-
df["label"] = df["
|
|
|
36 |
|
37 |
# cast to dataset
|
38 |
features = Features({
|
39 |
"premise": Value(dtype="string", id=None),
|
40 |
"hypothesis": Value(dtype="string", id=None),
|
41 |
-
"label": ClassLabel(num_classes=
|
42 |
})
|
43 |
ds[name] = Dataset.from_pandas(df, features=features)
|
44 |
|
|
|
6 |
This is the same as the `snli_format` split of the SciTail dataset available on the HuggingFace Hub (i.e., same data, same splits, etc).
|
7 |
The only differences are the following:
|
8 |
|
9 |
+
- selecting only the columns `["sentence1", "sentence2", "gold_label", "label"]`
|
10 |
+
- renaming columns with the following mapping `{"sentence1": "premise", "sentence2": "hypothesis"}`
|
11 |
+
- creating a new column "label" from "gold_label" with the following mapping `{"entailment": "entailment", "neutral": "not_entailment"}`
|
12 |
+
- encoding labels with the following mapping `{"not_entailment": 0, "entailment": 1}`
|
13 |
|
14 |
Note that there are 10 overlapping instances (as found by merging on columns "label", "premise", and "hypothesis") between
|
15 |
`train` and `test` splits.
|
|
|
30 |
df = df[["sentence1", "sentence2", "gold_label"]]
|
31 |
|
32 |
# rename columns
|
33 |
+
df = df.rename(columns={"sentence1": "premise", "sentence2": "hypothesis"})
|
34 |
|
35 |
# encode labels
|
36 |
+
df["label"] = df["gold_label"].map({"entailment": "entailment", "neutral": "not_entailment"})
|
37 |
+
df["label"] = df["label"].map({"not_entailment": 0, "entailment": 1})
|
38 |
|
39 |
# cast to dataset
|
40 |
features = Features({
|
41 |
"premise": Value(dtype="string", id=None),
|
42 |
"hypothesis": Value(dtype="string", id=None),
|
43 |
+
"label": ClassLabel(num_classes=2, names=["not_entailment", "entailment"]),
|
44 |
})
|
45 |
ds[name] = Dataset.from_pandas(df, features=features)
|
46 |
|