数百字のテキストを分類/クラスタリングしてみる with Keras
参考文献メモ。
分類
- ベース: Sequence Classification with LSTM Recurrent Neural Networks in Python with Keras - Machine Learning Mastery
- python - Keras LSTM multiclass classification - Stack Overflow
短文ならLSTM, 長文ならRNNが良いという噂。
クラスタリングするなら
- 【ICML読み会】Unsupervised Deep Embedding for Clustering Analysis - SSSSLIDE
- Unsupervised Deep Embedding for Clustering Analysis
色々
Recursive AutoEncoder
LSTMを理解する
KerasでLSTM AutoEncoder
PyCharmでRoot以外にもPythonPathを追加したい時
PyCharm: 2017.1バージョン
Preference > Project:
postgresqlでcsvファイルから一括upsert
全部1行ずつupsertしてたら100万件で数時間かかったので、 他の解決策を考える。
1時テーブルを作成しupdate + insert
PostgreSQL CSV 取り込み upsert | odekakeshimasyo.me
- copy from => tmp table
- tmp tableからUpdate
- tmp tableからUpdateした分を削除してInsert
PostgreSQLメモ
Activeで何クエリが走ってるか
select pid, query from pg_stat_activity where state = 'active';
クエリジョブのkill
select pg_cancel_backend(pid);
Pythonのdocstringの書き方について
3つの書き方
google style:
numpy style:
reST:
自分の基本的な書き方
基本的にはreSTの書き方しているつもり。
''' 1行関数・クラス説明 複数行説明... :param type param-name: param-description :return: return-description :rtype: return-type '''
docstringのtypeの書き方
docker-composeよく使うコマンド
コマンド
コマンド | 意味 |
---|---|
docker-compose build | docker-compose.ymlの中身を変更したら実行する |
docker-compose up | 起動 |
docker-compose run {サービス名} {command} | コマンドを実行する |
docker-compose rm {サービス名} | containerの削除。buildした内容を破棄する |
PostgreSQLの設定
user:username, pass:secret, dbname:username でDBを作る。
db: restart: always image: postgres:alpine ports: - 5432:5432 environment: POSTGRES_USER: username POSTGRES_PASSWORD: secret volumes: - ./path/to/schema.sql:/docker-entrypoint-initdb.d/01_schema.sql
volumes: を指定すると この例なら自作schema.sqlを初回起動時に実行する。 テストデータ作ったり、スキーマ作ったりするのに便利。要らなかったらvolumes:ごと書かない
NLP系調べごとのメモ
- [筑波ウェブコーパス|教育サービス|日本語・日本事情遠隔教育拠点](http://www.intersc.tsukuba.ac.jp/~kyoten/twc.html#.WcSXEdNJYdV)