| Humor is an indispensable expression in daily life and work,a lubricant in communication,and an important meanthis paper of expression in the study of linguistics.Research has shown that humor is subjective in nature,which makes it one of the more difficult of the various tasks of natural language processing.In this thesis,we analyze the problem of humor text recognition and humor text generation in humor computing,and propose a solution by combining humor scripting theory,deep learning related techniques and pre-trained language models.In humorous text recognition,a multidimensional latent semantic network for humorous text recognition is proposed,which combines multiple features in humorous text to improve the performance of humorous text recognition.The model automatically identifies whether a sentence contains a humorous expression by capturing inconsistent features,phonetic features and ambiguities of the joke as semantic features.The model was experimented on three publicly available humor datasets,Pun-Of-The-Day,200 KOneliners,and SemEval-2021 Task 7,and compared with the state-of-the-art language models of the day.The results show that the humorous text recognition model proposed in this thesis has better humor recognition accuracy and can contribute to the research of language understanding.In terms of humorous text generation,contextual semantic-based humorous text generation is proposed.In order to improve the humor of the generated text,Transform on the basis of GPT-2,one of the most advanced language generation models,and multiple candidate texts are generated by the language model and scored by the humor model to filter out the most humorous texts.Among them,the humor model mainly considers inconsistency features,phonetic features and ambiguity of jokes as semantic features.Also,to verify the generalizability of the model for humorous text generation,experiments were conducted on two different forms of datasets,a Set-up2 Punchline dataset in the form of Set_up2Punchline,and a SemEval-2020 Task 7 dataset that transforms raw text into humorous text.The results demonstrate that the model can generate humorous texts well and its results are better than other language generation models widely used today.Based on the research work of humorous text recognition and humorous text generation,a humor computing system is designed and implemented.The system provides core functions such as humorous text recognition,mythical phrase generation and humorous transformation. |