https://github.com/terrierscript/archive-qiita
https://github.com/terrierscript/archive-qiita
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/terrierscript/archive-qiita
- Owner: terrierscript
- Created: 2020-03-25T14:37:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-25T14:37:46.000Z (almost 6 years ago)
- Last Synced: 2025-02-15T04:41:31.247Z (12 months ago)
- Language: HTML
- Size: 12.4 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
@eleven_2012
文字列からの数値化についてはgensimの`corpora.Dictionary`を利用しました。
ざっくり主要な部分のコードとしては、こんな感じでサンプルデータを結合したデータを食わせました
```py
from gensim import corpora
chars = [ list(r.strip()) for r in concatinated_sample_string_data ]
dic = corpora.Dictionary(chars)
```
ここらへんのやり方はTensorFlowで同様のことを行っていた下記スクリプトも参考の一端としましたので、こちらも参考になるかもしれません
https://github.com/dennybritz/sentiment-analysis/blob/master/utils/ymr_data.py#L36