code: def encode(self, labels):
      if type(labels) == list:
          return [self.encode(label) for label in labels]
      label = labels  # label is a string
      if label not in self.label2index:
          index = self.vocab_size
          self.label2index[label] = index
          self.index2label[index] = label
          self.vocab_size += 1
          return index
      else:
          return self.label2index[label]
  
file_path: underthesea/underthesea/datasets/uit_absa_restaurant/uit_absa_restaurant.py
imports: from os.path import join
  import re
  from underthesea.data_fetcher import DataFetcher
  from underthesea.file_utils import DATASETS_FOLDER
label_desc: Use image node_id 2 for calling the LabelEncoder obj's underlying member method code with example usage: obj.encode(labels) and returns: unknown, index, self