For reading and writing, the Chinese written form has undergone several drastic changes in its standard and styles due to historical changes and developments. It is hard for modern people to comprehend classical texts. In order to reduce the comprehension gap between classical and modern texts and help people understand classical texts, this study chose the topic of rewriting classical and modern texts from each other. Natural language processing techniques were used to process the parallel corpora and build a deep learning model of transformer to generate corresponding sentences such that people get to know the rewriting rules between both genres of text. Finally, the generated sentences were evaluated by the text generation evaluation metrics BLEU and ROUGE. Based on the experimental results, our approach to rewriting in learning classical and modern texts shows great potential for use classical texts and understanding historical documents.