text: 
  
  import pandas
  from sklearn.metrics import recall_score
  from sklearn.metrics import precision_score
  from sklearn.metrics import roc_auc_score
  
  
  '''
  用是非題的方式來評估檢索出來的結果。
  '''
  def summarize(table, threshold, method):
  
      label = table.iloc[0:1,:]['label'].item()
      path  = table.iloc[0:1,:]['path'].item()
      # table['target']     = 1 * (table['label'] == label)
      # table['score']      = table[method]
      table['prediction'] = 1 * (table["score"] > threshold)
      pass
      
      paper = {
          'path':[path],
          "label":[label],
          'method':[method],
          'threshold':[threshold],
          'recall':[recall_score(y_true=table['target'], y_pred=table['prediction'], labels=[1, 0])],
          "precision":[precision_score(y_true=table['target'], y_pred=table['prediction'], labels=[1, 0])],
          'auc':[roc_auc_score(y_score=table['score'], y_true=table['target'], labels=[1, 0])]
      }
      paper = pandas.DataFrame(paper)
      return(paper)
  
  
  def report(group):
  
      output = pandas.concat(group, axis=0)
      return(output)
  
  
  
  
  
  
  # def evaluate(comparison, threshold=0.4, title="L1"):
  
  #     label = comparison.iloc[0:1,:]['label'].item()
  #     link = comparison.iloc[0:1,:]['link'].item()
  #     comparison['Target'] = 1 * (comparison['label'] == label)    
  #     pass
  
  #     comparison['prediction'] = 1 * (comparison["score"] > threshold)
  #     # prediction = prediction.copy()
  #     # prediction.columns = "prediction({})".format(title)
  #     # data = pandas.concat([comparison, prediction],axis=1).iloc[1:,:].copy()
  #     # print(comparison)
  #     pass
      
  #     score = {
  #         'link':[link],
  #         "label":[label],
  #         'by':[title],
  #         'threshold':[threshold],
  #         'recall':[recall_score(y_true=comparison['Target'], y_pred=comparison['prediction'], labels=[1, 0])],
  #         "precision":[precision_score(y_true=comparison['Target'], y_pred=comparison['prediction'], labels=[1, 0])],
  #         'auc':[roc_auc_score(y_score=comparison['score'], y_true=comparison['Target'], labels=[1, 0])]
  #     }
  #     evaluation = pandas.DataFrame(score)
  #     pass
      
  #     return(evaluation)
          