class_docstr: Generates contexts shown to crowdsourced workers when collecting BST conversations.
  
  This generator was used to generate the context information shown to workers at the
  beginning of a conversation, when crowdsourcing the conversations that make up the
  BST dataset.
class_docstr_tok: ["Generates","contexts","shown","to","crowdsourced","workers","when","collecting","BST","conversations",".","This","generator","was","used","to","generate","the","context","information","shown","to","workers","at","the","beginning","of","a","conversation",",","when","crowdsourcing","the","conversations","that","make","up","the","BST","dataset","."]
docstr: Create a map from ConvAI2 personas to WoW topics that they correspond to.
code: def _setup_personas_to_topics(self) -> Dict[str, List[str]]:
      """
      Create a map from ConvAI2 personas to WoW topics that they correspond to.
      """
  
      print("Starting to map personas to topics.")
  
      persona_strings_to_topics = defaultdict(list)
      with PathManager.open(self.topic_to_persona_path, "r") as f:
          for line in f:
              match = re.fullmatch(r"([^[]+): (\[.+\])\n", line)
              topic = match.group(1)
              if topic not in self.wow_topics_to_episode_idxes:
                  continue
              persona_strings = eval(match.group(2))
              assert isinstance(persona_strings, list)
              for str_ in persona_strings:
                  persona_strings_to_topics[str_].append(topic)
  
      print("Finished mapping personas to topics.")
  
      return persona_strings_to_topics
  
imports: import copy
  import os
  import random
  import re
  from collections import defaultdict
  from typing import List, Optional, Dict, Tuple
  from parlai.core.opt import Opt
  from parlai.core.teachers import ParlAIDialogTeacher, create_task_agent_from_taskname
  from parlai.tasks.convai2.agents import BothTeacher
  from parlai.tasks.empathetic_dialogues.agents import EmpatheticDialoguesTeacher
  from parlai.tasks.wizard_of_wikipedia.agents import WizardDialogKnowledgeTeacher
  from parlai.utils.misc import warn_once
  from parlai.utils.io import PathManager
  from .build import build
label_desc: Use image node_id 3 for calling the ContextGenerator obj's underlying member method code with example usage: obj._setup_personas_to_topics() and returns: persona_strings_to_topics