code: def load_training_data(args, pretrain):
      train_docs = []
      for train_file in args["train_file"].split(";"):
          logger.info("Reading %s" % train_file)
          # train_data is now a list of sentences, where each sentence is a
          # list of words, in which each word is a dict of conll attributes
          train_file_data, _, _ = CoNLL.conll2dict(
              input_file=train_file
          )
          logger.info(
              "Train File {}, Data Size: {}".format(
                  train_file, len(train_file_data)
              )
          )
          train_docs.append(Document(train_file_data))
      # we want to ensure that the model is able te output _ for empty columns,
      # but create batches whereby if a doc has upos/xpos tags we include them all.
      # therefore, we create seperate datasets and loaders for each input training file,
      # which will ensure the system be able to see batches with both upos available
      # and upos unavailable depending on what the availability in the file is.
      vocab = Dataset.init_vocab(train_docs, args)
      train_data = [
          Dataset(i, args, pretrain, vocab=vocab, evaluation=False)
          for i in train_docs
      ]
      # here we make sure the model will learn to output _ for empty columns
      # if *any* dataset has data for the upos, xpos, or feature column,
      # we consider that data enough to train the model on that column
      # otherwise, we want to train the model to always output blanks
      if not any(td.has_upos for td in train_data):
          for td in train_data:
              td.has_upos = True
      if not any(td.has_xpos for td in train_data):
          for td in train_data:
              td.has_xpos = True
      if not any(td.has_feats for td in train_data):
          for td in train_data:
              td.has_feats = True
      # calculate the batches
      train_batches = ShuffledDataset(train_data, args["batch_size"])
      return vocab, train_data, train_batches
  
imports: import sys
  import os
  import shutil
  import time
  from datetime import datetime
  import argparse
  import logging
  import numpy
  import random
  import torch
  from torch import nn, optim
  import stanza.models.pos.data
  from stanza.models.pos.data import Dataset, ShuffledDataset
  from stanza.models.pos.trainer import Trainer
  from stanza.models.pos import scorer
  from stanza.models.common import utils
  from stanza.models.common import pretrain
  from stanza.models.common.data import augment_punct
  from stanza.models.common.doc import *
  from stanza.models.common.foundation_cache import FoundationCache
  from stanza.utils.conll import CoNLL
  from stanza.models import _training_logging
label_desc: Use image node_id 8 for calling a global function with example usage: load_training_data(args, pretrain) and returns: vocab,  train_data,  train_batches