Upload PAIR.py
Browse files
PAIR.py
CHANGED
|
@@ -85,14 +85,14 @@ class PAIRDataset(datasets.GeneratorBasedBuilder):
|
|
| 85 |
|
| 86 |
def _info(self):
|
| 87 |
"""_info."""
|
| 88 |
-
print("HELLOOOO")
|
| 89 |
self.annotation_type = self.config_kwargs["annotation_type"]
|
| 90 |
# Confirm annotation_type is set before continuing
|
| 91 |
return datasets.DatasetInfo(
|
| 92 |
description="My custom dataset.",
|
| 93 |
features=datasets.Features(
|
| 94 |
{
|
| 95 |
-
|
|
|
|
| 96 |
"sequence": datasets.Value("string"),
|
| 97 |
"pid": datasets.Value("string"),
|
| 98 |
}
|
|
@@ -143,8 +143,8 @@ class PAIRDataset(datasets.GeneratorBasedBuilder):
|
|
| 143 |
counter = 0
|
| 144 |
for idx, annotation_type in enumerate(data.keys()):
|
| 145 |
print(annotation_type, self.annotation_type)
|
| 146 |
-
if annotation_type != self.annotation_type:
|
| 147 |
-
|
| 148 |
# Parse your line into the appropriate fields
|
| 149 |
samples = data[annotation_type]
|
| 150 |
for idx_2, elem in enumerate(samples):
|
|
@@ -152,7 +152,7 @@ class PAIRDataset(datasets.GeneratorBasedBuilder):
|
|
| 152 |
if elem["content"] != [None]:
|
| 153 |
content = elem["content"][0]
|
| 154 |
# print(literal_eval(content), "done")
|
| 155 |
-
yield
|
| 156 |
"sequence": elem["seq"],
|
| 157 |
"pid": elem["pid"],
|
| 158 |
annotation_type: content,
|
|
|
|
| 85 |
|
| 86 |
def _info(self):
|
| 87 |
"""_info."""
|
|
|
|
| 88 |
self.annotation_type = self.config_kwargs["annotation_type"]
|
| 89 |
# Confirm annotation_type is set before continuing
|
| 90 |
return datasets.DatasetInfo(
|
| 91 |
description="My custom dataset.",
|
| 92 |
features=datasets.Features(
|
| 93 |
{
|
| 94 |
+
"names": datasets.Value("string"),
|
| 95 |
+
"EC": datasets.Sequence(datasets.Value("string")),
|
| 96 |
"sequence": datasets.Value("string"),
|
| 97 |
"pid": datasets.Value("string"),
|
| 98 |
}
|
|
|
|
| 143 |
counter = 0
|
| 144 |
for idx, annotation_type in enumerate(data.keys()):
|
| 145 |
print(annotation_type, self.annotation_type)
|
| 146 |
+
#if annotation_type != self.annotation_type:
|
| 147 |
+
# continue
|
| 148 |
# Parse your line into the appropriate fields
|
| 149 |
samples = data[annotation_type]
|
| 150 |
for idx_2, elem in enumerate(samples):
|
|
|
|
| 152 |
if elem["content"] != [None]:
|
| 153 |
content = elem["content"][0]
|
| 154 |
# print(literal_eval(content), "done")
|
| 155 |
+
yield elem["pid"], {
|
| 156 |
"sequence": elem["seq"],
|
| 157 |
"pid": elem["pid"],
|
| 158 |
annotation_type: content,
|