class_docstr: Logs actions/observations in a world and saves in a given format.
class_docstr_tok: ["Logs","actions\/observations","in","a","world","and","saves","in","a","given","format","."]
code: def convert_to_labeled_data(self, episode):
      out = []
      text_lst = []
      for parley in episode:
          first_act, second_act = parley
          if "text" in first_act:
              text_lst.append(first_act["text"])
          if second_act.get("id") != "context":
              label = second_act.get("text")
              out.append(
                  {
                      "id": first_act.get("id", ""),
                      "text": "\n".join(text_lst),
                      "labels": [label],
                      "episode_done": False,
                  }
              )
              text_lst = []
      if len(out) > 0:
          out[-1]["episode_done"] = True
      return out
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.worlds import BatchWorld, DynamicBatchWorld
  from parlai.utils.misc import msg_to_str
  from parlai.utils.conversations import Conversations
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  from parlai.core.message import Message
  import copy
  from tqdm import tqdm
label_desc: Use image node_id 12 for calling the WorldLogger obj's underlying member method code with example usage: obj.convert_to_labeled_data(episode) and returns: out