class_docstr: Transformer model for machine translation.
class_docstr_tok: ["Transformer","model","for","machine","translation","."]
docstr: Convert input string to ids.
docstr_tok: ["Convert","input","string","to","ids","."]
code: def _convert_text_to_input(self, text: str):
      """
      Convert input string to ids.
      """
      bpe_tokens = self.tokenizer.tokenize(text)
      if len(bpe_tokens) > self.max_length:
          bpe_tokens = bpe_tokens[: self.max_length]
      return self.src_vocab.to_indices(bpe_tokens)
  
imports: import os
  from typing import List
  import paddle
  import paddle.nn
  from paddlenlp.data import Pad
  from paddlenlp.data import Vocab
  from paddlenlp.transformers import InferTransformerModel
  from paddlenlp.transformers import position_encoding_init
  from transformer_zh_en.utils import MTTokenizer
  from transformer_zh_en.utils import post_process_seq
  from paddlehub.env import MODULE_HOME
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import serving
label_desc: Use image node_id 3 for calling the MTTransformer obj's underlying member method code with example usage: obj._convert_text_to_input(text) and returns: self