class_docstr: Term Frequency - Inverse Document Frequency (TF-IDF) Recommender
  
  This class provides content-based recommendations using TF-IDF vectorization in combination with cosine similarity.
docstr: Return the top k recommendations with useful metadata for each recommendation.
  
  Args:
      metadata (pandas.DataFrame): Dataframe holding metadata for all public domain papers.
      query_id (str): ID of item of interest.
      cols_to_keep (list of str): List of columns from the metadata dataframe to include
          (e.g., ['title','authors','journal','publish_time','url']).
          By default, all columns are kept.
      verbose (boolean): Set to True if you want to print the table.
  
  Returns:
      pandas.Styler: Stylized dataframe holding recommendations and associated metadata just for the item of interest (can access as normal dataframe by using df.data).
docstr_tok: ["Return","the","top","k","recommendations","with","useful","metadata","for","each","recommendation",".","Args",":","metadata","(","pandas.DataFrame",")",":","Dataframe","holding","metadata","for","all","public","domain","papers",".","query_id","(","str",")",":","ID","of","item","of","interest",".","cols_to_keep","(","list","of","str",")",":","List","of","columns","from","the","metadata","dataframe","to","include","(","e.g.",",","[","'title","'",",","'authors","'",",","'journal","'",",","'publish_time","'",",","'url","'","]",")",".","By","default",",","all","columns","are","kept",".","verbose","(","boolean",")",":","Set","to","True","if","you","want","to","print","the","table",".","Returns",":","pandas.Styler",":","Stylized","dataframe","holding","recommendations","and","associated","metadata","just","for","the","item","of","interest","(","can","access","as","normal","dataframe","by","using","df.data",")","."]
code: def get_top_k_recommendations(
      self, metadata, query_id, cols_to_keep=[], verbose=True
  ):
      """Return the top k recommendations with useful metadata for each recommendation.
  
      Args:
          metadata (pandas.DataFrame): Dataframe holding metadata for all public domain papers.
          query_id (str): ID of item of interest.
          cols_to_keep (list of str): List of columns from the metadata dataframe to include
              (e.g., ['title','authors','journal','publish_time','url']).
              By default, all columns are kept.
          verbose (boolean): Set to True if you want to print the table.
  
      Returns:
          pandas.Styler: Stylized dataframe holding recommendations and associated metadata just for the item of interest (can access as normal dataframe by using df.data).
      """
  
      # Create subset of dataframe with just recommendations for the item of interest
      df = self.top_k_recommendations.loc[
          self.top_k_recommendations[self.id_col] == query_id
      ].reset_index()
  
      # Remove id_col of query item
      df.drop([self.id_col], axis=1, inplace=True)
  
      # Add metadata for each recommended item (rec_<id_col>)
      metadata_cols = metadata.columns.values
      df[metadata_cols] = df.apply(
          lambda row: self.__get_single_item_info(
              metadata, row["rec_" + self.id_col]
          ),
          axis=1,
      )
  
      # Remove id col added from metadata (already present from self.top_k_recommendations)
      df.drop([self.id_col], axis=1, inplace=True)
  
      # Rename columns such that rec_ is no longer appended, for simplicity
      df = df.rename(
          columns={"rec_rank": "rank", "rec_score": "similarity_score"}
      )
  
      # Only keep columns of interest
      if len(cols_to_keep) > 0:
          # Insert our recommendation scoring/ranking columns
          cols_to_keep.insert(0, "similarity_score")
          cols_to_keep.insert(0, "rank")
          df = df[cols_to_keep]
  
      # Make URLs clickable if they exist
      if "url" in list(map(lambda x: x.lower(), metadata_cols)):
          format_ = {"url": self.__make_clickable}
          df = df.head().style.format(format_)
  
      if verbose:
          df
  
      return df
  
imports: from sklearn.feature_extraction.text import TfidfVectorizer
  from sklearn.metrics.pairwise import linear_kernel
  from transformers import BertTokenizer
  import re
  import unicodedata
  import pandas
  import numpy
  import nltk
  from nltk.stem.porter import PorterStemmer
label_desc: Use image node_id 13 for calling the TfidfRecommender obj's underlying member method code with example usage: obj.get_top_k_recommendations(metadata, query_id, cols_to_keep, verbose) and returns: df