class_docstr: KGNN-LS is a knowledge-based recommendation model.
  KGNN-LS transforms the knowledge graph into a user-specific weighted graph and then apply a graph neural network to
  compute personalized item embeddings. To provide better inductive bias, KGNN-LS relies on label smoothness
  assumption, which posits that adjacent items in the knowledge graph are likely to have similar user relevance
  labels/scores. Label smoothness provides regularization over the edge weights and it is equivalent  to a label
  propagation scheme on a graph.
docstr: Get interaction_table that is used for fetching user-item interaction label in LS regularization.
  
  Args:
      user_id(torch.Tensor): the user id in user-item interactions, shape: [n_interactions, 1]
      item_id(torch.Tensor): the item id in user-item interactions, shape: [n_interactions, 1]
      y(torch.Tensor): the label in user-item interactions, shape: [n_interactions, 1]
  
  Returns:
      tuple:
          - interaction_table(dict): key: user_id * 10^offset + item_id; value: y_{user_id, item_id}
          - offset(int): The offset that is used for calculating the key(index) in interaction_table
docstr_tok: ["Get","interaction_table","that","is","used","for","fetching","user-item","interaction","label","in","LS","regularization",".","Args",":","user_id","(","torch.Tensor",")",":","the","user","id","in","user-item","interactions",",","shape",":","[","n_interactions",",","1","]","item_id","(","torch.Tensor",")",":","the","item","id","in","user-item","interactions",",","shape",":","[","n_interactions",",","1","]","y","(","torch.Tensor",")",":","the","label","in","user-item","interactions",",","shape",":","[","n_interactions",",","1","]","Returns",":","tuple",":","-","interaction_table","(","dict",")",":","key",":","user_id","*","10^offset","+","item_id",";","value",":","y_","{","user_id",",","item_id","}","-","offset","(","int",")",":","The","offset","that","is","used","for","calculating","the","key","(","index",")","in","interaction_table"]
code: def get_interaction_table(self, user_id, item_id, y):
      r"""Get interaction_table that is used for fetching user-item interaction label in LS regularization.
  
      Args:
          user_id(torch.Tensor): the user id in user-item interactions, shape: [n_interactions, 1]
          item_id(torch.Tensor): the item id in user-item interactions, shape: [n_interactions, 1]
          y(torch.Tensor): the label in user-item interactions, shape: [n_interactions, 1]
  
      Returns:
          tuple:
              - interaction_table(dict): key: user_id * 10^offset + item_id; value: y_{user_id, item_id}
              - offset(int): The offset that is used for calculating the key(index) in interaction_table
      """
      offset = len(str(self.n_entities))
      offset = 10**offset
      keys = user_id * offset + item_id
      keys = keys.int().cpu().numpy().tolist()
      values = y.float().cpu().numpy().tolist()
  
      interaction_table = dict(zip(keys, values))
      return interaction_table, offset
  
imports: import random
  import numpy
  import torch
  import torch.nn
  from recbole.model.abstract_recommender import KnowledgeRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.loss import EmbLoss
  from recbole.utils import InputType
label_desc: Use image node_id 2 for calling the KGNNLS obj's underlying member method code with example usage: obj.get_interaction_table(user_id, item_id, y) and returns: interaction_table,  offset