code: def encode_onehot(dataset, labels):
      """Provides a mapping from string labels to integer indices."""
      label_index = {
          "cora": {
              "Case_Based": 0,
              "Genetic_Algorithms": 1,
              "Neural_Networks": 2,
              "Probabilistic_Methods": 3,
              "Reinforcement_Learning": 4,
              "Rule_Learning": 5,
              "Theory": 6,
          },
          "citeseer": {
              "AI": 0,
              "IR": 1,
              "HCI": 2,
              "DB": 3,
              "ML": 4,
              "Agents": 5,
          },
      }
  
      # Convert to onehot label
      num_classes = len(label_index[dataset])
      onehot_labels = np.zeros((len(labels), num_classes))
      idx = 0
      for s in labels:
          onehot_labels[idx, label_index[dataset][s]] = 1
          idx += 1
      return onehot_labels
  
file_path: neural-structured-learning/research/gnn-survey/utils.py
imports: import os
  from models import GAT
  from models import GCN
  from models import GIN
  import numpy
  import scipy.sparse
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: encode_onehot(dataset, labels) and returns: onehot_labels