class_docstr: Bert4Rec data pre-processer to get the masked sequences for each user
  
  Args:
      raw_data (pd.DataFrame): the raw dataframe
      min_rating (int): minimum valid rating
      min_uc (int): minimum user ratings count
      min_sc (int): minimum item count for each valid use
      name (str): dataset for experiment, current support ml-1m, ml-20m, random
      max_len (int): max length of the Bert embedding dimensio
      mask_prob (float): probability of the mask
      dupe_factor (int): number of duplication while generating the random masked seqs
  
  Returns:
      Dict[str, Any]
  
  Example::
  
      raw_data = get_raw_dataframe(
          "random", 5, 40, 200, 4, None
      )
      df = Bert4RecPreprocsser(
          raw_data,
          4,
          5,
          0,
          "random",
          4,
          0.2,
          1,
      ).get_processed_dataframes()
class_docstr_tok: ["Bert4Rec","data","pre-processer","to","get","the","masked","sequences","for","each","user","Args",":","raw_data","(","pd.DataFrame",")",":","the","raw","dataframe","min_rating","(","int",")",":","minimum","valid","rating","min_uc","(","int",")",":","minimum","user","ratings","count","min_sc","(","int",")",":","minimum","item","count","for","each","valid","use","name","(","str",")",":","dataset","for","experiment",",","current","support","ml-1m",",","ml-20m",",","random","max_len","(","int",")",":","max","length","of","the","Bert","embedding","dimensio","mask_prob","(","float",")",":","probability","of","the","mask","dupe_factor","(","int",")",":","number","of","duplication","while","generating","the","random","masked","seqs","Returns",":","Dict","[","str",",","Any","]","Example",":",":","raw_data","=","get_raw_dataframe","(","``","random","''",",","5",",","40",",","200",",","4",",","None",")","df","=","Bert4RecPreprocsser","(","raw_data",",","4",",","5",",","0",",","``","random","''",",","4",",","0.2",",","1",",",")",".get_processed_dataframes","(",")"]
code: def _densify_index(
      self, df: pd.DataFrame
  ) -> Tuple[pd.DataFrame, Dict[int, int], Dict[int, int]]:
      print("Densifying index")
      umap = {u: i for i, u in enumerate(set(df["uid"]))}
      smap = {s: i + 1 for i, s in enumerate(set(df["sid"]))}
      df["uid"] = df["uid"].map(umap)
      df["sid"] = df["sid"].map(smap)
      return df, umap, smap
  
imports: import random
  from collections import Counter
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  import pandas
label_desc: Use image node_id 5 for calling the Bert4RecPreprocsser obj's underlying member method code with example usage: obj._densify_index(df) and returns: df,  umap,  smap