Update DEFT2021.py
Browse files- DEFT2021.py +10 -8
DEFT2021.py
CHANGED
@@ -617,14 +617,16 @@ class DEFT2021(datasets.GeneratorBasedBuilder):
|
|
617 |
|
618 |
for h in hf_split:
|
619 |
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
|
|
|
|
628 |
|
629 |
if split == "train":
|
630 |
allowed_ids = list(train)
|
|
|
617 |
|
618 |
for h in hf_split:
|
619 |
|
620 |
+
if len(h['tokens']) > 0 and len(h['ner_tags']) > 0:
|
621 |
+
|
622 |
+
all_res.append({
|
623 |
+
"id": str(key),
|
624 |
+
"document_id": h['document_id'],
|
625 |
+
"tokens": h['tokens'],
|
626 |
+
"ner_tags": h['ner_tags'],
|
627 |
+
})
|
628 |
+
|
629 |
+
key += 1
|
630 |
|
631 |
if split == "train":
|
632 |
allowed_ids = list(train)
|