class_docstr: A field that conducts tokenization and numericalization over each token rather the sequence.
  
  This is customized for models requiring character/subword-level inputs, e.g., CharLSTM and BERT.
  
  Args:
      fix_len (int):
          A fixed length that all subword pieces will be padded to.
          This is used for truncating the subword pieces that exceed the length.
          To save the memory, the final length will be the smaller value
          between the max length of subword pieces in a batch and `fix_len`.
  
  Examples:
      >>> from transformers import AutoTokenizer
      >>> tokenizer = AutoTokenizer.from_pretrained('bert-base-cased')
      >>> field = SubwordField('bert',
                               pad=tokenizer.pad_token,
                               unk=tokenizer.unk_token,
                               bos=tokenizer.cls_token,
                               eos=tokenizer.sep_token,
                               fix_len=20,
                               tokenize=tokenizer.tokenize)
      >>> field.vocab = tokenizer.get_vocab()  # no need to re-build the vocab
      >>> field.transform([['This', 'field', 'performs', 'token-level', 'tokenization']])[0]
      tensor([[  101,     0,     0],
              [ 1188,     0,     0],
              [ 1768,     0,     0],
              [10383,     0,     0],
              [22559,   118,  1634],
              [22559,  2734,     0],
              [  102,     0,     0]])
class_docstr_tok: ["A","field","that","conducts","tokenization","and","numericalization","over","each","token","rather","the","sequence",".","This","is","customized","for","models","requiring","character\/subword-level","inputs",",","e.g.",",","CharLSTM","and","BERT",".","Args",":","fix_len","(","int",")",":","A","fixed","length","that","all","subword","pieces","will","be","padded","to",".","This","is","used","for","truncating","the","subword","pieces","that","exceed","the","length",".","To","save","the","memory",",","the","final","length","will","be","the","smaller","value","between","the","max","length","of","subword","pieces","in","a","batch","and","`","fix_len","`",".","Examples",":",">",">",">","from","transformers","import","AutoTokenizer",">",">",">","tokenizer","=","AutoTokenizer.from_pretrained","(","'bert-base-cased","'",")",">",">",">","field","=","SubwordField","(","'bert","'",",","pad=tokenizer.pad_token",",","unk=tokenizer.unk_token",",","bos=tokenizer.cls_token",",","eos=tokenizer.sep_token",",","fix_len=20",",","tokenize=tokenizer.tokenize",")",">",">",">","field.vocab","=","tokenizer.get_vocab","(",")","#","no","need","to","re-build","the","vocab",">",">",">","field.transform","(","[","[","'This","'",",","'field","'",",","'performs","'",",","'token-level","'",",","'tokenization","'","]","]",")","[","0","]","tensor","(","[","[","101",",","0",",","0","]",",","[","1188",",","0",",","0","]",",","[","1768",",","0",",","0","]",",","[","10383",",","0",",","0","]",",","[","22559",",","118",",","1634","]",",","[","22559",",","2734",",","0","]",",","[","102",",","0",",","0","]","]",")"]
code: def build(self, dataset, min_freq=1, embed=None):
      if hasattr(self, "vocab"):
          return
      sequences = getattr(dataset, self.name)
      counter = Counter(
          piece
          for seq in sequences
          for token in seq
          for piece in self.preprocess(token)
      )
      self.vocab = Vocab(
          counter, min_freq, self.specials, self.unk_index
      )
  
      if not embed:
          self.embed = None
      else:
          tokens = self.preprocess(embed.tokens)
          # if the `unk` token has existed in the pretrained,
          # then replace it with a self-defined one
          if embed.unk:
              tokens[embed.unk_index] = self.unk
  
          self.vocab.extend(tokens)
          self.embed = torch.zeros(len(self.vocab), embed.dim)
          self.embed[self.vocab[tokens]] = embed.vectors
  
imports: from collections import Counter
  import torch
  from underthesea.utils.sp_fn import pad
  from underthesea.utils.sp_vocab import Vocab
label_desc: Use image node_id 2 for calling the SubwordField obj's underlying member method code with example usage: obj.build(dataset, min_freq, embed) without return types