parquet-converter
commited on
Commit
•
c2ef7e1
1
Parent(s):
5bd658a
Update parquet files
Browse files- .gitattributes +0 -38
- README.md +0 -90
- dataset_infos.json +0 -1
- data/dev-00000-of-00001.parquet → pietrolesci--mpe/parquet-dev.parquet +2 -2
- data/test-00000-of-00001.parquet → pietrolesci--mpe/parquet-test.parquet +2 -2
- data/train-00000-of-00001.parquet → pietrolesci--mpe/parquet-train.parquet +2 -2
.gitattributes
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
26 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
29 |
-
# Audio files - uncompressed
|
30 |
-
*.pcm filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.sam filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.raw filter=lfs diff=lfs merge=lfs -text
|
33 |
-
# Audio files - compressed
|
34 |
-
*.aac filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*.flac filter=lfs diff=lfs merge=lfs -text
|
36 |
-
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
37 |
-
*.ogg filter=lfs diff=lfs merge=lfs -text
|
38 |
-
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,90 +0,0 @@
|
|
1 |
-
## Overview
|
2 |
-
|
3 |
-
Original dataset [here](https://github.com/aylai/MultiPremiseEntailment).
|
4 |
-
|
5 |
-
|
6 |
-
## Dataset curation
|
7 |
-
Same data and splits as the original. The following columns have been added:
|
8 |
-
|
9 |
-
- `premise`: concatenation of `premise1`, `premise2`, `premise3`, and `premise4`
|
10 |
-
- `label`: encoded `gold_label` with the following mapping `{"entailment": 0, "neutral": 1, "contradiction": 2}`
|
11 |
-
|
12 |
-
|
13 |
-
## Code to create the dataset
|
14 |
-
|
15 |
-
```python
|
16 |
-
import pandas as pd
|
17 |
-
from datasets import Features, Value, ClassLabel, Dataset, DatasetDict
|
18 |
-
from pathlib import Path
|
19 |
-
|
20 |
-
|
21 |
-
# read data
|
22 |
-
path = Path("<path to files>")
|
23 |
-
datasets = {}
|
24 |
-
for dataset_path in path.rglob("*.txt"):
|
25 |
-
df = pd.read_csv(dataset_path, sep="\t")
|
26 |
-
datasets[dataset_path.name.split("_")[1].split(".")[0]] = df
|
27 |
-
|
28 |
-
|
29 |
-
ds = {}
|
30 |
-
for name, df_ in datasets.items():
|
31 |
-
df = df_.copy()
|
32 |
-
|
33 |
-
# fix parsing error for dev split
|
34 |
-
if name == "dev":
|
35 |
-
# fix parsing error
|
36 |
-
df.loc[df["contradiction_judgments"] == "3 contradiction", "contradiction_judgments"] = 3
|
37 |
-
df.loc[df["gold_label"].isna(), "gold_label"] = "contradiction"
|
38 |
-
|
39 |
-
# check no nan
|
40 |
-
assert df.isna().sum().sum() == 0
|
41 |
-
|
42 |
-
# fix dtypes
|
43 |
-
for col in ("entailment_judgments", "neutral_judgments", "contradiction_judgments"):
|
44 |
-
df[col] = df[col].astype(int)
|
45 |
-
|
46 |
-
# fix premise column
|
47 |
-
for i in range(1, 4 + 1):
|
48 |
-
df[f"premise{i}"] = df[f"premise{i}"].str.split("/", expand=True)[1]
|
49 |
-
df["premise"] = df[[f"premise{i}" for i in range(1, 4 + 1)]].agg(" ".join, axis=1)
|
50 |
-
|
51 |
-
# encode labels
|
52 |
-
df["label"] = df["gold_label"].map({"entailment": 0, "neutral": 1, "contradiction": 2})
|
53 |
-
|
54 |
-
# cast to dataset
|
55 |
-
features = Features({
|
56 |
-
"premise1": Value(dtype="string", id=None),
|
57 |
-
"premise2": Value(dtype="string", id=None),
|
58 |
-
"premise3": Value(dtype="string", id=None),
|
59 |
-
"premise4": Value(dtype="string", id=None),
|
60 |
-
"premise": Value(dtype="string", id=None),
|
61 |
-
"hypothesis": Value(dtype="string", id=None),
|
62 |
-
"entailment_judgments": Value(dtype="int32"),
|
63 |
-
"neutral_judgments": Value(dtype="int32"),
|
64 |
-
"contradiction_judgments": Value(dtype="int32"),
|
65 |
-
"gold_label": Value(dtype="string"),
|
66 |
-
"label": ClassLabel(num_classes=3, names=["entailment", "neutral", "contradiction"]),
|
67 |
-
})
|
68 |
-
|
69 |
-
ds[name] = Dataset.from_pandas(df, features=features)
|
70 |
-
|
71 |
-
# push to hub
|
72 |
-
ds = DatasetDict(ds)
|
73 |
-
ds.push_to_hub("mpe", token="<token>")
|
74 |
-
|
75 |
-
# check overlap between splits
|
76 |
-
from itertools import combinations
|
77 |
-
for i, j in combinations(ds.keys(), 2):
|
78 |
-
print(
|
79 |
-
f"{i} - {j}: ",
|
80 |
-
pd.merge(
|
81 |
-
ds[i].to_pandas(),
|
82 |
-
ds[j].to_pandas(),
|
83 |
-
on=["premise", "hypothesis", "label"],
|
84 |
-
how="inner",
|
85 |
-
).shape[0],
|
86 |
-
)
|
87 |
-
#> dev - test: 0
|
88 |
-
#> dev - train: 0
|
89 |
-
#> test - train: 0
|
90 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"pietrolesci--mpe": {"description": "", "citation": "", "homepage": "", "license": "", "features": {"premise1": {"dtype": "string", "id": null, "_type": "Value"}, "premise2": {"dtype": "string", "id": null, "_type": "Value"}, "premise3": {"dtype": "string", "id": null, "_type": "Value"}, "premise4": {"dtype": "string", "id": null, "_type": "Value"}, "premise": {"dtype": "string", "id": null, "_type": "Value"}, "hypothesis": {"dtype": "string", "id": null, "_type": "Value"}, "entailment_judgments": {"dtype": "int32", "id": null, "_type": "Value"}, "neutral_judgments": {"dtype": "int32", "id": null, "_type": "Value"}, "contradiction_judgments": {"dtype": "int32", "id": null, "_type": "Value"}, "gold_label": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["entailment", "neutral", "contradiction"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": null, "config_name": null, "version": null, "splits": {"dev": {"name": "dev", "num_bytes": 591277, "num_examples": 1000, "dataset_name": "mpe"}, "test": {"name": "test", "num_bytes": 580988, "num_examples": 1000, "dataset_name": "mpe"}, "train": {"name": "train", "num_bytes": 4702677, "num_examples": 8000, "dataset_name": "mpe"}}, "download_checksums": null, "download_size": 2648384, "post_processing_size": null, "dataset_size": 5874942, "size_in_bytes": 8523326}}
|
|
|
|
data/dev-00000-of-00001.parquet → pietrolesci--mpe/parquet-dev.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:54eee4195d3cc84d67f3df04097a9304ee00b6d191a5395b8b8d00800b0c0662
|
3 |
+
size 254127
|
data/test-00000-of-00001.parquet → pietrolesci--mpe/parquet-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:177128af08665aabcb335a6e687e794b4c8dfe564b09ce126458704efd79c6dc
|
3 |
+
size 259295
|
data/train-00000-of-00001.parquet → pietrolesci--mpe/parquet-train.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:77307fe11cdf914bf6aab219280ae8c7e56ccf5ba93098684e33cc25baf0d489
|
3 |
+
size 2434549
|