qanastek commited on
Commit
52ce6c8
1 Parent(s): c6056e2

Update DEFT2021.py

Browse files
Files changed (1) hide show
  1. DEFT2021.py +10 -8
DEFT2021.py CHANGED
@@ -617,14 +617,16 @@ class DEFT2021(datasets.GeneratorBasedBuilder):
617
 
618
  for h in hf_split:
619
 
620
- all_res.append({
621
- "id": str(key),
622
- "document_id": h['document_id'],
623
- "tokens": h['tokens'],
624
- "ner_tags": h['ner_tags'],
625
- })
626
-
627
- key += 1
 
 
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)