我們在問答對準備任務和對話行為標記任務上的實驗顯示,我們提出的模型在大多數實驗中都能夠勝過所有現有模型。為了演示這兩個任務的使用,我們也構建了基於檢索的聊天機器人。 此聊天機器人不僅根據用戶的輸入從前述準備的問答對中選擇回應,同時也應用對話行為標註資訊來幫助選擇答案。;In this thesis, we study two different tasks for data preparation process: Question-Answer Pair Preparation and Dialogue Act Tagging. Unlike other works, our data comes from instant messaging (IM) platform which has different characteristic as participants could split long sentences into short utterances and send them in multiple messages. Therefore, in the preparation for question-answer pairs, we also consider a task called message merging task which aims to determine whether those messages need to be merged or not before generating message pairs for reply-to prediction task. We propose a CONTEXT-AOA model to include the context (previous dialogue) as additional input apart from pairwise messages. For dialogue act tagging task, we explore the possibility of using out-of-domain dataset to deal with this task when we are unable to obtain more annotated data. We conduct two experiments on this task. The first experiment is a zero-shot learning experiment where we train the models using only out-of-domain datasets and test them on our dataset, and another experiment is where we include some of our dataset to the the models along with the out-of-domain datasets and test them on the remaining data. We also propose a CONTEXT-BERT-CRF model which utilizes the ability of BERT and still be able to include all of the utterances from the conversation to the model. Our experiments on both question-answer pair preparation task and dialogue act tagging task show that our proposed models are able to outperform all of the existing models in most of the experiments. To demonstrate the use of these two tasks, the retrieval-based IR-based chatbot has been built. The chatbot will select the response from Q\&A pairs prepared in question-answer pair preparation task based on the input from user and return the it back to user. We also apply dialogue act tagging task to help with the answer selection.