Information Retrieval and Aggregation to Dialogue For
Total Page:16
File Type:pdf, Size:1020Kb
000 050 001 Your Chatbot Teacher: Information Retrieval and Aggregation to Dialogue 051 002 For Learning Facilitation 052 003 053 004 054 005 055 006 James Quintero – [email protected] 056 007 Yueh Wu – [email protected] 057 008 Chuan Chun Kuo – [email protected] 058 009 059 010 060 011 061 012 062 013 063 014 Abstract user wants to know about recent movies, the 064 015 chatbot will look at reddit comments related to 065 016 Our project is building a chatbot designed recent movies and will try to output a sentence 066 to hold a meaningful conversation with a 017 with relevant information like ratings and an 067 user about topics of their choosing. It is aggregation of people’s opinions. As shown later 018 068 trained on thousands of posts and in this paper, we had trouble generating relevant 019 069 comments from reddit. The chatbot sentences, but had more success in text retrieval. 020 consists of 2 stages, where Stage 1 Chatbots already exist, but aren’t 070 021 classifies the user input into 50 potential designed to convey relevant news, opinions, or 071 subreddits, and Stage 2 generates the reply 022 information. They’re mainly designed to be used 072 to the user. Stage 2 can either perform 023 as an action-based chatbot, or language translator. 073 Information Retrieval (IR), or text 024 generation. Stage 1’s classifier is very Researchers seem to focus on how accurate they 074 025 accurate, with 96% accuracy, but Stage 2 can get chatbots, or more specifically, text 075 026 has trouble retrieving relevant sentences, or generators, to output English. We are different, 076 because we wanted to build a chatbot designed to 027 generating sentences of its own.. 077 convey information in a dialogue form. The user 028 078 1 Introduction is meant to learn from interacting with our 029 chatbot. 079 030 Contextual chatbot interfaces for information We divided our project into 2 stages, the 080 031 retrieval will be a big industry in the future. first is focused on training the encoder to correctly 081 032 Currently, people gather their own information on classify the topic of a given input sentence into 082 033 subjects or news by looking at journal articles or one of 51 subreddits classes. On the second stage, 083 034 news articles accessed from googling. But we we integrate the classifier component with 084 believe that in the future, there will be central information retrieval, and for text generation, 035 085 chatbots that are up to date on current knowledge with the decoder to create meaningful sentences 036 of certain areas, kind of like teachers/professors that is pertinent to the input and also contains 086 037 of today’s world. If you want to know information information learned from Reddit comments. 087 038 on a certain subject, you can look at its wikipedia Results on our stage 1 experiments as shown in 088 039 page, or interact with a chatbot that has not only section 4 of our report appears to be pretty 089 040 learned the wikipedia page, but also related news positive. Results from Stage 2 are lackluster, and 090 041 articles and people’s comments on the subject would need significant changes to be a viable 091 042 matter. This gives a much richer learning chatbot. Possible improvements are shown in 092 section 5. 043 experience for the user, as the chatbot is able to 093 bring in much more information and give it in a For Stage 2 of our project, we tried out 044 094 friendly human interactive manner by answering retrieval-based generation, and text generation. 045 questions the user has. Retrieval based generation tried to select relevant 095 046 Our project is building a chatbot designed reddit comments to reply to the user instead of 096 047 to hold a meaningful conversation with a user generating its own sentences. And text generation 097 048 about topics of their choosing. We limited the tried to generate its own sentences. We then 098 049 information to reddit posts and comments, so if a compared results from the two strategies. We 099 1 100 150 decide to evaluate our retrieval based generation and LSTMs. “Sequence to Sequence Learning 101 151 with MAP, and our text generation on BLEU and with Neural Networks” by Sutskever e.t. al. [13] 102 GLEU [8]. For BLEU and GLEU, we made “A Deep Reinforcement Learning 152 103 modifiations, because the target comments that Chatbot” by Serban e.t. al. [15]. This paper 153 104 our chatbot is supposed to replicate, include incorporates many NLP techniques to develop a 154 105 actual replies to the reddit comments we used for chatbot, like an ensemble of natural language 155 106 training. For evaluation, we used a sample of 100 generation and retrieval models, including 156 107 possible user inputs, and 100 of the best responses template-based models, bag-of-words models, 157 108 to each one of those sample inputs. We then sequence-to-sequence neural network and latent 158 109 compare the actual output from the chatbot to the variable neural network models. 159 best possible responses, and compare their TF- Our proposed model is different because it is 110 160 IDF score and relevancy. For example, the designed to convey relevant news, opinions, or 111 chatbot scores higher if its response shares information to a user through a dialogue, instead of 161 112 common words with the target response. A final being an action-based chatbot. Other text 162 113 ratio will be given, where the higher the ratio, the generators are also used to just generate stories, or 163 114 more the chatbot was close or succeeded in to translate the user input into another language. 164 115 providing a great response. Our chatbot will use a similar technique, but used 165 116 Our stage 1 classification model has a high for a very different reason. The way our system is 166 accuracy of 96%, and our stage 2 encoder- 117 structured, is also quite different than the quoted 167 decoder for sequence-to-sequence text generation 118 papers, since we will have 2 stages to our system, 168 can achieve 65% accuracy. We are constrained by 119 where the first is a classifier of the topic, and the training time, but we have shown that the longer 169 second is a text generator based on the user’s input 120 our stage 2 model trains, the better its responses 170 121 get. and the classified topic. 171 122 172 3 Approach 123 2 Related Work 173 124 174 OpenAI created a state-of-the-art text generator The chatbot consists of two stages. The first stage 125 using Transformers. Other research has shown is a classification stage, where a classification 175 126 that Transformers can outperform all types of model takes in reddit comments and sentences, 176 127 recurrent neural networks and convolutional and determines which subreddit that comment 177 128 neural networks. Transformers can perform belongs to. This will allow a user’s initial 178 sentence to a chatbot, spawn the appropriate and 129 significantly better than convolutions and 179 relevant discussion. For the second stage, we tried 130 recurrence. “Attention Is All You Need” by 180 Vaswani e.t. al. [9] two different approaches. One is an Information 131 Retrieval approach, which is where the chatbot 181 132 General Adversarial Networks (GAN) 182 can be used for generating dialogues. Relevant replied to the user with the most relevant 133 183 papers: “Adversarial Learning for Neural comment that it could determine, and the other 134 Dialogue Generation” by Monroe e.t. al. [10], approach is a text-generation approach. Text 184 135 “Adversarial Feature Matching for Text generation is a sequence-to-sequence (encoder 185 and decoder) model that takes in 136 Generation” by Zhang e.t. al. [11] 186 137 Google released a paper about their comments/sentences, and generates its own 187 sentences. We also had an idea of having a model 138 google translate decoder architecture. GNMT, 188 Google Neural Machine Translation system, for each subreddit that’s trained only on that 139 subreddit. That way the model is fine-tuned for 189 140 which uses a deep LSTM architecture with many 190 encoders and decoders. This system is used for information from that subreddit, and the 141 191 translating existing sentence though, but classification answer from stage 1 can determine 142 understanding the decoder architecture could be which model will generate the sentence. This idea 192 143 useful. Google’s Neural Machine Translation can be explored further if given more time. 193 144 (GNMT) Decoder architecture. “Google’s Neural See Appendix [1] for overall system architecture 194 145 Machine Translation System: Bridging the Gap sketch. 195 146 between Human and Machine Translation” by 196 3.1 Stage 1 Classifier Architecture 147 Wu e.t. al. [12] 197 148 Google has also outlined a sequence to 198 sequence system that uses deep neural networks, 149 199 2 200 250 Stage 2 of our project is a text generation model, 201 251 Our improved made up of an encoder and decoder. This model 202 252 model consists type allows for the input of a vectorized sentence, 203 of an and for the sequential output for another 253 204 Embedding vectorized sentence. This facilitates dialogue, 254 205 layer, LSTM which is perfect for conversation with a chatbot. 255 206 layer, 2 feed- We initially tried with an InputLayer 256 207 forward layers, feeding into the encoder, and an InputLayer 257 208 and an output feeding into the decoder, but we found that adding 258 209 layer.