class_docstr: Interactive world for wizard of wikipedia.
  
  Used for models trained on the task `-t wizard_of_wikipedia`. Automatically
  retrieves knowledge from Wikipedia based on the conversation history using a TF-IDF
  retriever. Then uses a Transformer-based model to select a checked sentence from
  these retrieved passages.
class_docstr_tok: ["Interactive","world","for","wizard","of","wikipedia",".","Used","for","models","trained","on","the","task","`","-t","wizard_of_wikipedia","`",".","Automatically","retrieves","knowledge","from","Wikipedia","based","on","the","conversation","history","using","a","TF-IDF","retriever",".","Then","uses","a","Transformer-based","model","to","select","a","checked","sentence","from","these","retrieved","passages","."]
code: def _get_new_topic(self):
      random.seed()
      topics = random.sample(self.topic_list, self.num_topics - 1)
      topics.append(NO_TOPIC)
      letters = list(string.ascii_uppercase)[: self.num_topics]
      topic_list = {x: y for x, y in zip(letters, topics)}
      topic_text = "\n".join(
          ["{}: {}".format(k, v) for k, v in topic_list.items()]
      )
  
      done = False
      while not done:
          self.human_agent.observe(
              {
                  "text": "\nPlease choose one of the following topics by typing "
                  "A, B, C, ..., etc. : \n\n{}\n".format(topic_text)
              }
          )
          topic_act = self.human_agent.act()
          choice = topic_act["text"][0].upper()
          if choice in topic_list:
              done = True
          else:
              self.human_agent.observe(
                  {"text": "Invalid response, please try again."}
              )
  
      chosen_topic = topic_list[choice]
      print("[ Your chosen topic is: {} ]".format(chosen_topic))
      return chosen_topic
  
imports: from typing import Optional
  from parlai.core.opt import Opt
  from copy import deepcopy
  import json
  import random
  import os
  import string
  from parlai.core.params import ParlaiParser
  from parlai.core.agents import create_agent
  from parlai.core.message import Message
  from parlai.core.worlds import DialogPartnerWorld, validate
  from parlai.tasks.wizard_of_wikipedia.agents import TOKEN_KNOWLEDGE, TOKEN_END_KNOWLEDGE
  from parlai.tasks.self_chat.worlds import SelfChatWorld
  from parlai.utils.misc import warn_once
  from .build import build
  from projects.wizard_of_wikipedia.knowledge_retriever.knowledge_retriever import KnowledgeRetrieverAgent
label_desc: Use image node_id 5 for calling the InteractiveWorld obj's underlying member method code with example usage: obj._get_new_topic() and returns: chosen_topic