code: def read_examples_from_file(
      self, data_dir, mode: Union[Split, str]
  ) -> List[InputExample]:
      if isinstance(mode, Split):
          mode = mode.value
      file_path = os.path.join(data_dir, f"{mode}.txt")
      guid_index = 1
      examples = []
  
      with open(file_path, encoding="utf-8") as f:
          for sentence in parse_incr(f):
              words = []
              labels = []
              for token in sentence:
                  words.append(token["form"])
                  labels.append(token["upos"])
              assert len(words) == len(labels)
              if words:
                  examples.append(
                      InputExample(
                          guid=f"{mode}-{guid_index}",
                          words=words,
                          labels=labels,
                      )
                  )
                  guid_index += 1
      return examples
  
file_path: underthesea/examples/ner/tasks.py
imports: import logging
  import os
  from typing import List, TextIO, Union
  from conllu import parse_incr
  from utils_ner import InputExample, Split, TokenClassificationTask
label_desc: Use image node_id 1 for calling the POS obj's underlying member method code with example usage: obj.read_examples_from_file(data_dir, mode) and returns: examples