class_docstr: A base classification model that scores a pair of texts.
  
  Subclasses need to implement the from_config, forward and save_modules.
class_docstr_tok: ["A","base","classification","model","that","scores","a","pair","of","texts",".","Subclasses","need","to","implement","the","from_config",",","forward","and","save_modules","."]
code: def __init__(
      self,
      decoder: DecoderBase,
      output_layer: OutputLayerBase,
      encode_relations: bool,
  ) -> None:
      super().__init__()
      self.decoder = decoder
      self.output_layer = output_layer
      self.encode_relations = encode_relations
      self.use_cosine_sim = isinstance(
          output_layer, PairwiseCosineDistanceOutputLayer
      )
  
imports: import itertools
  import os
  from typing import Dict, List, Tuple, Union
  import torch
  import torch.nn
  from pytext.data.tensorizers import LabelTensorizer, Tensorizer, TokenTensorizer
  from pytext.models.decoders import DecoderBase
  from pytext.models.decoders.mlp_decoder import MLPDecoder
  from pytext.models.embeddings import EmbeddingBase, EmbeddingList, WordEmbedding
  from pytext.models.model import BaseModel
  from pytext.models.module import create_module
  from pytext.models.output_layers import ClassificationOutputLayer, OutputLayerBase, PairwiseCosineDistanceOutputLayer
  from pytext.models.representations.bilstm_doc_attention import BiLSTMDocAttention
  from pytext.models.representations.docnn import DocNNRepresentation
  from pytext.models.representations.representation_base import RepresentationBase
  from pytext.utils.file_io import PathManager
  from scipy.special import comb
label_desc: Use image node_id 1 to create a new BasePairwiseModel object from inherited base classes: BaseModel with example: obj = BasePairwiseModel(decoder, output_layer, encode_relations)