Slang translation

I want to translate slang sentences to formal sentences.
Where most of the words in the source sentence will be part of the target sentence.
Could you tell me what should be the strategy for this issue?

Do you have input and target sentence pairs? If so, a logical place to start is to consider a sequence to sequence model like those used for more traditional machine translation tasks. Take a look at this tutorial:

https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html#sphx-glr-intermediate-seq2seq-translation-tutorial-py

This tutorial is well written and should get you going. Btw, your project sounds like an interesting one. Good luck!