def match_sent(sentences , output_path):
  """
  The reconstruction of sentences with distilbert tokenization to recover 
  the original sentence can't be done with just "join". So we add some preprocessing
  steps to recover approximately the same sentences. Note that we will lose some
  properties such as capital letters. 
  This function adds also spans + save all sentences in a text file.
  """
  sentences = [sentence.replace(' ##','') for sentence in sentences]
  sentences = [sentence.replace(" ' ","'") for sentence in sentences]
  sentences = [sentence.replace("did n't","didn't") for sentence in sentences]

  ## add span 
  sentences = ["<span>"+sentence+'</span>' for sentence in sentences]
  with open(output_path, 'w') as output:
    for sentence in sentences:
        output.write(sentence + '\n')
  return sentences