How to transform BERT's network output to readable text?
I am trying to understand, how to use BERT for QnA and found a tutorial on how to start on PyTorch (here). Now I would like to use these snippets to get started, but i do not understand how to project the output back on the example text. 

text = "[CLS] Who was Jim Henson ? [SEP] Jim Henson was a puppeteer [SEP]"

(...)

# Predict the start and end positions logits
with torch.no_grad():
    start_logits, end_logits = questionAnswering_model(tokens_tensor, segments_tensors)

# Or get the total loss
start_positions, end_positions = torch.tensor([12]), torch.tensor([14])

multiple_choice_loss = questionAnswering_model(
                         tokens_tensor,
                         segments_tensors,
                         start_positions=start_positions,
                         end_positions=end_positions)



  start_logits (shape: [1, 16]):tensor([[ 0.0196,  0.1578,  0.0848,  0.1333, -0.4113, -0.0241, -0.1060, -0.3649,
            0.0955, -0.4644, -0.1548,  0.0967, -0.0659,  0.1055, -0.1488, -0.3649]])
  
  end_logits (shape: [1, 16]):tensor([[ 0.1828, -0.2691, -0.0594, -0.1618,  0.0441, -0.2574, -0.2883,  0.2526,
           -0.0551, -0.0051, -0.1572, -0.1670, -0.1219, -0.1831, -0.4463,  0.2526]])


If my assumption is correct start_logits and end_logits need to be projected back on text, but how do i compute this?

Additionally do you have any resources/guides/tutorials you could recommend to continue further into QnA (except google-research/bert github and the paper for bert)? 

Thank you in advance.

I think you are trying to use Bert for Q&amp;A where the answer is a span of the original text. The original paper uses this for the SQuAD dataset where this is the case. start_logits and end_logits have the logits for a token being the start/end of the answer so you can take argmax and it would be the index of the token in the text.

There is this NAACL tutorial on tranfer learning from the author of the repo you linked https://colab.research.google.com/drive/1iDHCYIrWswIKp-n-pOg69xLoZO09MEgf#scrollTo=qQ7-pH1Jp5EG It's using classification as the target task but you might still find it useful.
