class_docstr: Model from "Engaging Image Chat: Modeling Personality in Grounded Dialogue".
  
  See paper for more details: (https://arxiv.org/abs/1811.00945)
  
  An extension of the model from https://arxiv.org/abs/1810.10665; given
  an image, personality, and dialogue history, predicts the next utterance
  in a dialogue.
class_docstr_tok: ["Model","from","``","Engaging","Image","Chat",":","Modeling","Personality","in","Grounded","Dialogue","''",".","See","paper","for","more","details",":","(","https",":","\/\/arxiv.org\/abs\/1811.00945",")","An","extension","of","the","model","from","https",":","\/\/arxiv.org\/abs\/1810.10665",";","given","an","image",",","personality",",","and","dialogue","history",",","predicts","the","next","utterance","in","a","dialogue","."]
docstr: Extract the personalities and dialogue histories from observations.
  
  Additionally determine which dialogue round we are in.
  
  Note that this function assumes that the personality is the
  last line of the `text` field in the observation.
  
  :param obs:
      list of observations
  
  :return:
      a list of personalities, a list of dialogue histories, and the
      current dialogue round (either first, second, or third+)
docstr_tok: ["Extract","the","personalities","and","dialogue","histories","from","observations",".","Additionally","determine","which","dialogue","round","we","are","in",".","Note","that","this","function","assumes","that","the","personality","is","the","last","line","of","the","`","text","`","field","in","the","observation",".",":","param","obs",":","list","of","observations",":","return",":","a","list","of","personalities",",","a","list","of","dialogue","histories",",","and","the","current","dialogue","round","(","either","first",",","second",",","or","third+",")"]
code: def extract_texts(self, obs):
      """
      Extract the personalities and dialogue histories from observations.
  
      Additionally determine which dialogue round we are in.
  
      Note that this function assumes that the personality is the
      last line of the `text` field in the observation.
  
      :param obs:
          list of observations
  
      :return:
          a list of personalities, a list of dialogue histories, and the
          current dialogue round (either first, second, or third+)
      """
      splits = [v.get("text").split("\n") for v in obs]
      if self.personality_override:
          splits = [s + [self.personality_override] for s in splits]
      personalities = [t[-1] for t in splits]
      dialogue_histories = None
      dialogue_round = "first_round"
      if len(splits[0]) >= 2:
          dialogue_round = (
              "second_round" if len(splits[0]) == 2 else "third_round+"
          )
          dialogue_histories = ["\n".join(t[:-1]) for t in splits]
  
      return personalities, dialogue_histories, dialogue_round
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.utils.misc import round_sigfigs
  from parlai.core.message import Message
  from .modules import TransresnetMultimodalModel
  from projects.personality_captions.transresnet.transresnet import TransresnetAgent
  from parlai.utils.io import PathManager
  import parlai.utils.torch
  import torch
  from torch import optim
  import random
  import numpy
  import tqdm
  from collections import deque
label_desc: Use image node_id 10 for calling the TransresnetMultimodalAgent obj's underlying member method code with example usage: obj.extract_texts(obs) and returns: personalities,  dialogue_histories,  dialogue_round