Datasets:
Upload 3 files
Browse files- Biosses-BLUE.py +11 -8
- test_dataset.py +4 -4
Biosses-BLUE.py
CHANGED
@@ -63,13 +63,13 @@ class Biosses(datasets.GeneratorBasedBuilder):
|
|
63 |
|
64 |
BUILDER_CONFIGS = [
|
65 |
datasets.BuilderConfig(
|
66 |
-
name = "
|
67 |
version = datasets.Version("0.2.0"),
|
68 |
description = f"The Biosses corpora",
|
69 |
)
|
70 |
]
|
71 |
|
72 |
-
DEFAULT_CONFIG_NAME = "
|
73 |
|
74 |
def _info(self):
|
75 |
return datasets.DatasetInfo(
|
@@ -92,31 +92,34 @@ class Biosses(datasets.GeneratorBasedBuilder):
|
|
92 |
def _split_generators(self, dl_manager):
|
93 |
"""Returns SplitGenerators."""
|
94 |
|
95 |
-
|
96 |
|
97 |
return [
|
98 |
datasets.SplitGenerator(
|
99 |
name=datasets.Split.TRAIN,
|
100 |
gen_kwargs={
|
101 |
-
"corpus_path":
|
|
|
102 |
},
|
103 |
),
|
104 |
datasets.SplitGenerator(
|
105 |
name=datasets.Split.VALIDATION,
|
106 |
gen_kwargs={
|
107 |
-
"corpus_path":
|
|
|
108 |
},
|
109 |
),
|
110 |
datasets.SplitGenerator(
|
111 |
name=datasets.Split.TEST,
|
112 |
gen_kwargs={
|
113 |
-
"corpus_path":
|
|
|
114 |
},
|
115 |
),
|
116 |
]
|
117 |
-
def _generate_examples(self, corpus_path: Path):
|
118 |
|
119 |
-
df = pd.read_csv(corpus_path, sep="\t")
|
120 |
|
121 |
for index, r in df.iterrows():
|
122 |
|
|
|
63 |
|
64 |
BUILDER_CONFIGS = [
|
65 |
datasets.BuilderConfig(
|
66 |
+
name = "biosses",
|
67 |
version = datasets.Version("0.2.0"),
|
68 |
description = f"The Biosses corpora",
|
69 |
)
|
70 |
]
|
71 |
|
72 |
+
DEFAULT_CONFIG_NAME = "biosses"
|
73 |
|
74 |
def _info(self):
|
75 |
return datasets.DatasetInfo(
|
|
|
92 |
def _split_generators(self, dl_manager):
|
93 |
"""Returns SplitGenerators."""
|
94 |
|
95 |
+
archive = dl_manager.download_and_extract(_URL)
|
96 |
|
97 |
return [
|
98 |
datasets.SplitGenerator(
|
99 |
name=datasets.Split.TRAIN,
|
100 |
gen_kwargs={
|
101 |
+
"corpus_path": archive,
|
102 |
+
"split": "train",
|
103 |
},
|
104 |
),
|
105 |
datasets.SplitGenerator(
|
106 |
name=datasets.Split.VALIDATION,
|
107 |
gen_kwargs={
|
108 |
+
"corpus_path": archive,
|
109 |
+
"split": "dev",
|
110 |
},
|
111 |
),
|
112 |
datasets.SplitGenerator(
|
113 |
name=datasets.Split.TEST,
|
114 |
gen_kwargs={
|
115 |
+
"corpus_path": archive,
|
116 |
+
"split": "test",
|
117 |
},
|
118 |
),
|
119 |
]
|
120 |
+
def _generate_examples(self, corpus_path: Path, split: str):
|
121 |
|
122 |
+
df = pd.read_csv(f"{corpus_path}/data/BIOSSES/{split}.tsv", sep="\t")
|
123 |
|
124 |
for index, r in df.iterrows():
|
125 |
|
test_dataset.py
CHANGED
@@ -5,13 +5,13 @@ from datasets import load_dataset, set_caching_enabled
|
|
5 |
# If you need to force clear the cache
|
6 |
# set_caching_enabled(False)
|
7 |
|
8 |
-
source = "Biosses.py"
|
9 |
-
# source = "qanastek/Biosses"
|
10 |
|
11 |
dataset = load_dataset(source)
|
12 |
# dataset = load_dataset(source, "default")
|
13 |
|
14 |
print(dataset)
|
15 |
|
16 |
-
f = dataset["validation"][0]
|
17 |
-
print(f)
|
|
|
5 |
# If you need to force clear the cache
|
6 |
# set_caching_enabled(False)
|
7 |
|
8 |
+
source = "Biosses-BLUE.py"
|
9 |
+
# source = "qanastek/Biosses-BLUE"
|
10 |
|
11 |
dataset = load_dataset(source)
|
12 |
# dataset = load_dataset(source, "default")
|
13 |
|
14 |
print(dataset)
|
15 |
|
16 |
+
# f = dataset["validation"][0]
|
17 |
+
# print(f)
|