code: def conll2003_to_df(filepath, encoding="latin1"):
      # read data and convert to dataframe
      sents, words, tags = [], [], []
      sent_id = 0
      docstart = False
      with open(filepath, encoding=encoding) as f:
          for line in f:
              line = line.rstrip()
              if line:
                  if line.startswith("-DOCSTART-"):
                      docstart = True
                      continue
                  else:
                      docstart = False
                      parts = line.split()
                      words.append(parts[0])
                      tags.append(parts[-1])
                      sents.append(sent_id)
              else:
                  if not docstart:
                      sent_id += 1
      df = pd.DataFrame(
          {SENT_COL: sents, WORD_COL: words, TAG_COL: tags}
      )
      df = df.fillna(method="ffill")
      return df
  
imports: from ...None import utils
  from ...imports import *
  from ...preprocessor import Preprocessor
  from ..None import preprocessor
  from ..None import textutils
label_desc: Use image node_id 2 for calling a global function with example usage: conll2003_to_df(filepath, encoding) and returns: df