class_docstr: DataSource which loads data from CoNLL-U file.
class_docstr_tok: ["DataSource","which","loads","data","from","CoNLL-U","file","."]
docstr: Reads CoNLL-U file
docstr_tok: ["Reads","CoNLL-U","file"]
code: def _read_file(self, input_file):
      """Reads CoNLL-U file"""
      words, labels = [], []
      for line in input_file.readlines():
          tok = line.strip().split(self.delimiter)
          # skip comment and empty line, yield if we got a sentence
          # CoNLL-U file separates sentences with empty line
          if len(tok) < 2 or line[0] == "#":
              assert len(words) == len(labels)
              if words:
                  yield {
                      "text": words,
                      "label": labels,
                      "language": self.language,
                  }
                  words, labels = [], []
          elif tok[0].isdigit():
              word, pos = tok[1], tok[3]
              words.append(word)
              labels.append(pos)
      if len(words) == len(labels) and words:
          yield {
              "text": words,
              "label": labels,
              "language": self.language,
          }
  
file_path: pytext/pytext/data/sources/conllu.py
imports: import threading
  from typing import Dict, List, Optional, Type
  from pytext.data.sources.data_source import RootDataSource, SafeFileWrapper
label_desc: Use image node_id 3 for calling the CoNLLUPOSDataSource obj's underlying member method code with example usage: obj._read_file(input_file) without return types