docstr: Updates summary table with values associated with the saved click.
docstr_tok: ["Updates","summary","table","with","values","associated","with","the","saved","click","."]
code: def get_summary_table(
      self, saved_click: pd.DataFrame
  ) -> Dict[str, Union[str, int]]:
      """Updates summary table with values associated with the saved click."""
      selected_sentence = saved_click["sentence"]
      cols = ["span1", "span2", "acc", "pred", "target"]
      models_sentence_df = {}
      for model_id, model_name in zip(self.model_ids, self.model_names):
          sentence_df = self.map_model_to_df[model_id]
          sentence_df = sentence_df[
              sentence_df["sentence"] == selected_sentence
          ]
          sentence_df = sentence_df[cols]
          sentence_df = sentence_df.drop_duplicates()
          sentence_df.columns = [
              "span1",
              "span2",
              f"acc: {model_name}",
              f"pred: {model_name}",
              f"target: {model_name}",
          ]
          models_sentence_df[model_id] = sentence_df
  
      if self.mode == "normal":
          sentence_df = models_sentence_df["model1"]
      elif self.mode == "compare":
          sentence_df = models_sentence_df["model1"].merge(
              models_sentence_df["model2"], on=["span1", "span2"]
          )
          sentence_df = sentence_df.drop(
              f"target: {self.map_model_id_to_name['model2']}",
              axis="columns",
          )
      sentence_df = sentence_df.rename(
          {f"target: {self.map_model_id_to_name['model1']}": "target"},
          axis="columns",
      )
      cols = [
          "span1",
          "span2",
          "target",
          f"pred: {self.map_model_id_to_name['model1']}",
          f"acc: {self.map_model_id_to_name['model1']}",
      ]
  
      if self.mode == "compare":
          cols += [
              f"pred: {self.map_model_id_to_name['model2']}",
              f"acc: {self.map_model_id_to_name['model2']}",
          ]
  
      sentence_df = sentence_df[cols]
      return sentence_df.to_dict("records")
  
imports: from typing import List, Tuple, Dict, Union
  from abc import ABC, abstractmethod
  import torch
  import pandas
  import numpy
label_desc: Use image node_id 11 for calling the WSCTask obj's underlying member method code with example usage: obj.get_summary_table(saved_click) and returns: sentence_df