Commit ·
a8ac55e
1
Parent(s): c042e29
update
Browse files- bigbiohub.py +1 -2
- scitail.py +8 -21
bigbiohub.py
CHANGED
|
@@ -6,8 +6,7 @@ from types import SimpleNamespace
|
|
| 6 |
from dataclasses import dataclass
|
| 7 |
import datasets
|
| 8 |
|
| 9 |
-
from licenses import License
|
| 10 |
-
from licenses import Licenses
|
| 11 |
|
| 12 |
|
| 13 |
BigBioValues = SimpleNamespace(NULL="<BB_NULL_STR>")
|
|
|
|
| 6 |
from dataclasses import dataclass
|
| 7 |
import datasets
|
| 8 |
|
| 9 |
+
from . licenses import License, Licenses
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
BigBioValues = SimpleNamespace(NULL="<BB_NULL_STR>")
|
scitail.py
CHANGED
|
@@ -28,18 +28,13 @@ import os
|
|
| 28 |
import datasets
|
| 29 |
import pandas as pd
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
@dataclass
|
| 33 |
-
class BigBioConfig(datasets.BuilderConfig):
|
| 34 |
-
"""BuilderConfig for BigBio."""
|
| 35 |
|
| 36 |
-
|
| 37 |
-
version: datasets.Version = None
|
| 38 |
-
description: str = None
|
| 39 |
-
schema: str = None
|
| 40 |
-
subset_id: str = None
|
| 41 |
-
|
| 42 |
-
_LANGUAGES = ["EN"]
|
| 43 |
_PUBMED = False
|
| 44 |
_LOCAL = False
|
| 45 |
_CITATION = """\
|
|
@@ -66,13 +61,13 @@ entails label and 16,925 examples with neutral label.
|
|
| 66 |
|
| 67 |
_HOMEPAGE = "https://allenai.org/data/scitail"
|
| 68 |
|
| 69 |
-
_LICENSE =
|
| 70 |
|
| 71 |
_URLS = {
|
| 72 |
_DATASETNAME: "https://ai2-public-datasets.s3.amazonaws.com/scitail/SciTailV1.1.zip",
|
| 73 |
}
|
| 74 |
|
| 75 |
-
_SUPPORTED_TASKS = [
|
| 76 |
|
| 77 |
_SOURCE_VERSION = "1.1.0"
|
| 78 |
|
|
@@ -81,14 +76,6 @@ _BIGBIO_VERSION = "1.0.0"
|
|
| 81 |
|
| 82 |
LABEL_MAP = {"entails": "entailment", "neutral": "neutral"}
|
| 83 |
|
| 84 |
-
entailment_features = datasets.Features(
|
| 85 |
-
{
|
| 86 |
-
"id": datasets.Value("string"),
|
| 87 |
-
"premise": datasets.Value("string"),
|
| 88 |
-
"hypothesis": datasets.Value("string"),
|
| 89 |
-
"label": datasets.Value("string"),
|
| 90 |
-
}
|
| 91 |
-
)
|
| 92 |
|
| 93 |
class SciTailDataset(datasets.GeneratorBasedBuilder):
|
| 94 |
"""TODO: Short description of my dataset."""
|
|
@@ -186,4 +173,4 @@ class SciTailDataset(datasets.GeneratorBasedBuilder):
|
|
| 186 |
# normalize labels
|
| 187 |
data["label"] = data["label"].apply(lambda x: LABEL_MAP[x])
|
| 188 |
for _, row in data.iterrows():
|
| 189 |
-
yield row["id"], row.to_dict()
|
|
|
|
| 28 |
import datasets
|
| 29 |
import pandas as pd
|
| 30 |
|
| 31 |
+
from . bigbiohub import entailment_features
|
| 32 |
+
from . bigbiohub import BigBioConfig
|
| 33 |
+
from . bigbiohub import Lang, Tasks
|
| 34 |
+
from . bigbiohub import Licenses
|
| 35 |
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
_LANGUAGES = [Lang.EN]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
_PUBMED = False
|
| 39 |
_LOCAL = False
|
| 40 |
_CITATION = """\
|
|
|
|
| 61 |
|
| 62 |
_HOMEPAGE = "https://allenai.org/data/scitail"
|
| 63 |
|
| 64 |
+
_LICENSE = Licenses.APACHE_2p0
|
| 65 |
|
| 66 |
_URLS = {
|
| 67 |
_DATASETNAME: "https://ai2-public-datasets.s3.amazonaws.com/scitail/SciTailV1.1.zip",
|
| 68 |
}
|
| 69 |
|
| 70 |
+
_SUPPORTED_TASKS = [Tasks.TEXTUAL_ENTAILMENT]
|
| 71 |
|
| 72 |
_SOURCE_VERSION = "1.1.0"
|
| 73 |
|
|
|
|
| 76 |
|
| 77 |
LABEL_MAP = {"entails": "entailment", "neutral": "neutral"}
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
class SciTailDataset(datasets.GeneratorBasedBuilder):
|
| 81 |
"""TODO: Short description of my dataset."""
|
|
|
|
| 173 |
# normalize labels
|
| 174 |
data["label"] = data["label"].apply(lambda x: LABEL_MAP[x])
|
| 175 |
for _, row in data.iterrows():
|
| 176 |
+
yield row["id"], row.to_dict()
|