class_docstr: Tensorizer for Cross-lingual LM tasks. Works for single sentence as well
  as sentence pair.
class_docstr_tok: ["Tensorizer","for","Cross-lingual","LM","tasks",".","Works","for","single","sentence","as","well","as","sentence","pair","."]
code: def get_lang_id(self, row: Dict, col: str) -> int:
      # generate lang embeddings. if training without lang embeddings, use
      # the first language as the lang_id (there will always be one lang)
      if self.use_language_embeddings:
          lang = row[col]
          assert (
              lang in self.lang2id
          ), f"language {lang} not supported in {row}"
          lang_id = self.lang2id[lang]
          return lang_id
      else:
          # use En as default
          return self.lang2id.get(self.default_language, 0)
  
imports: from typing import Any, Dict, List, Optional, Tuple
  import torch
  from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDictionary
  from pytext.common.constants import SpecialTokens
  from pytext.config.component import ComponentType, create_component
  from pytext.data.bert_tensorizer import BERTTensorizerBase, BERTTensorizerBaseScriptImpl, build_fairseq_vocab
  from pytext.data.tokenizers import Tokenizer
  from pytext.data.utils import Vocabulary
  from pytext.data.xlm_constants import LANG2ID_15
  from pytext.torchscript.utils import ScriptBatchInput
  from pytext.torchscript.vocab import ScriptVocabulary
  from pytext.utils.file_io import PathManager
  from pytext.utils.lazy import lazy_property
label_desc: Use image node_id 5 for calling the XLMTensorizer obj's underlying member method code with example usage: obj.get_lang_id(row, col) and returns: lang_id, self