pietrolesci/glue_diagnostics
收藏Hugging Face2022-04-21 更新2024-03-04 收录
下载链接:
https://hf-mirror.com/datasets/pietrolesci/glue_diagnostics
下载链接
链接失效反馈官方服务:
资源简介:
## Overview
Original dataset available [here](https://gluebenchmark.com/diagnostics).
## Dataset curation
Filled in the empty rows of columns "lexical semantics", "predicate-argument structure",
"logic", "knowledge" with empty string `""`.
Labels are encoded as follows
```
{"entailment": 0, "neutral": 1, "contradiction": 2}
```
## Code to create dataset
```python
import pandas as pd
from datasets import Features, Value, ClassLabel, Dataset
df = pd.read_csv("<path to file>/diagnostic-full.tsv", sep="\t")
# column names to lower
df.columns = df.columns.str.lower()
# fill na
assert df["label"].isna().sum() == 0
df = df.fillna("")
# encode labels
df["label"] = df["label"].map({"entailment": 0, "neutral": 1, "contradiction": 2})
# cast to dataset
features = Features({
"lexical semantics": Value(dtype="string", id=None),
"predicate-argument structure": Value(dtype="string", id=None),
"logic": Value(dtype="string", id=None),
"knowledge": Value(dtype="string", id=None),
"domain": Value(dtype="string", id=None),
"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.push_to_hub("glue_diagnostics", token="<token>", split="test")
```
提供机构:
pietrolesci
原始信息汇总
数据集概述
- 原始数据集可从此链接获取。
数据集整理
-
对列“lexical semantics”, “predicate-argument structure”, “logic”, “knowledge”中的空行填充了空字符串
""。 -
标签编码方式如下:
{"entailment": 0, "neutral": 1, "contradiction": 2}
数据集创建代码
- 使用
pandas读取并处理数据,数据文件路径为<path to file>/diagnostic-full.tsv,分隔符为制表符。 - 将所有列名转换为小写。
- 确保
label列无缺失值,并填充其他列的缺失值为空字符串。 - 对
label列进行编码,映射为整数:entailment为0,neutral为1,contradiction为2。 - 数据集特征定义包括:
- "lexical semantics", "predicate-argument structure", "logic", "knowledge", "domain", "premise", "hypothesis" 均为字符串类型。
- "label" 为分类标签,包含3个类别:"entailment", "neutral", "contradiction"。
- 最终数据集通过
Dataset.from_pandas方法创建,并上传至Hugging Face Hub,仓库名为glue_diagnostics,使用test分割,上传时使用了特定token。



