code: def text_to_id(vocab, text: str, max_len):
      text = text.split()
      # to index
      ids = [vocab.to_index(word) for word in text]
      # padding
      ids += [vocab.padding_idx] * (max_len - len(text))
      return ids[:max_len]
  
imports: import os
  import sys
  import time
  from datasets import load_dataset
  from datasets import DatasetDict
  import jittor
  from jittor import nn, Module
  from jittor.dataset import Dataset
  from fastNLP.core.controllers.trainer import Trainer
  from fastNLP.core.metrics.accuracy import Accuracy
  from fastNLP.core.vocabulary import Vocabulary
  from fastNLP.core.callbacks.progress_callback import RichCallback
  from fastNLP.core.callbacks.callback import Callback
  from fastNLP.core.dataloaders.jittor_dataloader.fdl import JittorDataLoader
label_desc: Use image node_id 3 for calling a global function with example usage: text_to_id(vocab, text, max_len) and returns: ids