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)
docstr_tok: ["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
  
file_path: gluon-nlp/scripts/question_answering/models.py
imports: import mxnet
  from mxnet import np, npx
  from mxnet.gluon import nn, HybridBlock
  from mxnet.util import use_np
  from gluonnlp.layers import get_activation
  from gluonnlp.op import select_vectors_by_position
  from gluonnlp.attention_cell import masked_logsoftmax, masked_softmax
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