class_docstr: This is a classification model that selects the best heteronym option out of possible dictionary entries.
  Supports only heteronyms, no OOV.
docstr: Lightning calls this inside the training loop with the data from the training dataloader
  passed in as `batch`.
docstr_tok: ["Lightning","calls","this","inside","the","training","loop","with","the","data","from","the","training","dataloader","passed","in","as","`","batch","`","."]
code: def training_step(self, batch, batch_idx):
      """
      Lightning calls this inside the training loop with the data from the training dataloader
      passed in as `batch`.
      """
  
      loss, logits = self.make_step(batch)
      self.log("train_loss", loss)
      return loss
  
imports: import json
  import os
  from typing import List, Optional
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import CrossEntropyLoss
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.modules.common import TokenClassifier
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.collections.tts.g2p.data.heteronym_classification import HeteronymClassificationDataset
  from nemo.collections.tts.g2p.utils import get_heteronym_spans, get_wordid_to_phonemes, read_wordids
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the HeteronymClassificationModel obj's underlying member method code with example usage: obj.training_step(batch, batch_idx) and returns: loss