class_docstr: Poly-encoder Agent.
  
  Equivalent of bert_ranker/polyencoder and biencoder_multiple_output but does not
  rely on an external library (hugging face).
class_docstr_tok: ["Poly-encoder","Agent",".","Equivalent","of","bert_ranker\/polyencoder","and","biencoder_multiple_output","but","does","not","rely","on","an","external","library","(","hugging","face",")","."]
docstr: Add the start and end token to the text.
docstr_tok: ["Add","the","start","and","end","token","to","the","text","."]
code: def _set_text_vec(self, *args, **kwargs):
      """
      Add the start and end token to the text.
      """
      obs = super()._set_text_vec(*args, **kwargs)
      if "text_vec" in obs and "added_start_end_tokens" not in obs:
          obs.force_set(
              "text_vec",
              self._add_start_end_tokens(obs["text_vec"], True, True),
          )
          obs["added_start_end_tokens"] = True
      return obs
  
imports: from parlai.core.params import ParlaiParser
  from typing import Any, Dict, Optional, Tuple
  import torch
  from parlai.core.opt import Opt
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from parlai.core.torch_agent import Batch
  from parlai.utils.misc import recursive_getattr
  from parlai.utils.logging import logging
  from .biencoder import AddLabelFixedCandsTRA
  from .modules import BasicAttention, MultiHeadAttention, TransformerEncoder
  from .transformer import TransformerRankerAgent
label_desc: Use image node_id 6 for calling the PolyencoderAgent obj's underlying member method code with example usage: obj._set_text_vec() and returns: obs