class_docstr: Here, we use three networks to predict the start scores, end scores and answerable scores.
  
  We formulate p(start, end, answerable | contextual_embedding) as the product of the
  following three terms:
  
  - p(start | contextual_embedding)
  - p(end | start, contextual_embedding)
  - p(answerable | contextual_embedding)
  
  In the inference phase, we are able to use beam search to do the inference.
  
  use_segmentation is used to mark whether we segment the input sentence. In RoBERTa and XLMR,
  this flag is set to True, then the QA model no longer accept `token_types` as valid input.
  
  - use_segmentation=True:
      tokens :      <CLS> Question <SEP> Context <SEP>
      token_typess:  0       0       0      1      1
  
  - use_segmentation=False:
      tokens :      <CLS> Question <SEP> Context <SEP>
      token_typess:  None
class_docstr_tok: ["Here",",","we","use","three","networks","to","predict","the","start","scores",",","end","scores","and","answerable","scores",".","We","formulate","p","(","start",",","end",",","answerable","|","contextual_embedding",")","as","the","product","of","the","following","three","terms",":","-","p","(","start","|","contextual_embedding",")","-","p","(","end","|","start",",","contextual_embedding",")","-","p","(","answerable","|","contextual_embedding",")","In","the","inference","phase",",","we","are","able","to","use","beam","search","to","do","the","inference",".","use_segmentation","is","used","to","mark","whether","we","segment","the","input","sentence",".","In","RoBERTa","and","XLMR",",","this","flag","is","set","to","True",",","then","the","QA","model","no","longer","accept","`","token_types","`","as","valid","input",".","-","use_segmentation=True",":","tokens",":","<","CLS",">","Question","<","SEP",">","Context","<","SEP",">","token_typess",":","0","0","0","1","1","-","use_segmentation=False",":","tokens",":","<","CLS",">","Question","<","SEP",">","Context","<","SEP",">","token_typess",":","None"]
docstr: Parameters
  ----------
  contextual_embedding
      Shape (batch_size, sequence_length, C)
  
  Returns
  -------
  start_logits
      Shape (batch_size, sequence_length)
code: def get_start_logits(self, contextual_embedding, p_mask):
      """
  
      Parameters
      ----------
      contextual_embedding
          Shape (batch_size, sequence_length, C)
  
      Returns
      -------
      start_logits
          Shape (batch_size, sequence_length)
      """
      start_scores = np.squeeze(
          self.start_scores(contextual_embedding), -1
      )
      start_logits = masked_logsoftmax(
          start_scores, mask=p_mask, axis=-1
      )
      return start_logits
  
imports: import numpy
  import gluonnlp.data.batchify
  import collections
  import dataclasses
  import mxnet
  from mxnet import np, npx
  from mxnet.gluon import nn
  from mxnet.gluon.nn import HybridBlock
  from dataclasses import dataclass
  from tqdm import tqdm
  from typing import Optional, List, Tuple
  from gluonnlp.data.tokenizers import BaseTokenizerWithVocab
  from gluonnlp.utils.preprocessing import match_tokens_with_char_spans
  from gluonnlp.layers import get_activation
  from gluonnlp.op import select_vectors_by_position
  from gluonnlp.attention_cell import masked_logsoftmax, masked_softmax
  import string
  import re
  import json
label_desc: Use image node_id 2 for calling the ModelForQAConditionalV1 obj's underlying member method code with example usage: obj.get_start_logits(contextual_embedding, p_mask) and returns: start_logits