├── Presentation.pptx ├── Proposal.pdf ├── README.md ├── code └── kerasrl_frames │ ├── .ipynb_checkpoints │ └── Test-notebook-checkpoint.ipynb │ ├── LSTM200.h5 │ ├── Test-notebook.ipynb │ ├── chat.py │ ├── conversation.pickle │ ├── keras.json │ ├── kerasrl_frames.py │ └── kerastrain.py ├── report.doc └── video_presentation.webm /Presentation.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agsarthak/Goal-oriented-Dialogue-Systems/dacda9f97a5d0152ebcc0e5235c101f944e0c8e2/Presentation.pptx -------------------------------------------------------------------------------- /Proposal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agsarthak/Goal-oriented-Dialogue-Systems/dacda9f97a5d0152ebcc0e5235c101f944e0c8e2/Proposal.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reinforcement-Learning-Dialogue-Generation 2 | Applying Deep Reinforcement Learning for dialogue generation. aka chatbot 3 | -------------------------------------------------------------------------------- /code/kerasrl_frames/.ipynb_checkpoints/Test-notebook-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /code/kerasrl_frames/LSTM200.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agsarthak/Goal-oriented-Dialogue-Systems/dacda9f97a5d0152ebcc0e5235c101f944e0c8e2/code/kerasrl_frames/LSTM200.h5 -------------------------------------------------------------------------------- /code/kerasrl_frames/Test-notebook.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [ 10 | { 11 | "name": "stderr", 12 | "output_type": "stream", 13 | "text": [ 14 | "C:\\Users\\sarthak\\Anaconda3\\lib\\site-packages\\gensim\\utils.py:855: UserWarning: detected Windows; aliasing chunkize to chunkize_serial\n", 15 | " warnings.warn(\"detected Windows; aliasing chunkize to chunkize_serial\")\n" 16 | ] 17 | } 18 | ], 19 | "source": [ 20 | "import os\n", 21 | "import json\n", 22 | "import nltk\n", 23 | "import gensim\n", 24 | "import numpy as np\n", 25 | "from gensim import corpora, models, similarities\n", 26 | "import pickle\n", 27 | "import csv\n", 28 | "import json\n", 29 | "from pandas.io.json import json_normalize\n", 30 | "import numpy as np" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 2, 36 | "metadata": { 37 | "collapsed": true 38 | }, 39 | "outputs": [], 40 | "source": [ 41 | "file = open('data/frames.json');\n", 42 | "x = json.load(file)\n", 43 | "x_normalize = json_normalize(x)\n", 44 | "turns = x_normalize['turns']" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": 3, 50 | "metadata": { 51 | "collapsed": false 52 | }, 53 | "outputs": [ 54 | { 55 | "data": { 56 | "text/plain": [ 57 | "1 [{'text': 'Hello, I am looking to book a vacat...\n", 58 | "2 [{'text': 'Hello there i am looking to go on a...\n", 59 | "Name: turns, dtype: object" 60 | ] 61 | }, 62 | "execution_count": 3, 63 | "metadata": {}, 64 | "output_type": "execute_result" 65 | } 66 | ], 67 | "source": [ 68 | "turnss[1:3]" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 4, 74 | "metadata": { 75 | "collapsed": true 76 | }, 77 | "outputs": [], 78 | "source": [ 79 | "txt = []\n", 80 | "for i in turns[1:100]:\n", 81 | " #print(i)\n", 82 | " cc = json_normalize(i)\n", 83 | " #print(cc['text'])\n", 84 | " txt.append(cc['text'])" 85 | ] 86 | }, 87 | { 88 | "cell_type": "code", 89 | "execution_count": 5, 90 | "metadata": { 91 | "collapsed": true 92 | }, 93 | "outputs": [], 94 | "source": [ 95 | "txt_array = np.array(txt)" 96 | ] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "execution_count": 7, 101 | "metadata": { 102 | "collapsed": true 103 | }, 104 | "outputs": [], 105 | "source": [ 106 | "model = gensim.models.Word2Vec.load('data/word2vec.bin');\n", 107 | "cor= txt_array\n", 108 | "\n", 109 | "x=[]\n", 110 | "y=[]\n", 111 | "\n", 112 | "\n", 113 | "for i in range(len(cor)):\n", 114 | " for j in range(len(cor[i])):\n", 115 | " if j