title: How to untokenize BERT tokens?
body: <p>I have a sentence and I need to return the text corresponding to N BERT tokens to the left and right of a specific word.</p>
  <pre><code>from transformers import BertTokenizer
  tz = BertTokenizer.from_pretrained(&quot;bert-base-cased&quot;)
  sentence = &quot;The Natural Science Museum of Madrid shows the RECONSTRUCTION of a dinosaur&quot;
  
  tokens = tz.tokenize(sentence)
  print(tokens)
  
  &gt;&gt;['The', 'Natural', 'Science', 'Museum', 'of', 'Madrid', 'shows', 'the', 'R', '##EC', '##ON', '##ST', '##R', '##UC', '##TI', '##ON', 'of', 'a', 'dinosaur']
  </code></pre>
  <p>What I want is to get the text corresponding to 4 tokens to the left and to the right of the token Madrid. So i want the tokens: ['Natural', 'Science', 'Museum', 'of', 'Madrid', 'shows', 'the', 'R', '##EC'] and then transform them into the original text. In this case it would be 'Natural Science Museum of Madrid shows the REC'.</p>
  <p>Is there a way to do this?</p>