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: For the given ConvAI2 conversation, return strings of both speakers' personas.
code: def _extract_personas(
      self, episode_idx: str
  ) -> Tuple[List[str], List[str]]:
      """
      For the given ConvAI2 conversation, return strings of both speakers' personas.
      """
      first_entry = self.convai2_teacher.get(episode_idx, entry_idx=0)
      first_text_strings = first_entry["text"].split("\n")
      persona_1_strings = []
      persona_2_strings = []
      for str_ in first_text_strings[
          :-1
      ]:  # The last string is the first utterance
          if str_.startswith(
              "your persona: "
          ):  # Here, "you" are Person 2
              persona_2_strings.append(str_[len("your persona: ") :])
          elif str_.startswith("partner's persona: "):
              persona_1_strings.append(
                  str_[len("partner's persona: ") :]
              )
          else:
              raise ValueError("Persona string cannot be parsed!")
      return persona_1_strings, persona_2_strings
  
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 5 for calling the ContextGenerator obj's underlying member method code with example usage: obj._extract_personas(episode_idx) and returns: persona_1_strings,  persona_2_strings