class_docstr: Base class for CoNLL2002 problems.
class_docstr_tok: ["Base","class","for","CoNLL2002","problems","."]
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      del data_dir
  
      url = "https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/corpora/conll2002.zip"  # pylint: disable=line-too-long
      compressed_filename = os.path.basename(url)
      compressed_filepath = os.path.join(tmp_dir, compressed_filename)
      generator_utils.maybe_download(tmp_dir, compressed_filename, url)
  
      compressed_dir = compressed_filepath.strip(".zip")
  
      filenames = self.source_data_files(dataset_split)
      for filename in filenames:
          filepath = os.path.join(compressed_dir, filename)
          if not tf.gfile.Exists(filepath):
              with zipfile.ZipFile(
                  compressed_filepath, "r"
              ) as corpus_zip:
                  corpus_zip.extractall(tmp_dir)
          with tf.gfile.GFile(filepath, mode="r") as cur_file:
              words, tags = [], []
              for line in cur_file:
                  line_split = line.strip().split()
                  if not line_split:
                      yield {
                          "inputs": str.join(" ", words),
                          "targets": str.join(" ", tags),
                      }
                      words, tags = [], []
                      continue
                  words.append(line_split[0])
                  tags.append(line_split[2])
              if words:
                  yield {
                      "inputs": str.join(" ", words),
                      "targets": str.join(" ", tags),
                  }
  
file_path: tensor2tensor/tensor2tensor/data_generators/conll_ner.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import zipfile
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the Conll2002Ner obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) without return types