Commit
·
2bf638f
1
Parent(s):
53d9b55
feat: revert to working version
Browse files
nucleotide_transformer_downstream_tasks_multilabel.py
CHANGED
|
@@ -84,17 +84,13 @@ class NucleotideTransformerDownstreamTasks(datasets.GeneratorBasedBuilder):
|
|
| 84 |
DEFAULT_CONFIG_NAME = "deepstarr"
|
| 85 |
|
| 86 |
def _info(self):
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
for i in range(self.config.num_labels)
|
| 95 |
-
}
|
| 96 |
-
features_dict.update(labels_dict)
|
| 97 |
-
features = datasets.Features(features_dict)
|
| 98 |
|
| 99 |
return datasets.DatasetInfo(
|
| 100 |
# This is the description that will appear on the datasets page.
|
|
@@ -136,16 +132,10 @@ class NucleotideTransformerDownstreamTasks(datasets.GeneratorBasedBuilder):
|
|
| 136 |
sequence, name = str(record.seq), str(record.name)
|
| 137 |
labels = [float(label) for label in name.split("|")[1:]]
|
| 138 |
|
| 139 |
-
|
|
|
|
| 140 |
"sequence": sequence,
|
| 141 |
"name": name,
|
| 142 |
"labels": labels,
|
| 143 |
}
|
| 144 |
-
|
| 145 |
-
labels_dict = {
|
| 146 |
-
f"label_{i}": labels[i] for i in range(self.config.num_labels)
|
| 147 |
-
}
|
| 148 |
-
sequence_name_dict.update(labels_dict)
|
| 149 |
-
# yield example
|
| 150 |
-
yield key, sequence_name_dict
|
| 151 |
key += 1
|
|
|
|
| 84 |
DEFAULT_CONFIG_NAME = "deepstarr"
|
| 85 |
|
| 86 |
def _info(self):
|
| 87 |
+
features = datasets.Features(
|
| 88 |
+
{
|
| 89 |
+
"sequence": datasets.Value("string"),
|
| 90 |
+
"name": datasets.Value("string"),
|
| 91 |
+
"labels": datasets.Sequence(self.config.dtype),
|
| 92 |
+
}
|
| 93 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
return datasets.DatasetInfo(
|
| 96 |
# This is the description that will appear on the datasets page.
|
|
|
|
| 132 |
sequence, name = str(record.seq), str(record.name)
|
| 133 |
labels = [float(label) for label in name.split("|")[1:]]
|
| 134 |
|
| 135 |
+
# yield example
|
| 136 |
+
yield key, {
|
| 137 |
"sequence": sequence,
|
| 138 |
"name": name,
|
| 139 |
"labels": labels,
|
| 140 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
key += 1
|