class_docstr: Word tagging model. It can be used for any task that requires predicting the
  tag for a word/token. For example, the following tasks can be modeled as word
  tagging tasks. This is not an exhaustive list.
  1. Part of speech tagging.
  2. Named entity recognition.
  3. Slot filling for task oriented dialog.
  
  It can be instantiated just like any other :class:`~Model`.
code: def torchscriptify(self, tensorizers, traced_model):
      output_layer = self.output_layer.torchscript_predictions()
  
      input_vocab = tensorizers["tokens"].vocab
      max_seq_len = tensorizers["tokens"].max_seq_len or -1
      scripted_tokenizer: Optional[torch.jit.ScriptModule] = None
      try:
          scripted_tokenizer = tensorizers[
              "tokens"
          ].tokenizer.torchscriptify()
      except NotImplementedError:
          pass
      if scripted_tokenizer and isinstance(
          scripted_tokenizer, DoNothingTokenizer
      ):
          scripted_tokenizer = None
  
      """
          The input tensor packing memory is allocated/cached for different shapes,
          and max sequence length will help to reduce the number of different tensor
          shapes. We noticed that the TorchScript model could use 25G for offline
          inference on CPU without using max_seq_len.
          """
  
      class Model(torch.jit.ScriptModule):
          def __init__(self):
              super().__init__()
              self.vocab = ScriptVocabulary(
                  input_vocab,
                  input_vocab.get_unk_index(),
                  input_vocab.get_pad_index(),
              )
              self.model = traced_model
              self.output_layer = output_layer
              self.pad_idx = torch.jit.Attribute(
                  input_vocab.get_pad_index(), int
              )
              self.max_seq_len = torch.jit.Attribute(max_seq_len, int)
              self.tokenizer = scripted_tokenizer
  
          @torch.jit.script_method
          def forward(
              self,
              texts: Optional[List[str]] = None,
              multi_texts: Optional[List[List[str]]] = None,
              tokens: Optional[List[List[str]]] = None,
              languages: Optional[List[str]] = None,
          ):
              # PyTorch breaks with 2 'not None' checks right now.
              if texts is not None:
                  if tokens is not None:
                      raise RuntimeError(
                          "Can't set both tokens and texts"
                      )
                  if self.tokenizer is not None:
                      tokens = [
                          [t[0] for t in self.tokenizer.tokenize(text)]
                          for text in texts
                      ]
  
              if tokens is None:
                  raise RuntimeError("tokens is required")
  
              tokens = truncate_tokens(
                  tokens, self.max_seq_len, self.vocab.pad_token
              )
              seq_lens = make_sequence_lengths(tokens)
              word_ids = self.vocab.lookup_indices_2d(tokens)
              word_ids = pad_2d(word_ids, seq_lens, self.pad_idx)
              logits = self.model(
                  torch.tensor(word_ids), torch.tensor(seq_lens)
              )
              return self.output_layer(logits)
  
      return Model()
  
imports: from typing import List, Optional, Union
  import torch
  from pytext.common.constants import SpecialTokens
  from pytext.data.tensorizers import ByteTokenTensorizer, SlotLabelTensorizer, TokenTensorizer
  from pytext.data.tokenizers import DoNothingTokenizer
  from pytext.exporters.exporter import ModelExporter
  from pytext.models.decoders.mlp_decoder import MLPDecoder
  from pytext.models.embeddings import CharacterEmbedding, WordEmbedding
  from pytext.models.model import Model
  from pytext.models.module import create_module
  from pytext.models.output_layers import CRFOutputLayer, WordTaggingOutputLayer
  from pytext.models.representations.bilstm_slot_attn import BiLSTMSlotAttention
  from pytext.models.representations.biseqcnn import BSeqCNNRepresentation
  from pytext.models.representations.deepcnn import DeepCNNRepresentation
  from pytext.models.representations.pass_through import PassThroughRepresentation
  from pytext.torchscript.utils import make_byte_inputs, make_sequence_lengths, truncate_tokens
  from pytext.torchscript.vocab import ScriptVocabulary
  from pytext.utils.usage import log_class_usage
  from pytorch.text.fb.utils.transform_utils import pad_2d
label_desc: Use image node_id 10 for calling the WordTaggingModel obj's underlying member method code with example usage: obj.torchscriptify(tensorizers, traced_model) and returns: Model, self