<label id="jgr5k"></label>
    <legend id="jgr5k"><track id="jgr5k"></track></legend>

    <sub id="jgr5k"></sub>
  1. <u id="jgr5k"></u>
      久草国产视频,91资源总站,在线免费看AV,丁香婷婷社区,久久精品99久久久久久久久,色天使av,无码探花,香蕉av在线
      您正在使用IE低版瀏覽器,為了您的雷峰網賬號安全和更好的產品體驗,強烈建議使用更快更安全的瀏覽器
      此為臨時鏈接,僅用于文章預覽,將在時失效
      人工智能開發者 正文
      發私信給AI研習社
      發送

      1

      我用 tensorflow 實現的 “一個神經聊天模型”

      本文作者: AI研習社 編輯:賈智龍 2017-09-07 10:26
      導語:一個基于深度學習的聊天機器人。

      雷鋒網按:本文原作者小灰灰,原載于專欄。雷鋒網已獲得作者授權。

      概述

      這個工作嘗試重現這個論文的結果 A Neural Conversational Model (aka the Google chatbot).
      它使用了循環神經網絡(seq2seq 模型)來進行句子預測。它是用 python 和 TensorFlow 開發。

      程序的加載主體部分是參考 Torch 的  neuralconvo from macournoyer.

      現在, DeepQA 支持一下對話語料:

      To speedup the training, it's also possible to use pre-trained word embeddings (thanks to Eschnou). More info here.

      安裝

      這個程序需要一下依賴 (easy to install using pip: pip3 install -r requirements.txt):

      • python 3.5

      • tensorflow (tested with v1.0)

      • numpy

      • CUDA (for using GPU)

      • nltk (natural language toolkit for tokenized the sentences)

      • tqdm (for the nice progression bars)

      你可能需要下載附帶的數據讓 nltk 正常工作。

      python3 -m nltk.downloader punkt

      Cornell 數據集已經包括了。其他的數據集查看 readme 文件到他們所在的文件夾。  (在  data/).

      網站接口需要一些附加的包:

      • django (tested with 1.10)

      • channels

      • Redis (see here)

      • asgi_redis (at least 1.0)

      Docker 安裝也是支持的,更多詳細的教程參考  here.

      運行

      聊天機器人

      訓練這個模型,直接運行 main.py 。一旦訓練完成,你可以測試結果用 main.py --test
      (結果生成在  'save/model/samples_predictions.txt') 或者用 main.py --test interactive (更有趣).

      Here are some flags which could be useful. For more help and options, use python main.py -h:

      • --modelTag: allow to give a name to the current model to differentiate between them when testing/training.

      • --keepAll: use this flag when training if when testing, you want to see the predictions at different steps (it can be interesting to see the program changes its name and age as the training progress). Warning: It can quickly take a lot of storage space if you don't increase the --saveEvery option.

      • --filterVocab 20 or --vocabularySize 30000: Limit the vocabulary size to and optimize the performances and memory usage. Replace the words used less than 20 times by thetoken and set a maximum vocabulary size.

      • --verbose: when testing, will print the sentences as they are computed.

      • --playDataset: show some dialogue samples from the dataset (can be use conjointly with --createDataset if this is the only action you want to perform).

      To visualize the computational graph and the cost with TensorBoard, just run tensorboard --logdir save/.

      默認的這個網絡架構是一個標準的 encoder/decoder 有兩個 LSTM layers (隱藏層大小 256) ,然后 vocabulary 的 embedding size 是  32. 這個網絡用 ADAM 訓練。最大的句子長度設置為 10 個單詞,但是可以增加。

      結果

      當然,這個網絡并不會很擅長聊天:

      Q: Hi
      A: Hi.
      
      Q: What is your name ?
      A: Laura.
      
      Q: What does that mean ?
      A: I dunno.
      
      Q: How old are you ?
      A: thirty-five.
      
      Q: Will Google hire me ?
      A: No.
      
      Q: Tell me the alphabet
      A: Fuck you.
      
      Q: That's not nice
      A: Yeah.

      這里有一些情況它并不能正確回答:

      Q: Who is Laura ?
      A: My brother.
      
      Q: Say 'goodbye'
      A: Alright.
      
      Q: What is cooking ?
      A: A channel.
      
      Q: Can you say no ?
      A: No.
      
      Q: Two plus two
      A: Manny...

      預訓練模型

      項目截圖

      我用 tensorflow 實現的 “一個神經聊天模型”

      chatbot_miniature.png

      實測截圖

      我用 tensorflow 實現的 “一個神經聊天模型”

      Screenshot from 2017-09-05 14-47-52.png

      一步一步教程

      1. 下載這個項目:
      https://github.com/Conchylicultor/DeepQA
      2. 下載訓練好的模型:
      https://drive.google.com/file/d/0Bw-phsNSkq23OXRFTkNqN0JGUU0/view
      (如果網址不能打開的話,今晚我會上傳到百度網盤,分享到:http://www.tensorflownews.com/
      3. 解壓之后放在 項目 save 目錄下,如圖所示

      我用 tensorflow 實現的 “一個神經聊天模型”

      Screenshot from 2017-09-05 14-52-13.png

      4. 復制 save/model-pretrainedv2/dataset-cornell-old-lenght10-filter0-vocabSize0.pkl 這個文件到  data/samples/,如圖所示:

      我用 tensorflow 實現的 “一個神經聊天模型”

      Screenshot from 2017-09-05 14-55-00.png

      5. 在項目目錄執行一下命令:

      python3 main.py --modelTag pretrainedv2 --test interactive

      程序讀取了預訓練的模型之后,如圖:

      我用 tensorflow 實現的 “一個神經聊天模型”

      Screenshot from 2017-09-05 14-57-14.png

      聊天機器人資源合集

      項目,語聊,論文,教程
      https://github.com/fendouai/Awesome-Chatbot

      DeepQA

      https://github.com/Conchylicultor/DeepQA

      備注:為了更加容易了解這個項目,說明部分翻譯了項目的部分 readme ,主要是介紹使用預處理數據來運行這個項目。

      雷峰網版權文章,未經授權禁止轉載。詳情見轉載須知

      我用 tensorflow 實現的 “一個神經聊天模型”

      分享:
      相關文章

      編輯

      聚焦數據科學,連接 AI 開發者。更多精彩內容,請訪問:yanxishe.com
      當月熱門文章
      最新文章
      請填寫申請人資料
      姓名
      電話
      郵箱
      微信號
      作品鏈接
      個人簡介
      為了您的賬戶安全,請驗證郵箱
      您的郵箱還未驗證,完成可獲20積分喲!
      請驗證您的郵箱
      立即驗證
      完善賬號信息
      您的賬號已經綁定,現在您可以設置密碼以方便用郵箱登錄
      立即設置 以后再說
      主站蜘蛛池模板: 精品人妻少妇| 日本一卡2卡3卡四卡精品网站| 4480yy亚洲午夜私人影院剧情| 中文字幕无码免费久久9一区9| 亚洲综合区图片小说区 | 99999久久久久久亚洲| 九九久久精品无码专区| 国产香蕉97碰碰久久人人| 1024你懂的国产精品| 亚洲一区二区三区免费av在线| 最爽free性欧美人妖| 精品人妻少妇一区二区| 隔壁老王国产在线精品| 无码3p| 亚洲精品999| 超碰人人插| 久99视频| 國產尤物AV尤物在線觀看| 久久久久久久久毛片精品| 久久无码人妻丰满熟妇区毛片| 日韩成人无码一区二区三区| 新婚少妇无套内谢国语播放| 国内精品熟女亚洲精品熟女| 拍拍拍| 超碰人妻97| 国产一区曰韩二区欧美三区| 人妻有码中文字幕在线| 国内精品久久九九国产精品| 国产av天堂亚洲国产av天堂| 国产av一区二区三区| 99精品国产一区二区三区2021| 黑人AV无码| 襄汾县| 老妇肥熟凸凹丰满刺激| 国产日韩欧美小视频苍井空毛片| A成片人| 日本无码一区二区| 一本大道人妻中字幕在线视频| 97高清国语自产拍| 无码久久久| 金湖县|