The 4th to make Sandwichman's Tale by deep learning! !! !! !! !! !! !! !! !! !! !! !!
I'm in charge of 14 natural language processing Advent Calendar 2019 (sorry for being late for a day !!!) https://qiita.com/advent-calendar/2019/nlp
I want to automatically make a control like Sandwichman, and I want to sell this to a comedy office for 4000 trillion yen. And I want to meet Sandwichman!
This time I implemented HRED with pytorch!
Ver3 >> https://qiita.com/yoyoyo_/items/e03a1a5f99762352c95f Ver2 >> https://qiita.com/yoyoyo_/items/f30c538234e62dbaa081 Ver1 >> https://qiita.com/yoyoyo_/items/105879c386be1d8b0782
HRED
The original paper is A Hierarchical Recurrent Encoder-Decoder For Generative Context-Aware Query Suggestion https://arxiv.org/abs/1507.02221 (2015)
--HRED is an abbreviation for Hierarchical Recurrent Encoder Decoder. ――Simply put, it automatically generates conversations while drawing on the flow of conversations. seq2 An evolution of seq. ――By inserting an RNN that memorizes past conversation responses, it develops into a "conversation" instead of a question-and-answer.
seq2 Compare seq and HRED. HRED has added Hierarchical RNN (abbreviated as HRNN) to seq2seq. HRNN is an RNN for memorizing the flow of past conversations, and Decoder generates a response considering past conversations by initializing the internal state of HRNN.
If you use this, can you make a good control? That is this attempt! !!
seq2seq | HRED |
---|---|
The order is to repeat steps 1-5. The number of repetitions is called the number of sessions, and it seems that it was set to 5 times in the paper.
I also put it on deep learning knocks!
https://github.com/yoyoyo-yo/DeepLearningMugenKnock/tree/master/Question_nlp#q-hred
The first "A: Hello, I'm Sandwichman" is what I typed It's not a word, but are you trying to understand the context?
A:Hi, I ’m Sandwichman.
B:What? ". Ten you. Hmm. .. Hmm you. .. Ten you. hand. ?? To. hand? ". ?? Hmm. hand? I'm sorry, you. hand. hand. hand. Teyo you. hand? Ten. Teten. hand. hand. Ten. hand? Tente. hand? .. Ten. hand. Ten. hand? .. Ten. hand? Ten
A:That's you. What? hand. ?? But? It's like Gaden. What? hand. It's good. What? Hmm. hand? .. so. Hmm. .. hand? .. .. Ten. hand. .. Hmm. Ten. hand. Hmm. .. Ten. hand? .. hand. .. hand. ?? so. What? That's right. .. .. Yo. .. .. Hmm. Yode. hand
B:But it is. "
A:.. hand? ".
B: 。
A: 。
B:is not it.
A:.. hand. hand. you. hand. hand. hand. What! ". ".
B:There isn't.
A:Ha ".
B:Ha "also. ".
A:"Hateta"
B:"Hahata".
A:Hamoyo ". "Deta"
B:Goodbye you.
A:, ".
B: 。
A:Is it? ".
B:Is it? "
A:Hamoyo "
B: 。
A:"
B:How is it?
A:Is it? .. .. hand? ". .. hand. .. ?? .. .. I'm sorry. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
B:Mona ". .. hand. .. you. .. .. .. .. .. Hmm. .. ". .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
A:, ".
B:Ha "also.
A:Is "even".
B: 。
A: 。
B:is".
A:Ha "
B:Ha "also. What?
A:Hahamo. "? "
B:Ha ".
A:Ha "
B:"Hateta".
A:Is
B:Ha "
A:"Hata".
B:Hamoyo ".
A:It is. "
B:Good morning "
A:I was happy. "
B:Hamoyotetan "
A:Hamoyo you. You came out. "
B:Hayo "
A:Hello.
B:Naha.
A:It is. "
B:It is. "
A:.. You are! "
B:Ha ".
A:What is it?
B:". .. hand. you. .. What? .. .. .. .. ". .. hand. .. ?? ". .. .. .. .. .. .. .. .. .. .. Isn't it? .. I wonder. .. .. .. .. .. .. .. .. .. .. .. .. .. .. hand. .. .. .. .. It is. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
A:Is it? "
B:What is it? " ?? ". .. hand. .. you. .. Hmm. hand. .. Hmm. .. ". hand. .. ". What?
A:Absent".
B:Ha "
A:Ha ".
B:"
A:.. That's it. "
B:Ha "also.
A:"Hateta"
B:Hamoyo. Also". "Tate ni".
A:Ha "
B:Hamoyo. To "
A:What was it? ".
B:What is it? hand"
--I tried to make a sandwich man's control with HRED that incorporated Hierarchical RNN that acquires past conversation information into seq2seq. ――It's not a human language, but is it a response? --Next, try VHRED
When Sandwichman is completely done, do you think that all the code so far will be put together and put out to Git and others?
Recommended Posts