class_docstr: RPAReranker subclasses the Reranker.
  
  This does the following:
  
  1) Determine listener character from dialogue history
      This is done either via extraction from history or via prediction
  2) Construct augmented dialogue history with text candidates
  3) Predict speaker with augmented dialogue history
  4) Re-rank text candidates according to highest speaker score for (predicted) listener character
  
  The RPA Re-ranker also provides classification functionality, to just simply
  classify incoming responses.
class_docstr_tok: ["RPAReranker","subclasses","the","Reranker",".","This","does","the","following",":","1",")","Determine","listener","character","from","dialogue","history","This","is","done","either","via","extraction","from","history","or","via","prediction","2",")","Construct","augmented","dialogue","history","with","text","candidates","3",")","Predict","speaker","with","augmented","dialogue","history","4",")","Re-rank","text","candidates","according","to","highest","speaker","score","for","(","predicted",")","listener","character","The","RPA","Re-ranker","also","provides","classification","functionality",",","to","just","simply","classify","incoming","responses","."]
docstr: Given context and candidate, augment the context for predicting whoami.
  
  :param full_context:
      dialogue context:
  :param candidate:
      candidate response
  :param include_context:
      whether to include the context strings
  
  :return augmented_context:
      return the augmented context.
docstr_tok: ["Given","context","and","candidate",",","augment","the","context","for","predicting","whoami",".",":","param","full_context",":","dialogue","context",":",":","param","candidate",":","candidate","response",":","param","include_context",":","whether","to","include","the","context","strings",":","return","augmented_context",":","return","the","augmented","context","."]
code: def augment_context(
      self,
      full_context: str,
      candidate: str,
      include_context: Optional[bool] = True,
  ) -> List[str]:
      """
      Given context and candidate, augment the context for predicting whoami.
  
      :param full_context:
          dialogue context:
      :param candidate:
          candidate response
      :param include_context:
          whether to include the context strings
  
      :return augmented_context:
          return the augmented context.
      """
      utterances = self.get_utterances_from_full_context(
          full_context, include_context=self.include_context
      )
  
      if self.num_utterances > 0:
          utterances = utterances[: self.num_utterances]
  
      characters = extract_characters(full_context)
      self_character = characters.get("_self_name", None)
      partner_character = characters.get("_partner_name", None)
      if not self_character:
          self_character = self._predict_character_from_context(
              full_context, characters, who="self"
          )
      if not partner_character:
          partner_character = self._predict_character_from_context(
              full_context, characters, who="partner"
          )
  
      light_context = [l for l in utterances if self.is_context(l)]
      dialogue = [l for l in utterances if not self.is_context(l)]
      reversed_dialogue = []
      for i, utt in enumerate(reversed(dialogue)):
          if i % 2 == 0:
              # Even: partner spoke
              reversed_dialogue.append((partner_character, utt))
          else:
              # Odd: you spoke
              reversed_dialogue.append((self_character, utt))
      processed_dialogue = [
          maybe_annotate(
              *d,
              self.annotate_speaker,  # type: ignore
              self.speaker_separator,  # type: ignore
              self.speaker_annotation_position,  # type: ignore
          )
          for d in reversed(reversed_dialogue)
      ]
      if include_context:
          utterances = light_context + processed_dialogue
      else:
          utterances = processed_dialogue
  
      utterances += (WHO_AM_I, candidate)
      return utterances
  
imports: from typing import Optional, List, Dict
  from parlai.core.agents import create_agent_from_model_file
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from projects.light_whoami.task.agents import SpeakerClassifierTeacher
  from projects.light_whoami.task.utils import WHO_AM_I, WHO_ARE_YOU, extract_characters, maybe_annotate
  from parlai.agents.reranker.reranker import AbstractReranker, AbstractGeneratorRerankAgent, LongAbstractGeneratorRerankAgent
label_desc: Use image node_id 8 for calling the RPAReranker obj's underlying member method code with example usage: obj.augment_context(full_context, candidate, include_context) and returns: utterances