code: def text_to_i(self, text: str) -> torch.Tensor:
      tokens = self.tokenizer(text)
      return torch.tensor(
          [self.stoi[s] for s in tokens if s in self.stoi],
          dtype=torch.long,
      )
  
imports: import random
  from pathlib import PurePath, Path
  from typing import List, Callable, Dict, Optional
  import torch
  from torch.utils.data import IterableDataset, Dataset
  from labml import monit
  from labml.utils.download import download_file
label_desc: Use image node_id 3 for calling the TextDataset obj's underlying member method code with example usage: obj.text_to_i(text) and returns: torch