最近ずっと NN/CNN/RNN/LSTM などで遊んでいたのだけど Seq2Seq の encoder/decoder と word embeddings を理解したかったので Seq2Seq の chatbot を動かしてみた。Keras でフルスクラッチで書いていたのだけど上手く動かず。論文読んでもわからないところがあったので https://github.com/1228337123/tensorflow-seq2seq-chatbot を自分なりに読み解いてプロセスが別れてわかりやすいように書き換えた。同時に日本語に対応させて Twitter Bot として動くようにした。 会話例 seq2seq Google 翻訳などでも利用されている seq2seq というタイプの Neural Networks を利用しています。入力も出力も時系列データ。例えば会話とか翻訳とかに使えます。
のような感じです。これをtest_data_in.txtとtest_data_out.txtも同様に準備をします。 訓練用306文とテスト用306文(IN,OUTが153ずつ)の計712文で、語彙数は訓練用とテスト用それぞれ約500ずつです。 データは非常に少ないです(泣) 学習のコード 学習を行うコードです。 チュートリアルのデフォルトではバッチ(batch_size)が64、層の数(num_layers)が3、層のユニット(size)が1024、語彙数が(vocab_size)が40000の大きさでした。 #!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file ex
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く