面白かった。
特にWord2Vecの説明とTensorBoardで実際に可視化するところが。
単語の関連性をベクトルで表すという発想がすごすぎて鳥肌立った。
この本だけですべてを理解するのは厳しいが、最初の一歩としては十分に役割を果たしており、一通りやってみて興味のあるやつをさらに自分で調べていくのがいいと思う。
先にやっておくといいこと
P168のTwitterの過去アーカイブをダウンロードは先にやっておくといい。
数分~数時間と書かれているが、自分は24時間かかった。
よかったところ
- 話の流れがスムーズ
- 明日使える!?Tips
微妙だったところ
- ノーマライズのサンプルがnotebookになくて、打ち込むのがめんどくさかった。
- まぁ先のnotebookに類似のがあるから、そこからコピペできるんだが普通にやってる分には気づかない。
- 正規表現の勉強にはなるかもしれないが...
- BERTはよくわからんかった。
成果とか
WordCloudの結果をTwitterのヘッダにした。
サイズはwidth=1080, height=360である。
ただ、自分の使っているスマホアプリだと端が切れるので、すべての環境に対応しているわけではないっぽい。
normalize_text
サンプルに以下を追加した。
もうこれは個人によるから試行錯誤。
text = re.sub('なか', "", text) text = re.sub('めど', "", text) text = re.sub('あと', "", text) text = re.sub('ところ', "", text) text = re.sub('マジ', "", text) text = re.sub('なに', "", text) text = re.sub('すぎ', "", text) text = re.sub('ちゃ', "", text) text = re.sub('わけ', "", text) text = re.sub('やつ', "", text) text = re.sub('アレ', "", text) text = re.sub('ヤバ', "", text) text = re.sub('ネタ', "", text) text = re.sub('キャラ', "", text) text = re.sub('そこ', "", text) text = re.sub('好き', "", text) text = re.sub('感じ', "", text) text = re.sub('普通', "", text) text = re.sub('最近', "", text) text = re.sub('結局', "", text) text = re.sub('無理', "", text) text = re.sub('完全', "", text) text = re.sub('時間', "", text) text = re.sub('レベル', "", text) text = re.sub('久々', "", text) text = re.sub('www', "", text) text = re.sub('全部', "", text) text = re.sub('意味', "", text) text = re.sub('あま', "", text) text = re.sub('ここ', "", text) text = re.sub('ほう', "", text) text = re.sub('いつ', "", text) text = re.sub('絶対', "", text) text = re.sub('確か', "", text) text = re.sub('微妙', "", text) text = re.sub('途中', "", text) text = re.sub('とこ', "", text) text = re.sub('だめ', "", text) text = re.sub('ググ', "", text) text = re.sub('最初', "", text) text = re.sub('お前', "", text) text = re.sub('まじ', "", text) text = re.sub('www', "", text) text = re.sub('あれ', "", text) text = re.sub('対応', "", text) text = re.sub('機能', "", text) text = re.sub('電車', "", text) text = re.sub('難易', "", text) text = re.sub('ダメ', "", text) text = re.sub('ワロタ', "", text) text = re.sub('半端', "", text) text = re.sub('ふろ', "", text) text = re.sub('ごと', "", text) text = re.sub('どっち', "", text) text = re.sub('昨日', "", text) text = re.sub('起動', "", text) text = re.sub('PSshare', "", text) text = re.sub('PS', "", text) text = re.sub('YouTube', "", text) text = re.sub('Twitter', "", text) text = re.sub('DL', "", text) text = re.sub('music',"", text) text = re.sub('駄目', "", text) text = re.sub('プレイ', "", text) text = re.sub('以上', "", text) text = re.sub('必要', "", text) text = re.sub('風呂', "", text) text = re.sub('^(?!.*ゲーム).*(?=ゲー).*$', "", text)
また、からあげさんのサンプルから以下は削除した。
理由:FGOとかが出なくなるから。
text = re.sub(r'[a-zA-Z]', "", text)