code: def build_text_encoder(cls, args, src_dictionary):
      enc_emb = nn.Embedding(
          len(src_dictionary),
          args.encoder_embed_dim,
          src_dictionary.pad(),
      )
      model_args = cls.update_transformer_encoder_cfg(
          args,
          {
              "encoder_layers": args.text_encoder_layers,
              "max_source_positions": args.max_positions_text,
          },
      )
      text_encoder = TransformerEncoder(
          model_args, src_dictionary, enc_emb
      )
      return text_encoder
  
imports: import logging
  from collections import OrderedDict, namedtuple
  import torch.nn
  from fairseq import checkpoint_utils, utils
  from fairseq.checkpoint_utils import load_checkpoint_to_cpu
  from fairseq.file_io import PathManager
  from fairseq.models import register_model, register_model_architecture
  from fairseq.models.speech_to_text import SpeechWavTransformerEncoder, StackedSpeechWavTransformerEncoder, TransformerDecoder
  from fairseq.models.transformer import TransformerEncoder
  from .s2t_dualinputtransformer import DualInputEncoder, DualInputS2TTransformerModel, TransformerMultiInputDecoder
label_desc: Use image node_id 4 for calling the DualInputWavTransformerModel obj's underlying member method code with example usage: obj.build_text_encoder(cls, args, src_dictionary) and returns: text_encoder