For the last time I worked with WikiNER I wrote an own script that converts the dataset into a CoNLL-like format - you can find it here:

  
      github.com
  
  
    stefan-it/fine-tuned-berts-seq/blob/master/scripts/preprocess_wikiner.py 8
import sys

filename = sys.argv[1]


def parse_file(filename: str):
    with open(filename, "rt") as f_p:
        for line in f_p:
            line = line.rstrip()

            if not line:
                continue

            # Convert
            # L'|DET:ART|O Afghanistan|NAM|I-LOC a|VER:pres|O pour|PRP|O codes|NOM|O :|PUN|O
            # into CoNLL-like format:
            # token ner
            print(
                "\n".join(f"{' '.join(word.split('|')[::2])}" for word in line.split())
            )


  This file has been truncated. show original