class_docstr: Stacked model that generates first the knowledge, and then the dialogue response.
class_docstr_tok: ["Stacked","model","that","generates","first","the","knowledge",",","and","then","the","dialogue","response","."]
code: def add_cmdline_args(
      cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
  ) -> ParlaiParser:
      agent = parser.add_argument_group(
          "StackedKnowledgeDialogueAgent options"
      )
  
      additional_agent_parser = ParlaiParser(add_parlai_args=False)
      BartAgent.add_cmdline_args(additional_agent_parser)
      setup_rag_args(additional_agent_parser)
  
      for action in additional_agent_parser._actions:
          key = action.option_strings[-1]
          type = action.type
  
          for prefix in [
              "krm",  # knowledge response model
              "drm",  # dialogue response model
              "drmrw",  # dialogue response model rag-wiki
              "drmnk",  # dialogue response model no-knowledge
          ]:
              agent.add_argument(
                  f'--{prefix}-{key.strip("-")}',
                  type=type,
                  required=False,
              )
  
      agent.add_argument(
          "--knowledge-response-model-path",
          type=str,
          default=""
          "wow_knowledge_response_generation_sweep_1_Tue_Aug_17_1822/9aa/model",
          help="Model used to generate the knowledge response.",
      )
      agent.add_argument(
          "--dialogue-response-model-path",
          type=str,
          default="",
          help="Model used to generate the dialogue response.",
      )
      agent.add_argument(
          "--dialogue-response-no-knowledge-model-path",
          type=str,
          default="",
          help="Model used to generate the dialogue response without knowledge.",
      )
      agent.add_argument(
          "--dialogue-response-rag-wiki-model-path",
          type=str,
          default="",
          help="Model used to generate the dialogue response with Wiki knowledge.",
      )
      agent.add_argument(
          "--use-supporting-sentence-as-knowledge",
          type=bool,
          default=False,
          help="Instead of using the knowledge response directly to condition the dialogue"
          " model, we search for the top supporting sentence and use this.",
      )
      agent.add_argument(
          "--beam-filter-for-knowledge-response",
          type=bool,
          default=False,
          help="Try to pick a beam that contains the knowledge response.",
      )
      agent.add_argument(
          "--beam-filter-questions",
          type=bool,
          default=False,
          help="Try to pick a beam that does not contain a question mark.",
      )
      agent.add_argument(
          "--beam-filter-self-references",
          type=bool,
          default=False,
          help='Try to pick a beam that does not contain self references like "I" and "me".',
      )
      agent.add_argument(
          "--beam-disregard-knowledge-for-context-blocking",
          type=bool,
          default=True,
          help="If True disregard the knowledge input for the context blocking.",
      )
      agent.add_argument(
          "--add-fixed-confidence",
          type=int,
          default=-1,
          help="Add a fixed confidence score of the knowledge response.",
      )
      agent.add_argument(
          "--add-confidence-as-str",
          type=bool,
          default=False,
          help="If we add a confidence score to the KRM, we add it as a str.",
      )
      return parser
  
imports: from copy import deepcopy
  from typing import Optional, List
  from types import MethodType
  from collections import defaultdict
  from nltk.tokenize import sent_tokenize
  from nltk.corpus import stopwords
  import random
  import spacy
  import torch
  from parlai.core.agents import create_agent, create_agent_from_shared
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.core.agents import Agent
  from parlai.core.metrics import F1Metric
  from parlai.agents.rag.args import setup_rag_args
  from parlai.agents.bart.bart import BartAgent
  from parlai.core.metrics import normalize_answer
  from parlai.tasks.wizard_of_wikipedia.agents import TOKEN_NOCHOSEN
  from parlai.tasks.wizard_of_wikipedia.agents import TOKEN_KNOWLEDGE, TOKEN_END_KNOWLEDGE
label_desc: Use image node_id 1 for calling the StackedKnowledgeDialogueAgent obj's underlying member method code with example usage: obj.add_cmdline_args(cls, parser, partial_opt) and returns: parser