fix: update the label processing in gen_examples
Browse files- agro-nt-tasks.py +14 -7
agro-nt-tasks.py
CHANGED
@@ -190,11 +190,18 @@ class AgroNtTasks(datasets.GeneratorBasedBuilder):
|
|
190 |
|
191 |
split_name = record.name.split("|")
|
192 |
name = split_name[0]
|
193 |
-
labels = split_name[1]
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
key += 1
|
|
|
190 |
|
191 |
split_name = record.name.split("|")
|
192 |
name = split_name[0]
|
193 |
+
labels = split_name[1:]
|
194 |
+
|
195 |
+
if 'multi' in self.config.task_type:
|
196 |
+
yield key, {
|
197 |
+
"sequence": str(record.seq),
|
198 |
+
"name": name,
|
199 |
+
"labels": labels,
|
200 |
+
}
|
201 |
+
else:
|
202 |
+
yield key, {
|
203 |
+
"sequence": str(record.seq),
|
204 |
+
"name": name,
|
205 |
+
"label": labels[0],
|
206 |
+
}
|
207 |
key += 1
|