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 _filter_ratings(self) -> pd.DataFrame:
      df = self.raw_data
      df.columns = ["uid", "sid", "rating", "timestamp"]
      df = df[df["rating"] >= self.min_rating]
      print("Filtering triplets")
      if self.min_sc > 0:
          item_sizes = df.groupby("sid").size()
          good_items = item_sizes.index[item_sizes >= self.min_sc]
          df = df[df["sid"].isin(good_items)]
  
      if self.min_uc > 0:
          user_sizes = df.groupby("uid").size()
          good_users = user_sizes.index[user_sizes >= self.min_uc]
          df = df[df["uid"].isin(good_users)]
  
      return df
  
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 4 for calling the Bert4RecPreprocsser obj's underlying member method code with example usage: obj._filter_ratings() and returns: df