docstr: Method to read metadata or similarity files. Expects at least 2 columns for metadata file (item metadata or
  item metadata score) and 3 columns for similarity files (item item similarity)
  
  :return: Dictionary with file information
  :rtype: dict
docstr_tok: ["Method","to","read","metadata","or","similarity","files",".","Expects","at","least","2","columns","for","metadata","file","(","item","metadata","or","item","metadata","score",")","and","3","columns","for","similarity","files","(","item","item","similarity",")",":","return",":","Dictionary","with","file","information",":","rtype",":","dict"]
code: def read_metadata_or_similarity(self):
      """
      Method to read metadata or similarity files. Expects at least 2 columns for metadata file (item metadata or
      item metadata score) and 3 columns for similarity files (item item similarity)
  
      :return: Dictionary with file information
      :rtype: dict
      """
  
      dict_values = {}
      list_col_1 = set()
      list_col_2 = set()
      mean_value = 0
      number_interactions = 0
  
      with open(self.input_file) as infile:
          for line in infile:
              if line.strip():
                  inline = line.split(self.sep)
  
                  if len(inline) == 1:
                      raise TypeError(
                          "Error: Space type (sep) is invalid!"
                      )
  
                  if len(inline) == 2:
                      attr1, attr2 = int(inline[0]), inline[1]
                      dict_values.setdefault(attr1, {}).update(
                          {attr2: 1.0}
                      )
                      list_col_1.add(attr1)
                      list_col_2.add(attr2)
                      number_interactions += 1
                  else:
                      attr1, attr2, value = (
                          int(inline[0]),
                          inline[1],
                          float(inline[2]),
                      )
                      dict_values.setdefault(attr1, {}).update(
                          {attr2: 1.0 if self.as_binary else value}
                      )
                      list_col_1.add(attr1)
                      list_col_2.add(attr2)
                      mean_value += value
                      number_interactions += 1
  
      dict_file = {
          "dict": dict_values,
          "col_1": list(list_col_1),
          "col_2": list(list_col_2),
          "mean_value": mean_value,
          "number_interactions": number_interactions,
      }
  
      return dict_file
  
file_path: CaseRecommender/caserec/utils/process_data.py
imports: import pandas
  from caserec.utils.extra_functions import check_error_file
label_desc: Use image node_id 3 for calling the ReadFile obj's underlying member method code with example usage: obj.read_metadata_or_similarity() and returns: dict_file