class_docstr: Compiles the results of Wizard of Internet crowdsourcing task into a json dataset.
class_docstr_tok: ["Compiles","the","results","of","Wizard","of","Internet","crowdsourcing","task","into","a","json","dataset","."]
code: def compile_results(self) -> Dict[str, Dict[str, Union[dict, str]]]:
      logging.info("Retrieving task data from Mephisto.")
      task_units_data = self.get_task_data()
      logging.info(
          f"Data for {len(task_units_data)} units loaded successfully."
      )
  
      results = dict()
      for work_unit in task_units_data:
          assignment_id = work_unit["assignment_id"]
  
          data = work_unit["data"]
          agent_name = data["agent_name"]
          if agent_name == "Wizard":
              # Only collecting Wizard side data. Because it contains
              # data that is needed from the apprentice side too.
              formatted_chat_data = self.format_chat_data(
                  data["messages"]
              )
              results[assignment_id] = formatted_chat_data
  
      logging.info(f"{len(results)} dialogues compiled.")
      return results
  
imports: from typing import Dict, Union
  import parlai.utils.logging
  from parlai.crowdsourcing.projects.wizard_of_internet.wizard_internet_blueprint import WIZARD_INTERNET_PARLAICHAT_BLUEPRINT
  from parlai.crowdsourcing.utils.analysis import AbstractResultsCompiler
  from mephisto.abstractions.blueprint import AgentState
label_desc: Use image node_id 3 for calling the WizardOfInternetResultsCompiler obj's underlying member method code with example usage: obj.compile_results() and returns: results