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.vocab.to_indices(bpe_tokens)
  
file_path: PaddleHub/modules/text/machine_translation/transformer/en-de/module.py
imports: import os
  from typing import List
  import paddle
  import paddle.nn
  from paddlehub.env import MODULE_HOME
  from paddlehub.module.module import moduleinfo, serving
  import paddlenlp
  from paddlenlp.data import Pad, Vocab
  from paddlenlp.transformers import InferTransformerModel, position_encoding_init
  from transformer_en_de.utils import MTTokenizer, post_process_seq
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