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 WoW topics to the indices of the WoW episodes that use them.
code: def _setup_topics_to_episodes(self) -> Dict[str, List[int]]:
      """
      Create a map from WoW topics to the indices of the WoW episodes that use them.
      """
  
      print("Starting to map topics to episodes.")
  
      topics_to_episodes = defaultdict(list)
      for episode_idx in range(self.wow_teacher.num_episodes()):
          topic = self.wow_teacher.get(episode_idx, entry_idx=0)[
              "chosen_topic"
          ]
          topics_to_episodes[topic].append(episode_idx)
  
      print("Finished mapping topics to episodes.")
  
      return topics_to_episodes
  
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 4 for calling the ContextGenerator obj's underlying member method code with example usage: obj._setup_topics_to_episodes() and returns: topics_to_episodes