code: def _get_wikiid_wikiname_dict(self, base_folder):
      # collect all wikiids
      wikiid_set = set()
      for data_file in [
          "aida_conll_testa",
          "aida_conll_testb",
          "aida_conll_train",
      ]:
          with open(base_folder / data_file, encoding="utf-8") as read:
              line = read.readline()
              while line:
                  row = line.split("\t")
                  if len(row) > 4:  # line has a wiki annotation
                      wikiid_set.add(row[5].strip())
                  line = read.readline()
  
      # create the dictionary
      wikiid_wikiname_dict = {}
      wikiid_list = list(wikiid_set)
      ids = ""
      length = len(wikiid_list)
  
      for i in range(length):
          if (
              i + 1
          ) % 50 == 0 or i == length - 1:  # there is a limit to the number of ids in one request in the wikimedia api
              ids += wikiid_list[i]
              # request
              resp = requests.get(
                  "https://en.wikipedia.org/w/api.php",
                  params={
                      "action": "query",
                      "prop": "info",
                      "pageids": ids,
                      "format": "json",
                  },
              ).json()
  
              for wikiid in resp["query"]["pages"]:
                  try:
                      wikiname = resp["query"]["pages"][wikiid][
                          "title"
                      ].replace(" ", "_")
                  except KeyError:  # bad wikiid
                      wikiname = "O"
                  wikiid_wikiname_dict[wikiid] = wikiname
              ids = ""
  
          else:
              ids += wikiid_list[i]
              ids += "|"
  
      return wikiid_wikiname_dict
  
imports: import csv
  import logging
  import os
  from pathlib import Path
  from typing import Dict, List, Optional, Union
  import requests
  import flair
  from flair.data import Corpus, MultiCorpus, Sentence
  from flair.datasets.sequence_labeling import ColumnCorpus, MultiFileColumnCorpus
  from flair.file_utils import cached_path, unpack_file
  from flair.splitter import SegtokSentenceSplitter, SentenceSplitter
label_desc: Use image node_id 2 for calling the NEL_ENGLISH_AIDA obj's underlying member method code with example usage: obj._get_wikiid_wikiname_dict(base_folder) and returns: wikiid_wikiname_dict