code: def process(self, document):
      batch = DataLoader(
          document,
          self.config["batch_size"],
          self.config,
          vocab=self.vocab,
          evaluation=True,
      )
  
      # process the rest
      expansions = batch.doc.get_mwt_expansions(evaluation=True)
      if len(batch) > 0:
          dict_preds = self.trainer.predict_dict(expansions)
          # decide trainer type and run eval
          if self.config["dict_only"]:
              preds = dict_preds
          else:
              with torch.no_grad():
                  preds = []
                  for i, b in enumerate(batch):
                      preds += self.trainer.predict(b)
  
              if self.config.get("ensemble_dict", False):
                  preds = self.trainer.ensemble(expansions, preds)
      else:
          # skip eval if dev data does not exist
          preds = []
  
      batch.doc.set_mwt_expansions(preds, process_manual_expanded=False)
      return batch.doc
  
file_path: stanza/stanza/pipeline/mwt_processor.py
imports: import io
  import torch
  from stanza.models.mwt.data import DataLoader
  from stanza.models.mwt.trainer import Trainer
  from stanza.pipeline._constants import *
  from stanza.pipeline.processor import UDProcessor, register_processor
label_desc: Use image node_id 2 for calling the MWTProcessor obj's underlying member method code with example usage: obj.process(document) and returns: batch