code: def __init__(
      self,
      bert_output_dim,
      scoring_method="qa_linear",
      max_mention_length=10,
  ):
      super(MentionScoresHead, self).__init__()
      self.scoring_method = scoring_method
      self.max_mention_length = max_mention_length
      if self.scoring_method == "qa_linear":
          self.bound_classifier = nn.Linear(bert_output_dim, 3)
      elif (
          self.scoring_method == "qa_mlp" or self.scoring_method == "qa"
      ):  # for back-compatibility
          self.bound_classifier = nn.Sequential(
              nn.Linear(bert_output_dim, bert_output_dim),
              nn.ReLU(),
              nn.Dropout(0.1),
              nn.Linear(bert_output_dim, 3),
          )
      else:
          raise NotImplementedError()
  
imports: import os
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from tqdm import tqdm
  from collections import OrderedDict
  from pytorch_transformers.modeling_bert import BertPreTrainedModel, BertConfig, BertModel
  from pytorch_transformers.tokenization_bert import BertTokenizer
  from elq.common.ranker_base import BertEncoder, get_model_obj
  from blink.common.optimizer import get_bert_optimizer
  from elq.biencoder.allennlp_span_utils import batched_span_select, batched_index_select
  from elq.biencoder.utils import batch_reshape_mask_left
label_desc: Use image node_id 1 to create a new MentionScoresHead object from inherited base classes: nn with example: obj = MentionScoresHead(bert_output_dim, scoring_method, max_mention_length)