tsu-nera(@tsu_nera) のアカウントのツイートをword2vecで分析します。
import time
import numpy as np
import pandas as pd
import tensorflow as tf
raw_data = pd.read_csv('tweets.csv')
text = raw_data['text']
len(text)
4596
# studyplusの垂れ流しツイートは削除
text = text[text.str.contains("#studyplus") == False]
# fitbitのライフログは削除
text = text[text.str.contains("おはようございます。今日は") == False]
len(text)
3705
!sudo apt install mecab libmecab-dev mecab-ipadic mecab-ipadic-utf8
!pip install mecab-python3
import MeCab
m = MeCab.Tagger("-Owakati")
items = m.parse("安倍晋三首相は、国会で施政方針演説を行った。")
print(items)
安倍晋三首相 は 、 国会 で 施政方針演説 を 行っ た 。
import re
f_out = open("tweets_wakati.txt", "w" )
for line in text.iteritems():
line = re.sub('https?://[\w/:%#\$&\?\(\)~\.=\+\-…]+','', line[1])
line = re.sub('RT', "", line)
line = re.sub(r'[!-~]', "", line)#半角記号,数字,英字
line = re.sub(r'[︰-@]', "", line)#全角記号
line = re.sub('\n', " ", line)#改行文字
f_out.write(m.parse(line))
f_out.close()
ここからは、以下の実装をそのまま。
from collections import Counter
def preprocess(text):
# Replace punctuation with tokens so we can use them in our model
text = text.lower()
text = text.replace('。', ' <MARU> ')
text = text.replace('、', ' <TEN> ')
text = text.replace('"', ' <QUOTATION_MARK> ')
text = text.replace(';', ' <SEMICOLON> ')
text = text.replace('!', ' <EXCLAMATION_MARK> ')
text = text.replace('?', ' <QUESTION_MARK> ')
text = text.replace('(', ' <LEFT_PAREN> ')
text = text.replace(')', ' <RIGHT_PAREN> ')
text = text.replace('(', ' <LEFT_PAREN_ZENKAKU> ')
text = text.replace(')', ' <RIGHT_PAREN_ZENKAKU> ')
text = text.replace('「', ' <LEFT_KAKKO> ')
text = text.replace('」', ' <RIGHT_KAKKO> ')
text = text.replace('--', ' <HYPHENS> ')
text = text.replace('?', ' <QUESTION_MARK> ')
# text = text.replace('\n', ' <NEW_LINE> ')
text = text.replace(':', ' <COLON> ')
words = text.split()
# Remove all words with 5 or fewer occurences
word_counts = Counter(words)
trimmed_words = [word for word in words if word_counts[word] > 5]
return trimmed_words
def get_batches(int_text, batch_size, seq_length):
"""
Return batches of input and target
:param int_text: Text with the words replaced by their ids
:param batch_size: The size of batch
:param seq_length: The length of sequence
:return: A list where each item is a tuple of (batch of input, batch of target).
"""
n_batches = int(len(int_text) / (batch_size * seq_length))
# Drop the last few characters to make only full batches
xdata = np.array(int_text[: n_batches * batch_size * seq_length])
ydata = np.array(int_text[1: n_batches * batch_size * seq_length + 1])
x_batches = np.split(xdata.reshape(batch_size, -1), n_batches, 1)
y_batches = np.split(ydata.reshape(batch_size, -1), n_batches, 1)
return list(zip(x_batches, y_batches))
def create_lookup_tables(words):
"""
Create lookup tables for vocabulary
:param words: Input list of words
:return: A tuple of dicts. The first dict....
"""
word_counts = Counter(words)
sorted_vocab = sorted(word_counts, key=word_counts.get, reverse=True)
int_to_vocab = {ii: word for ii, word in enumerate(sorted_vocab)}
vocab_to_int = {word: ii for ii, word in int_to_vocab.items()}
return vocab_to_int, int_to_vocab
with open('tweets_wakati.txt') as f:
text = f.read()
words = preprocess(text)
print(words[:30])
['ありがとう', 'ござい', 'ます', '<MARU>', 'リーディング', 'だっ', 'た', 'けれども', '<TEN>', '自分', 'の', '点数', 'が', 'た', 'の', 'が', '不思議', 'です', '<MARU>', 'きっと', '点', 'は', 'ので', '点数', 'が', '良かっ', 'た', 'の', 'でしょ', 'う']
print("Total words: {}".format(len(words)))
print("Unique words: {}".format(len(set(words))))
Total words: 56351 Unique words: 1254
vocab_to_int, int_to_vocab = create_lookup_tables(words)
int_words = [vocab_to_int[word] for word in words]
from collections import Counter
import random
threshold = 1e-3
word_counts = Counter(int_words)
total_count = len(int_words)
freqs = {word: count/total_count for word, count in word_counts.items()}
p_drop = {word: 1 - np.sqrt(threshold/freqs[word]) for word in word_counts}
train_words = [word for word in int_words if random.random() < (1 - p_drop[word])]
def get_target(words, idx, window_size=5):
''' Get a list of words in a window around an index. '''
R = np.random.randint(1, window_size+1)
start = idx - R if (idx - R) > 0 else 0
stop = idx + R
target_words = set(words[start:idx] + words[idx+1:stop+1])
return list(target_words)
def get_batches(words, batch_size, window_size=5):
''' Create a generator of word batches as a tuple (inputs, targets) '''
n_batches = len(words)//batch_size
# only full batches
words = words[:n_batches*batch_size]
for idx in range(0, len(words), batch_size):
x, y = [], []
batch = words[idx:idx+batch_size]
for ii in range(len(batch)):
batch_x = batch[ii]
batch_y = get_target(batch, ii, window_size)
y.extend(batch_y)
x.extend([batch_x]*len(batch_y))
yield x, y
train_graph = tf.Graph()
with train_graph.as_default():
inputs = tf.placeholder(tf.int32, [None], name='inputs')
labels = tf.placeholder(tf.int32, [None, None], name='labels')
n_vocab = len(int_to_vocab)
n_embedding = 50 # Number of embedding features
with train_graph.as_default():
embedding = tf.Variable(tf.random_uniform((n_vocab, n_embedding), -1, 1))
embed = tf.nn.embedding_lookup(embedding, inputs)
n_sampled = 100
with train_graph.as_default():
softmax_w = tf.Variable(tf.truncated_normal((n_vocab, n_embedding), stddev=0.1))
softmax_b = tf.Variable(tf.zeros(n_vocab))
# Calculate the loss using negative sampling
loss = tf.nn.sampled_softmax_loss(softmax_w, softmax_b,
labels, embed,
n_sampled, n_vocab)
cost = tf.reduce_mean(loss)
optimizer = tf.train.AdamOptimizer().minimize(cost)
with train_graph.as_default():
## From Thushan Ganegedara's implementation
valid_size = 16 # Random set of words to evaluate similarity on.
valid_window = 20
# pick 8 samples from (0,100) and (1000,1100) each ranges. lower id implies more frequent
valid_examples = np.array(random.sample(range(valid_window), valid_size//2))
valid_examples = np.append(valid_examples,
random.sample(range(1000,1000+valid_window), valid_size//2))
valid_dataset = tf.constant(valid_examples, dtype=tf.int32)
# We use the cosine distance:
norm = tf.sqrt(tf.reduce_sum(tf.square(embedding), 1, keep_dims=True))
normalized_embedding = embedding / norm
valid_embedding = tf.nn.embedding_lookup(normalized_embedding, valid_dataset)
similarity = tf.matmul(valid_embedding, tf.transpose(normalized_embedding))
!mkdir checkpoints
mkdir: ディレクトリ `checkpoints' を作成できません: ファイルが存在します
epochs = 30
batch_size = 50
window_size = 10
with train_graph.as_default():
saver = tf.train.Saver()
with tf.Session(graph=train_graph) as sess:
iteration = 1
loss = 0
sess.run(tf.global_variables_initializer())
for e in range(1, epochs+1):
batches = get_batches(train_words, batch_size, window_size)
start = time.time()
for x, y in batches:
feed = {inputs: x,
labels: np.array(y)[:, None]}
train_loss, _ = sess.run([cost, optimizer], feed_dict=feed)
loss += train_loss
if iteration % 100 == 0:
end = time.time()
print("Epoch {}/{}".format(e, epochs),
"Iteration: {}".format(iteration),
"Avg. Training loss: {:.4f}".format(loss/100),
"{:.4f} sec/batch".format((end-start)/100))
loss = 0
start = time.time()
if iteration % 1000 == 0:
# note that this is expensive (~20% slowdown if computed every 500 steps)
sim = similarity.eval()
for i in range(valid_size):
valid_word = int_to_vocab[valid_examples[i]]
top_k = 8 # number of nearest neighbors
nearest = (-sim[i, :]).argsort()[1:top_k+1]
log = 'Nearest to %s:' % valid_word
for k in range(top_k):
close_word = int_to_vocab[nearest[k]]
log = '%s %s,' % (log, close_word)
print(log)
iteration += 1
save_path = saver.save(sess, "checkpoints/text8.ckpt")
embed_mat = sess.run(normalized_embedding)
Epoch 1/30 Iteration: 100 Avg. Training loss: 5.1923 0.0076 sec/batch Epoch 1/30 Iteration: 200 Avg. Training loss: 5.2993 0.0070 sec/batch Epoch 1/30 Iteration: 300 Avg. Training loss: 5.2376 0.0072 sec/batch Epoch 1/30 Iteration: 400 Avg. Training loss: 5.1827 0.0073 sec/batch Epoch 1/30 Iteration: 500 Avg. Training loss: 5.1205 0.0073 sec/batch Epoch 2/30 Iteration: 600 Avg. Training loss: 5.0675 0.0017 sec/batch Epoch 2/30 Iteration: 700 Avg. Training loss: 4.9672 0.0072 sec/batch Epoch 2/30 Iteration: 800 Avg. Training loss: 4.9850 0.0079 sec/batch Epoch 2/30 Iteration: 900 Avg. Training loss: 4.8912 0.0081 sec/batch Epoch 2/30 Iteration: 1000 Avg. Training loss: 4.8460 0.0079 sec/batch Nearest to な: 完了, 気分, たい, は, まで, 公開, カッコ, アップ, Nearest to で: 聴い, どの, 部屋, 考える, クラシック, 読ん, られ, 昼間, Nearest to が: 】, すでに, まし, どちら, 気, 止まっ, 朝, まあ, Nearest to か: ノ, お昼, まあ, そして, 公開, 音楽, なかっ, 明日, Nearest to を: 気づい, さてと, 足, 半, みる, だろ, 『, なる, Nearest to は: 記事, だっ, チェック, <LEFT_KAKKO>, な, 分, 笑い, た, Nearest to だ: ギンレイホール, 耳, やめ, あまり, 受験, 久しぶり, オペラ, すぎ, Nearest to に: と, 朝, <RIGHT_KAKKO>, 天才, ず, くれ, 度, はず, Nearest to おなか: みよ, き, 町田駅, パレス, すれ, 遅刻, 出て, あり, Nearest to 絶対: 目, 心配, 素晴らしい, ばかり, 夏, サイト, 定時, 自動, Nearest to ただ: 写真, 尻, どちら, 一緒, 二, ダイエット, 都響, 志らく, Nearest to 先週: 必要, 瞑想, 作っ, インバル, わかる, より, ワーグナー, 買う, Nearest to 上野: もっと, なるほど, ない, どう, 図書館, 変え, 昼休み, 障害, Nearest to 帰ろ: 問, 頑張る, 時に, 言語, レビュー, わかっ, なかなか, 表現, Nearest to 周り: かかる, 場合, 始める, ワープ, 続ける, だって, 第九, 言語, Nearest to 二期会: 幕, 読売日響, 悪く, プラグイン, やっ, 残念, 音, あれ, Epoch 2/30 Iteration: 1100 Avg. Training loss: 4.8159 0.0074 sec/batch Epoch 3/30 Iteration: 1200 Avg. Training loss: 4.7581 0.0039 sec/batch Epoch 3/30 Iteration: 1300 Avg. Training loss: 4.7196 0.0072 sec/batch Epoch 3/30 Iteration: 1400 Avg. Training loss: 4.7154 0.0088 sec/batch Epoch 3/30 Iteration: 1500 Avg. Training loss: 4.6805 0.0085 sec/batch Epoch 3/30 Iteration: 1600 Avg. Training loss: 4.6433 0.0074 sec/batch Epoch 3/30 Iteration: 1700 Avg. Training loss: 4.6657 0.0073 sec/batch Epoch 4/30 Iteration: 1800 Avg. Training loss: 4.6369 0.0058 sec/batch Epoch 4/30 Iteration: 1900 Avg. Training loss: 4.6280 0.0074 sec/batch Epoch 4/30 Iteration: 2000 Avg. Training loss: 4.6044 0.0075 sec/batch Nearest to な: 気分, 完了, たい, 過去, まで, …, うわ, 容量, Nearest to で: 聴い, クラシック, どの, 考える, 帰っ, 部屋, られ, 読ん, Nearest to が: すでに, 朝, どちら, 気, 障害, 止まっ, 】, 世間, Nearest to か: ノ, お昼, そして, まあ, けれど, 中, 音楽, 公開, Nearest to を: 気づい, さてと, 足, 半, たく, 『, みる, かけて, Nearest to は: <LEFT_KAKKO>, マーラー, 記事, チェック, 分, だっ, 笑い, 思え, Nearest to だ: ギンレイホール, 耳, やめ, 受験, オペラ, あまり, 久しぶり, 頑張る, Nearest to に: 朝, と, 度, そのまま, 早速, 聞い, ず, 天才, Nearest to おなか: みよ, き, 町田駅, 時, 遅刻, すれ, パレス, 出て, Nearest to 絶対: 目, 心配, 素晴らしい, 夏, 定時, サイト, 自動, 壱番屋, Nearest to ただ: 写真, 尻, どちら, 一緒, ダイエット, 二, 本, これ, Nearest to 先週: 必要, 瞑想, インバル, 作っ, わかる, より, ワーグナー, なかっ, Nearest to 上野: もっと, ない, なるほど, 図書館, どう, 変え, 昼休み, ます, Nearest to 帰ろ: 問, 時に, 頑張る, 言語, わかっ, レビュー, 退社, なかなか, Nearest to 周り: かかる, 場合, 始める, 結局, 続ける, だって, 言語, 始め, Nearest to 二期会: 幕, 悪く, やっ, 残念, まずは, 音, プラグイン, 回, Epoch 4/30 Iteration: 2100 Avg. Training loss: 4.5965 0.0075 sec/batch Epoch 4/30 Iteration: 2200 Avg. Training loss: 4.5665 0.0075 sec/batch Epoch 4/30 Iteration: 2300 Avg. Training loss: 4.5891 0.0073 sec/batch Epoch 5/30 Iteration: 2400 Avg. Training loss: 4.5738 0.0079 sec/batch Epoch 5/30 Iteration: 2500 Avg. Training loss: 4.5806 0.0077 sec/batch Epoch 5/30 Iteration: 2600 Avg. Training loss: 4.5457 0.0088 sec/batch Epoch 5/30 Iteration: 2700 Avg. Training loss: 4.5506 0.0076 sec/batch Epoch 5/30 Iteration: 2800 Avg. Training loss: 4.5277 0.0073 sec/batch Epoch 6/30 Iteration: 2900 Avg. Training loss: 4.5477 0.0017 sec/batch Epoch 6/30 Iteration: 3000 Avg. Training loss: 4.5393 0.0072 sec/batch Nearest to な: 気分, 完了, たい, 過去, まで, …, うわ, 容量, Nearest to で: 聴い, 考える, 帰っ, クラシック, どの, 部屋, られ, フィル, Nearest to が: 朝, 障害, 世間, 気, ブロムシュテット, すでに, どちら, 止まっ, Nearest to か: ノ, お昼, そして, けれど, まあ, 一緒, 読み, 使う, Nearest to を: 気づい, 足, さてと, たく, すごく, みる, 半, たかっ, Nearest to は: マーラー, <LEFT_KAKKO>, チェック, 分, くん, 思え, 経っ, だっ, Nearest to だ: ギンレイホール, やめ, 耳, ♪, 受験, オペラ, 頑張る, なに, Nearest to に: 朝, 度, と, そのまま, とりあえず, 聞い, 早速, ず, Nearest to おなか: みよ, き, 時, 町田駅, すれ, あり, 遅刻, パレス, Nearest to 絶対: 目, 心配, 素晴らしい, 定時, 魅力, サイト, 夏, 自動, Nearest to ただ: 写真, どちら, 一緒, 尻, カッコ, 本, が, これ, Nearest to 先週: 必要, インバル, 瞑想, 作っ, わかる, なかっ, より, ワーグナー, Nearest to 上野: もっと, なるほど, ない, 図書館, 昼休み, 変え, どうも, 障害, Nearest to 帰ろ: 問, 言語, 時に, 頑張る, わかっ, なかなか, けど, 退社, Nearest to 周り: かかる, 場合, 始める, 結局, 続ける, 始め, オペラ劇場, だって, Nearest to 二期会: 幕, 回, まずは, 残念, 悪く, 迫力, プラグイン, 音, Epoch 6/30 Iteration: 3100 Avg. Training loss: 4.5286 0.0070 sec/batch Epoch 6/30 Iteration: 3200 Avg. Training loss: 4.5259 0.0071 sec/batch Epoch 6/30 Iteration: 3300 Avg. Training loss: 4.4993 0.0071 sec/batch Epoch 6/30 Iteration: 3400 Avg. Training loss: 4.5210 0.0070 sec/batch Epoch 7/30 Iteration: 3500 Avg. Training loss: 4.5128 0.0035 sec/batch Epoch 7/30 Iteration: 3600 Avg. Training loss: 4.5072 0.0071 sec/batch Epoch 7/30 Iteration: 3700 Avg. Training loss: 4.5064 0.0071 sec/batch Epoch 7/30 Iteration: 3800 Avg. Training loss: 4.5041 0.0072 sec/batch Epoch 7/30 Iteration: 3900 Avg. Training loss: 4.4691 0.0072 sec/batch Epoch 7/30 Iteration: 4000 Avg. Training loss: 4.5122 0.0071 sec/batch Nearest to な: 気分, 完了, 過去, まで, たい, …, うわ, 容量, Nearest to で: 聴い, 考える, 帰っ, どの, クラシック, 部屋, られ, フィル, Nearest to が: 朝, 気, 障害, 世間, ブロムシュテット, きっと, すでに, 三, Nearest to か: ノ, けれど, お昼, そして, 一緒, 仕様, まあ, 使う, Nearest to を: 気づい, 足, さてと, すごく, たく, たかっ, 『, 始まっ, Nearest to は: マーラー, 分, チェック, くん, 経っ, だっ, 思え, <LEFT_KAKKO>, Nearest to だ: やめ, 耳, ギンレイホール, ♪, 完全, 受験, 頑張る, 捨て, Nearest to に: 朝, 度, そのまま, とりあえず, と, ず, 早速, 聞い, Nearest to おなか: みよ, 町田駅, き, すれ, あり, あの, 遅刻, 来週, Nearest to 絶対: 目, 心配, 仕様, 素晴らしい, 発表, サイト, 買っ, 魅力, Nearest to ただ: 写真, どちら, 一緒, カッコ, 尻, 本, これ, 関係, Nearest to 先週: 必要, 作っ, インバル, 瞑想, より, 次, わかる, なかっ, Nearest to 上野: もっと, 図書館, 昼休み, 障害, なるほど, どうも, ない, スーツ, Nearest to 帰ろ: 問, 言語, 時に, わかっ, なかなか, けど, 頑張る, 自分, Nearest to 周り: かかる, 場合, 始める, 結局, オペラ劇場, 続ける, 始め, スペース, Nearest to 二期会: 幕, 回, 迫力, 最後, まずは, 怖い, 春, 音, Epoch 8/30 Iteration: 4100 Avg. Training loss: 4.4871 0.0054 sec/batch Epoch 8/30 Iteration: 4200 Avg. Training loss: 4.5000 0.0073 sec/batch Epoch 8/30 Iteration: 4300 Avg. Training loss: 4.4791 0.0070 sec/batch Epoch 8/30 Iteration: 4400 Avg. Training loss: 4.4836 0.0071 sec/batch Epoch 8/30 Iteration: 4500 Avg. Training loss: 4.4528 0.0071 sec/batch Epoch 8/30 Iteration: 4600 Avg. Training loss: 4.4930 0.0071 sec/batch Epoch 9/30 Iteration: 4700 Avg. Training loss: 4.4668 0.0072 sec/batch Epoch 9/30 Iteration: 4800 Avg. Training loss: 4.4837 0.0071 sec/batch Epoch 9/30 Iteration: 4900 Avg. Training loss: 4.4620 0.0071 sec/batch Epoch 9/30 Iteration: 5000 Avg. Training loss: 4.4708 0.0071 sec/batch Nearest to な: 気分, 完了, 過去, まで, うわ, 腰, たい, そのまま, Nearest to で: 聴い, 考える, どの, 帰っ, クラシック, られ, 部屋, フィル, Nearest to が: 気, 世間, 朝, 障害, きっと, ブロムシュテット, いきなり, 止まっ, Nearest to か: ノ, けれど, 一緒, お昼, そして, 思っ, 仕様, 使う, Nearest to を: 気づい, 足, すごく, さてと, たく, 『, し, たかっ, Nearest to は: マーラー, 分, 経っ, 思え, だっ, くん, チェック, 演奏会, Nearest to だ: やめ, 耳, ♪, ギンレイホール, 完全, 捨て, つらい, 受験, Nearest to に: 朝, 度, そのまま, とりあえず, ず, パソコン, 早速, と, Nearest to おなか: みよ, 町田駅, き, 来週, パレス, あの, 美味しい, 出て, Nearest to 絶対: 目, 心配, 仕様, 発表, 買っ, スープ, 機能, サイト, Nearest to ただ: 写真, どちら, 一緒, カッコ, 尻, 本, 関係, これ, Nearest to 先週: 必要, 作っ, 次, より, 瞑想, なかっ, 買う, インバル, Nearest to 上野: もっと, 図書館, スーツ, 昼休み, 障害, どうも, 映画, 外食, Nearest to 帰ろ: 言語, 問, 時に, なかなか, わかっ, 自分, けど, 表現, Nearest to 周り: かかる, 始める, 場合, 結局, 第九, オペラ劇場, スペース, 続ける, Nearest to 二期会: 幕, 迫力, 春, 回, 音, ワーグナー, 最後, まずは, Epoch 9/30 Iteration: 5100 Avg. Training loss: 4.4514 0.0072 sec/batch Epoch 10/30 Iteration: 5200 Avg. Training loss: 4.4686 0.0018 sec/batch Epoch 10/30 Iteration: 5300 Avg. Training loss: 4.4522 0.0075 sec/batch Epoch 10/30 Iteration: 5400 Avg. Training loss: 4.4562 0.0071 sec/batch Epoch 10/30 Iteration: 5500 Avg. Training loss: 4.4599 0.0072 sec/batch Epoch 10/30 Iteration: 5600 Avg. Training loss: 4.4322 0.0071 sec/batch Epoch 10/30 Iteration: 5700 Avg. Training loss: 4.4522 0.0070 sec/batch Epoch 11/30 Iteration: 5800 Avg. Training loss: 4.4406 0.0035 sec/batch Epoch 11/30 Iteration: 5900 Avg. Training loss: 4.4453 0.0071 sec/batch Epoch 11/30 Iteration: 6000 Avg. Training loss: 4.4369 0.0070 sec/batch Nearest to な: 気分, 完了, 過去, まで, 腰, うわ, すごい, たい, Nearest to で: 聴い, 考える, 帰っ, クラシック, どの, 部屋, られ, 読ん, Nearest to が: 気, 世間, きっと, 朝, 障害, いきなり, ただ, 帰れ, Nearest to か: ノ, 一緒, けれど, 帰れ, コース, 使う, 思っ, きた, Nearest to を: 気づい, 足, すごく, たく, さてと, し, 『, たかっ, Nearest to は: 分, マーラー, くん, だっ, 経っ, 思え, 乗っ, いつか, Nearest to だ: 耳, やめ, 完全, ♪, つらい, 捨て, ギンレイホール, プロジェクト, Nearest to に: 朝, 度, そのまま, ず, とりあえず, 言っ, パソコン, 早速, Nearest to おなか: みよ, 町田駅, 増え, 来週, あの, 美味しい, き, 深夜, Nearest to 絶対: 目, 心配, 発表, 機能, 仕様, 買っ, スープ, サイト, Nearest to ただ: 一緒, 写真, どちら, カッコ, 尻, 関係, 本, が, Nearest to 先週: 必要, 作っ, 次, 買う, より, なかっ, 瞑想, インバル, Nearest to 上野: もっと, 図書館, スーツ, 障害, どうも, 映画, 味, 外食, Nearest to 帰ろ: 言語, 問, 時に, わかっ, なかなか, 自分, けど, られる, Nearest to 周り: かかる, 始める, 場合, 第九, 結局, コーディング, オペラ劇場, 腰, Nearest to 二期会: 幕, 迫力, 春, 回, ワーグナー, 音, 怖い, 読売日響, Epoch 11/30 Iteration: 6100 Avg. Training loss: 4.4531 0.0073 sec/batch Epoch 11/30 Iteration: 6200 Avg. Training loss: 4.4071 0.0071 sec/batch Epoch 11/30 Iteration: 6300 Avg. Training loss: 4.4545 0.0070 sec/batch Epoch 12/30 Iteration: 6400 Avg. Training loss: 4.4067 0.0054 sec/batch Epoch 12/30 Iteration: 6500 Avg. Training loss: 4.4474 0.0072 sec/batch Epoch 12/30 Iteration: 6600 Avg. Training loss: 4.4251 0.0071 sec/batch Epoch 12/30 Iteration: 6700 Avg. Training loss: 4.4359 0.0072 sec/batch Epoch 12/30 Iteration: 6800 Avg. Training loss: 4.4073 0.0071 sec/batch Epoch 12/30 Iteration: 6900 Avg. Training loss: 4.4420 0.0072 sec/batch Epoch 13/30 Iteration: 7000 Avg. Training loss: 4.3905 0.0071 sec/batch Nearest to な: 気分, 完了, まで, 過去, 腰, うわ, すごい, たい, Nearest to で: 聴い, 考える, クラシック, 帰っ, どの, られ, 読ん, 部屋, Nearest to が: 気, きっと, 世間, 障害, 朝, いきなり, ただ, れ, Nearest to か: ノ, 一緒, けれど, 帰れ, コース, きた, 思っ, 使う, Nearest to を: 気づい, 足, すごく, たく, たかっ, さてと, 泣い, かけて, Nearest to は: 分, マーラー, 乗っ, くん, 経っ, 思え, だっ, 大きな, Nearest to だ: やめ, 耳, 完全, ♪, つらい, プロジェクト, 買っ, 捨て, Nearest to に: 朝, とりあえず, 度, ず, 言っ, そのまま, 早速, パソコン, Nearest to おなか: みよ, 増え, あの, 来週, クラシック, 町田駅, 深夜, 美味しい, Nearest to 絶対: 目, 心配, 発表, 機能, 仕様, 買っ, 初, ストレージ, Nearest to ただ: どちら, 一緒, カッコ, 写真, 尻, 関係, 本, が, Nearest to 先週: 必要, 次, 作っ, 買う, より, なかっ, 週, 瞑想, Nearest to 上野: もっと, 図書館, スーツ, 味, どうも, 障害, 映画, 関係, Nearest to 帰ろ: 言語, 時に, 問, けど, 自分, わかっ, なかなか, られる, Nearest to 周り: かかる, 始める, 腰, 第九, コーディング, 結局, オペラ劇場, 場合, Nearest to 二期会: 幕, 迫力, 春, ワーグナー, 回, 怖い, 音, つけ麺, Epoch 13/30 Iteration: 7100 Avg. Training loss: 4.4306 0.0071 sec/batch Epoch 13/30 Iteration: 7200 Avg. Training loss: 4.4084 0.0072 sec/batch Epoch 13/30 Iteration: 7300 Avg. Training loss: 4.4281 0.0072 sec/batch Epoch 13/30 Iteration: 7400 Avg. Training loss: 4.4055 0.0071 sec/batch Epoch 14/30 Iteration: 7500 Avg. Training loss: 4.4149 0.0018 sec/batch Epoch 14/30 Iteration: 7600 Avg. Training loss: 4.3835 0.0072 sec/batch Epoch 14/30 Iteration: 7700 Avg. Training loss: 4.4086 0.0070 sec/batch Epoch 14/30 Iteration: 7800 Avg. Training loss: 4.4150 0.0073 sec/batch Epoch 14/30 Iteration: 7900 Avg. Training loss: 4.3908 0.0079 sec/batch Epoch 14/30 Iteration: 8000 Avg. Training loss: 4.4172 0.0088 sec/batch Nearest to な: 気分, 完了, 腰, 過去, まで, 読め, うわ, 安い, Nearest to で: 聴い, 考える, クラシック, どの, 帰っ, られ, 読ん, 部屋, Nearest to が: 気, きっと, 世間, いきなり, 朝, ただ, 障害, れ, Nearest to か: ノ, 一緒, けれど, 帰れ, 使う, コース, いれ, 思っ, Nearest to を: 気づい, すごく, 足, たく, たかっ, し, 『, 泣い, Nearest to は: 分, マーラー, 乗っ, 思え, 最後, だっ, 時, 経っ, Nearest to だ: やめ, 耳, 完全, ♪, つらい, 買っ, プロジェクト, 派手, Nearest to に: とりあえず, 度, ず, 言っ, 朝, パソコン, そのまま, で, Nearest to おなか: みよ, 増え, 来週, あの, クラシック, き, 深夜, 町田駅, Nearest to 絶対: 目, 発表, 心配, 機能, 仕様, 買っ, 初, スープ, Nearest to ただ: どちら, 一緒, カッコ, 写真, 関係, 尻, 用, が, Nearest to 先週: 必要, 作っ, 次, より, 買う, なかっ, やめ, 週, Nearest to 上野: もっと, 味, どうも, 図書館, スーツ, 映画, いただき, 関係, Nearest to 帰ろ: 言語, 時に, 問, わかっ, けど, 自分, 電話, なかなか, Nearest to 周り: かかる, 始める, 腰, コーディング, 第九, 場合, オペラ劇場, スペース, Nearest to 二期会: 幕, 春, 迫力, ワーグナー, 音, 怖い, 回, つけ麺, Epoch 15/30 Iteration: 8100 Avg. Training loss: 4.3862 0.0045 sec/batch Epoch 15/30 Iteration: 8200 Avg. Training loss: 4.3863 0.0087 sec/batch Epoch 15/30 Iteration: 8300 Avg. Training loss: 4.3912 0.0081 sec/batch Epoch 15/30 Iteration: 8400 Avg. Training loss: 4.4139 0.0083 sec/batch Epoch 15/30 Iteration: 8500 Avg. Training loss: 4.3669 0.0086 sec/batch Epoch 15/30 Iteration: 8600 Avg. Training loss: 4.4177 0.0071 sec/batch Epoch 16/30 Iteration: 8700 Avg. Training loss: 4.3388 0.0054 sec/batch Epoch 16/30 Iteration: 8800 Avg. Training loss: 4.4034 0.0080 sec/batch Epoch 16/30 Iteration: 8900 Avg. Training loss: 4.3803 0.0087 sec/batch Epoch 16/30 Iteration: 9000 Avg. Training loss: 4.3947 0.0084 sec/batch Nearest to な: 気分, 完了, 腰, まで, 過去, 読め, うわ, 安い, Nearest to で: 聴い, 考える, 帰っ, クラシック, どの, られ, 読ん, に, Nearest to が: 気, きっと, いきなり, 世間, ただ, 障害, れ, 朝, Nearest to か: 一緒, ノ, けれど, 帰れ, 夕飯, コース, 思っ, 使う, Nearest to を: 気づい, すごく, 足, たく, たかっ, 『, 泣い, し, Nearest to は: 分, マーラー, 乗っ, 思え, 最後, 時, だっ, 経っ, Nearest to だ: 耳, 完全, やめ, ♪, 買っ, 派手, プロジェクト, 捨て, Nearest to に: 言っ, とりあえず, 度, ず, 朝, で, 力, そのまま, Nearest to おなか: みよ, 増え, 来週, クラシック, あの, 深夜, 美味しい, 町田駅, Nearest to 絶対: 目, 発表, 機能, 心配, 仕様, 買っ, 初, スープ, Nearest to ただ: 一緒, どちら, カッコ, 写真, 関係, 尻, 用, が, Nearest to 先週: 必要, 次, 作っ, より, 買う, なかっ, やめ, やっと, Nearest to 上野: 味, もっと, 図書館, 映画, どうも, お腹, いただき, 関係, Nearest to 帰ろ: 言語, 時に, わかっ, けど, 問, 自分, たかっ, 電話, Nearest to 周り: かかる, 始める, 腰, コーディング, 第九, ワープ, スペース, オペラ劇場, Nearest to 二期会: 幕, 春, 迫力, ワーグナー, 音, つけ麺, 怖い, 回, Epoch 16/30 Iteration: 9100 Avg. Training loss: 4.3707 0.0078 sec/batch Epoch 16/30 Iteration: 9200 Avg. Training loss: 4.4092 0.0082 sec/batch Epoch 17/30 Iteration: 9300 Avg. Training loss: 4.3229 0.0077 sec/batch Epoch 17/30 Iteration: 9400 Avg. Training loss: 4.3942 0.0071 sec/batch Epoch 17/30 Iteration: 9500 Avg. Training loss: 4.3722 0.0071 sec/batch Epoch 17/30 Iteration: 9600 Avg. Training loss: 4.3917 0.0073 sec/batch Epoch 17/30 Iteration: 9700 Avg. Training loss: 4.3613 0.0072 sec/batch Epoch 18/30 Iteration: 9800 Avg. Training loss: 4.3638 0.0018 sec/batch Epoch 18/30 Iteration: 9900 Avg. Training loss: 4.3271 0.0073 sec/batch Epoch 18/30 Iteration: 10000 Avg. Training loss: 4.3721 0.0081 sec/batch Nearest to な: 気分, 腰, まで, 完了, 過去, 読め, 安い, という, Nearest to で: 聴い, 考える, 読ん, クラシック, 帰っ, どの, られ, に, Nearest to が: 気, きっと, いきなり, 世間, ただ, 障害, 帰れ, 朝, Nearest to か: 一緒, けれど, 帰れ, ノ, 思っ, 夕飯, コース, 使う, Nearest to を: 気づい, すごく, 足, たく, たかっ, 『, し, コーヒー, Nearest to は: 分, 乗っ, マーラー, 最後, 思え, 時, だっ, ラフマニノフ, Nearest to だ: 完全, やめ, 耳, 派手, ♪, 買っ, 捨て, つらい, Nearest to に: 言っ, とりあえず, 度, 力, で, 花粉, 朝, ず, Nearest to おなか: みよ, 増え, クラシック, あの, 来週, 深夜, 美味しい, 町田駅, Nearest to 絶対: 目, 発表, 機能, 心配, 仕様, 初, 買っ, や, Nearest to ただ: 一緒, どちら, カッコ, 写真, 関係, 用, 尻, が, Nearest to 先週: 必要, 次, 買う, 作っ, やめ, より, なかっ, やっと, Nearest to 上野: 味, もっと, お腹, レ・ミゼラブル, 関係, 映画, いただき, ヴェルディ, Nearest to 帰ろ: 言語, 時に, わかっ, けど, たかっ, 問, 自分, 元気, Nearest to 周り: かかる, 始める, 腰, コーディング, 第九, ワープ, 停電, 出来, Nearest to 二期会: 幕, 春, 迫力, ワーグナー, つけ麺, 音, 怖い, 読売日響, Epoch 18/30 Iteration: 10100 Avg. Training loss: 4.3780 0.0077 sec/batch Epoch 18/30 Iteration: 10200 Avg. Training loss: 4.3558 0.0079 sec/batch Epoch 18/30 Iteration: 10300 Avg. Training loss: 4.3811 0.0080 sec/batch Epoch 19/30 Iteration: 10400 Avg. Training loss: 4.3476 0.0035 sec/batch Epoch 19/30 Iteration: 10500 Avg. Training loss: 4.3339 0.0072 sec/batch Epoch 19/30 Iteration: 10600 Avg. Training loss: 4.3575 0.0072 sec/batch Epoch 19/30 Iteration: 10700 Avg. Training loss: 4.3821 0.0072 sec/batch Epoch 19/30 Iteration: 10800 Avg. Training loss: 4.3350 0.0072 sec/batch Epoch 19/30 Iteration: 10900 Avg. Training loss: 4.3795 0.0073 sec/batch Epoch 20/30 Iteration: 11000 Avg. Training loss: 4.2896 0.0054 sec/batch Nearest to な: 気分, 腰, まで, 読め, 完了, 過去, という, 方, Nearest to で: 聴い, 考える, クラシック, 読ん, 帰っ, られ, どの, も, Nearest to が: 気, きっと, いきなり, ただ, 世間, 帰れ, 障害, れ, Nearest to か: 一緒, けれど, 帰れ, 思っ, ノ, 使う, 夕飯, いれ, Nearest to を: 気づい, すごく, 足, たく, たかっ, 泣い, やっぱり, 口, Nearest to は: 分, 乗っ, マーラー, 思え, 時, 最後, だっ, ラフマニノフ, Nearest to だ: 完全, 耳, 派手, やめ, ♪, 買っ, プロジェクト, よく, Nearest to に: とりあえず, 言っ, で, 度, ず, 力, 早速, 未来, Nearest to おなか: みよ, 増え, あの, クラシック, 来週, 美味しい, 深夜, 町田駅, Nearest to 絶対: 発表, 目, 機能, 心配, 初, 仕様, や, スープ, Nearest to ただ: どちら, 一緒, カッコ, 関係, 用, 写真, 尻, が, Nearest to 先週: 必要, 次, やめ, 買う, やっと, 作っ, より, なかっ, Nearest to 上野: 味, もっと, レ・ミゼラブル, お腹, いただき, 関係, ヴェルディ, 映画, Nearest to 帰ろ: 言語, 時に, わかっ, けど, たかっ, お金, 紙, 使え, Nearest to 周り: かかる, 始める, 腰, コーディング, 出来, 停電, 第九, ワープ, Nearest to 二期会: 幕, 春, 迫力, ワーグナー, つけ麺, 怖い, 音, 読売日響, Epoch 20/30 Iteration: 11100 Avg. Training loss: 4.3695 0.0072 sec/batch Epoch 20/30 Iteration: 11200 Avg. Training loss: 4.3495 0.0071 sec/batch Epoch 20/30 Iteration: 11300 Avg. Training loss: 4.3697 0.0071 sec/batch Epoch 20/30 Iteration: 11400 Avg. Training loss: 4.3318 0.0072 sec/batch Epoch 20/30 Iteration: 11500 Avg. Training loss: 4.3758 0.0071 sec/batch Epoch 21/30 Iteration: 11600 Avg. Training loss: 4.2708 0.0071 sec/batch Epoch 21/30 Iteration: 11700 Avg. Training loss: 4.3620 0.0071 sec/batch Epoch 21/30 Iteration: 11800 Avg. Training loss: 4.3433 0.0079 sec/batch Epoch 21/30 Iteration: 11900 Avg. Training loss: 4.3539 0.0072 sec/batch Epoch 21/30 Iteration: 12000 Avg. Training loss: 4.3326 0.0075 sec/batch Nearest to な: 気分, 腰, 読め, まで, 過去, という, 完了, たい, Nearest to で: 聴い, 考える, 読ん, クラシック, られ, どの, も, 昼間, Nearest to が: 気, いきなり, きっと, れ, 止まっ, ただ, 関係, 障害, Nearest to か: 一緒, けれど, 帰れ, 思っ, 掃除, 夕飯, 使う, いれ, Nearest to を: 気づい, すごく, 足, たく, たかっ, 口, 泣い, やっぱり, Nearest to は: 分, 乗っ, マーラー, 思え, 時, 最後, だっ, いろいろ, Nearest to だ: 完全, 派手, 耳, 買っ, ♪, やめ, よく, 来る, Nearest to に: 言っ, とりあえず, で, ず, 度, 力, 花粉, のみ, Nearest to おなか: みよ, 増え, あの, クラシック, 沼津, 来週, 美味しい, 深夜, Nearest to 絶対: 発表, 目, 機能, 初, 心配, 仕様, や, スープ, Nearest to ただ: どちら, 一緒, カッコ, 関係, 用, 写真, なけれ, 尻, Nearest to 先週: 必要, やめ, 次, やっと, 買う, より, 週, なかっ, Nearest to 上野: 味, レ・ミゼラブル, お腹, もっと, 関係, ヴェルディ, 映画, どうも, Nearest to 帰ろ: 言語, わかっ, 時に, けど, たかっ, 使え, お金, 紙, Nearest to 周り: かかる, 始める, 腰, コーディング, 出来, 第九, 停電, 丸亀製麺, Nearest to 二期会: 春, 幕, 迫力, ワーグナー, つけ麺, 怖い, 音, 読売日響, Epoch 22/30 Iteration: 12100 Avg. Training loss: 4.3269 0.0017 sec/batch Epoch 22/30 Iteration: 12200 Avg. Training loss: 4.3050 0.0073 sec/batch Epoch 22/30 Iteration: 12300 Avg. Training loss: 4.3489 0.0084 sec/batch Epoch 22/30 Iteration: 12400 Avg. Training loss: 4.3584 0.0072 sec/batch Epoch 22/30 Iteration: 12500 Avg. Training loss: 4.3140 0.0074 sec/batch Epoch 22/30 Iteration: 12600 Avg. Training loss: 4.3571 0.0071 sec/batch Epoch 23/30 Iteration: 12700 Avg. Training loss: 4.3114 0.0041 sec/batch Epoch 23/30 Iteration: 12800 Avg. Training loss: 4.3020 0.0080 sec/batch Epoch 23/30 Iteration: 12900 Avg. Training loss: 4.3302 0.0079 sec/batch Epoch 23/30 Iteration: 13000 Avg. Training loss: 4.3616 0.0088 sec/batch Nearest to な: 気分, 読め, 腰, まで, 過去, という, ビックリ, 完了, Nearest to で: 聴い, 考える, 読ん, クラシック, に, も, 自宅, 昼間, Nearest to が: 気, いきなり, きっと, 関係, 止まっ, れ, ただ, 障害, Nearest to か: 一緒, けれど, 帰れ, 思っ, 掃除, 夕飯, いれ, 使う, Nearest to を: 気づい, すごく, 足, たく, たかっ, コーヒー, 泣い, 口, Nearest to は: 分, 乗っ, マーラー, 思え, 最後, 時, 覚え, いろいろ, Nearest to だ: 完全, 派手, 耳, よく, 買っ, プロジェクト, やめ, なくなっ, Nearest to に: 言っ, で, 力, とりあえず, ず, 度, 花粉, 始まっ, Nearest to おなか: 増え, みよ, 沼津, 来週, 深夜, あの, クラシック, 美味しい, Nearest to 絶対: 発表, 機能, 目, 初, 仕様, や, 心配, クラウド, Nearest to ただ: どちら, 関係, カッコ, 一緒, 用, なけれ, とても, 写真, Nearest to 先週: やめ, 必要, 次, やっと, 週, 買う, より, 自動, Nearest to 上野: 味, レ・ミゼラブル, お腹, 関係, もっと, ヴェルディ, 音楽祭, 映画, Nearest to 帰ろ: 言語, 時に, わかっ, けど, 使え, お金, 紙, たかっ, Nearest to 周り: 始める, かかる, 腰, コーディング, 君, 丸亀製麺, 移動, 出来, Nearest to 二期会: 春, 幕, 迫力, ワーグナー, 怖い, つけ麺, 読売日響, 音, Epoch 23/30 Iteration: 13100 Avg. Training loss: 4.2964 0.0072 sec/batch Epoch 23/30 Iteration: 13200 Avg. Training loss: 4.3551 0.0071 sec/batch Epoch 24/30 Iteration: 13300 Avg. Training loss: 4.2562 0.0054 sec/batch Epoch 24/30 Iteration: 13400 Avg. Training loss: 4.3443 0.0071 sec/batch Epoch 24/30 Iteration: 13500 Avg. Training loss: 4.3241 0.0071 sec/batch Epoch 24/30 Iteration: 13600 Avg. Training loss: 4.3485 0.0073 sec/batch Epoch 24/30 Iteration: 13700 Avg. Training loss: 4.3051 0.0071 sec/batch Epoch 24/30 Iteration: 13800 Avg. Training loss: 4.3478 0.0072 sec/batch Epoch 25/30 Iteration: 13900 Avg. Training loss: 4.2287 0.0072 sec/batch Epoch 25/30 Iteration: 14000 Avg. Training loss: 4.3449 0.0083 sec/batch Nearest to な: 気分, 読め, 腰, まで, という, ビックリ, 過去, 安い, Nearest to で: 聴い, 考える, 読ん, も, に, 自宅, 昼間, クラシック, Nearest to が: 気, きっと, いきなり, 止まっ, れ, 関係, ただ, 待っ, Nearest to か: 一緒, けれど, 帰れ, 思っ, 掃除, 使う, いれ, 夕飯, Nearest to を: 気づい, すごく, 足, たく, コーヒー, たかっ, 口, 泣い, Nearest to は: 分, 乗っ, マーラー, 思え, 最後, 時, ラフマニノフ, 覚え, Nearest to だ: 完全, 派手, よく, なくなっ, 耳, ぜ, 来る, 買っ, Nearest to に: 力, 言っ, で, 度, とりあえず, ず, のみ, 始まっ, Nearest to おなか: 増え, 沼津, みよ, 来週, クラシック, あの, 深夜, 美味しい, Nearest to 絶対: 発表, 機能, 目, 初, や, 仕様, クラウド, 心配, Nearest to ただ: どちら, 関係, カッコ, なけれ, 用, 一緒, とても, 写真, Nearest to 先週: やめ, やっと, 必要, 次, 週, より, 買う, 自動, Nearest to 上野: 味, レ・ミゼラブル, お腹, ヴェルディ, 音楽祭, 関係, 食堂, 映画, Nearest to 帰ろ: 言語, わかっ, 時に, けど, 使え, お金, たかっ, 紙, Nearest to 周り: 始める, かかる, 腰, 丸亀製麺, 君, 移動, 停電, 出来, Nearest to 二期会: 春, 幕, 迫力, ワーグナー, 怖い, つけ麺, 読売日響, 音, Epoch 25/30 Iteration: 14100 Avg. Training loss: 4.3213 0.0081 sec/batch Epoch 25/30 Iteration: 14200 Avg. Training loss: 4.3350 0.0085 sec/batch Epoch 25/30 Iteration: 14300 Avg. Training loss: 4.3049 0.0082 sec/batch Epoch 26/30 Iteration: 14400 Avg. Training loss: 4.2995 0.0020 sec/batch Epoch 26/30 Iteration: 14500 Avg. Training loss: 4.2511 0.0079 sec/batch Epoch 26/30 Iteration: 14600 Avg. Training loss: 4.3216 0.0082 sec/batch Epoch 26/30 Iteration: 14700 Avg. Training loss: 4.3416 0.0082 sec/batch Epoch 26/30 Iteration: 14800 Avg. Training loss: 4.2978 0.0076 sec/batch Epoch 26/30 Iteration: 14900 Avg. Training loss: 4.3235 0.0082 sec/batch Epoch 27/30 Iteration: 15000 Avg. Training loss: 4.2779 0.0041 sec/batch Nearest to な: 気分, 読め, 腰, まで, という, ビックリ, しまい, 過去, Nearest to で: 聴い, 考える, 読ん, も, 昼間, 自宅, に, クラシック, Nearest to が: 気, きっと, いきなり, 止まっ, 待っ, れ, ただ, 必要, Nearest to か: けれど, 一緒, 思っ, すれ, 帰れ, いれ, 掃除, 使う, Nearest to を: 気づい, すごく, 足, たかっ, 口, コーヒー, たく, 泣い, Nearest to は: 乗っ, 分, マーラー, 思え, 覚え, 最後, ラフマニノフ, 時, Nearest to だ: 完全, なくなっ, よく, ぜ, 耳, 派手, 来る, かなり, Nearest to に: 言っ, で, 力, とりあえず, 度, ず, のみ, 買お, Nearest to おなか: 沼津, 増え, 来週, みよ, クラシック, 深夜, あの, 安い, Nearest to 絶対: 発表, 機能, 初, 目, や, 仕様, コーディング, スープ, Nearest to ただ: なけれ, どちら, 関係, カッコ, とても, 用, 一緒, 写真, Nearest to 先週: やめ, やっと, 次, 必要, 週, 夏休み, より, 自動, Nearest to 上野: 味, レ・ミゼラブル, お腹, 音楽祭, 関係, ヴェルディ, もっと, 外食, Nearest to 帰ろ: 言語, わかっ, 使え, けど, 時に, たかっ, お金, として, Nearest to 周り: 始める, かかる, 腰, 丸亀製麺, 使い勝手, 君, 移動, コーディング, Nearest to 二期会: 春, 幕, ワーグナー, 迫力, 怖い, つけ麺, 読売日響, 音, Epoch 27/30 Iteration: 15100 Avg. Training loss: 4.2725 0.0082 sec/batch Epoch 27/30 Iteration: 15200 Avg. Training loss: 4.3065 0.0078 sec/batch Epoch 27/30 Iteration: 15300 Avg. Training loss: 4.3360 0.0087 sec/batch Epoch 27/30 Iteration: 15400 Avg. Training loss: 4.2801 0.0078 sec/batch Epoch 27/30 Iteration: 15500 Avg. Training loss: 4.3345 0.0071 sec/batch Epoch 28/30 Iteration: 15600 Avg. Training loss: 4.2379 0.0055 sec/batch Epoch 28/30 Iteration: 15700 Avg. Training loss: 4.3195 0.0071 sec/batch Epoch 28/30 Iteration: 15800 Avg. Training loss: 4.3033 0.0072 sec/batch Epoch 28/30 Iteration: 15900 Avg. Training loss: 4.3273 0.0072 sec/batch Epoch 28/30 Iteration: 16000 Avg. Training loss: 4.2847 0.0071 sec/batch Nearest to な: 気分, 読め, という, 腰, ビックリ, まで, しまい, 過去, Nearest to で: 聴い, 考える, も, 読ん, 昼間, に, 自宅, クラシック, Nearest to が: 気, いきなり, 待っ, きっと, 止まっ, れ, 必要, 三, Nearest to か: けれど, 一緒, 思っ, すれ, 帰れ, 紹介, いれ, 掃除, Nearest to を: 気づい, すごく, 足, コーヒー, 口, たかっ, たく, 『, Nearest to は: 分, 乗っ, マーラー, 思え, 覚え, 最後, 時, まだ, Nearest to だ: 完全, よく, ぜ, なくなっ, 耳, 来る, 派手, 買っ, Nearest to に: で, 言っ, 力, 度, 部屋, です, のみ, とりあえず, Nearest to おなか: 沼津, 増え, みよ, 来週, 深夜, 安い, あの, クラシック, Nearest to 絶対: 機能, 発表, 初, 目, や, 仕様, コーディング, 定時, Nearest to ただ: なけれ, どちら, 関係, とても, カッコ, 用, 一緒, 頭, Nearest to 先週: やめ, やっと, 次, 必要, より, 自動, 夏休み, 週, Nearest to 上野: レ・ミゼラブル, 味, お腹, 音楽祭, ヴェルディ, 関係, 映画, 外食, Nearest to 帰ろ: 言語, 使え, わかっ, けど, 時に, お金, たかっ, として, Nearest to 周り: 始める, 腰, かかる, 丸亀製麺, 使い勝手, 君, 移動, 開始, Nearest to 二期会: 春, 幕, ワーグナー, 迫力, 怖い, つけ麺, 音, 読売日響, Epoch 28/30 Iteration: 16100 Avg. Training loss: 4.3312 0.0078 sec/batch Epoch 29/30 Iteration: 16200 Avg. Training loss: 4.2147 0.0085 sec/batch Epoch 29/30 Iteration: 16300 Avg. Training loss: 4.3221 0.0075 sec/batch Epoch 29/30 Iteration: 16400 Avg. Training loss: 4.3063 0.0073 sec/batch Epoch 29/30 Iteration: 16500 Avg. Training loss: 4.3229 0.0072 sec/batch Epoch 29/30 Iteration: 16600 Avg. Training loss: 4.2848 0.0077 sec/batch Epoch 30/30 Iteration: 16700 Avg. Training loss: 4.2867 0.0018 sec/batch Epoch 30/30 Iteration: 16800 Avg. Training loss: 4.2487 0.0078 sec/batch Epoch 30/30 Iteration: 16900 Avg. Training loss: 4.3027 0.0072 sec/batch Epoch 30/30 Iteration: 17000 Avg. Training loss: 4.3075 0.0074 sec/batch Nearest to な: 気分, 読め, ビックリ, という, 腰, まで, しまい, 安い, Nearest to で: 聴い, 考える, も, に, 読ん, 昼間, 自宅, クラシック, Nearest to が: 気, いきなり, 待っ, きっと, れ, 止まっ, 三, 悪い, Nearest to か: けれど, 思っ, 一緒, 紹介, すれ, いれ, 掃除, 帰れ, Nearest to を: 気づい, すごく, 足, コーヒー, 口, 『, たかっ, はじまる, Nearest to は: マーラー, 分, 乗っ, 思え, 覚え, 最後, ラフマニノフ, まだ, Nearest to だ: 完全, よく, ぜ, 耳, かなり, 来る, 派手, なくなっ, Nearest to に: で, 力, 言っ, 度, 買お, 薬, 花粉, 部屋, Nearest to おなか: 沼津, 増え, 来週, 深夜, みよ, 安い, クラシック, あの, Nearest to 絶対: 機能, 発表, 初, 目, や, コーディング, 仕様, 定時, Nearest to ただ: なけれ, どちら, 関係, とても, 用, カッコ, 一緒, 頭, Nearest to 先週: やめ, やっと, 次, 必要, 夏休み, 自動, より, 週, Nearest to 上野: レ・ミゼラブル, 味, お腹, 音楽祭, ヴェルディ, 関係, 外食, 映画, Nearest to 帰ろ: 言語, 使え, わかっ, けど, として, 時に, 紙, たら, Nearest to 周り: 始める, かかる, 腰, 丸亀製麺, 使い勝手, 君, 移動, コーディング, Nearest to 二期会: 春, 幕, ワーグナー, 迫力, 怖い, つけ麺, 音, 最後, Epoch 30/30 Iteration: 17100 Avg. Training loss: 4.2760 0.0078 sec/batch Epoch 30/30 Iteration: 17200 Avg. Training loss: 4.3139 0.0071 sec/batch
with train_graph.as_default():
saver = tf.train.Saver()
with tf.Session(graph=train_graph) as sess:
saver.restore(sess, tf.train.latest_checkpoint('checkpoints'))
embed_mat = sess.run(embedding)
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import matplotlib.font_manager as fm
plt.rcParams['font.family'] = 'IPAGothic'
viz_words = 500
tsne = TSNE()
embed_tsne = tsne.fit_transform(embed_mat[:viz_words, :])
fig, ax = plt.subplots(figsize=(14, 14))
for idx in range(viz_words):
plt.scatter(*embed_tsne[idx, :], color='steelblue')
plt.annotate(int_to_vocab[idx], (embed_tsne[idx, 0], embed_tsne[idx, 1]), alpha=0.7)