###前提
- Python 3.5.2
- Django 1.10.2
###質問内容
エラーの内容でどこを修正したいいかわからないです。教えてください。
よろしくお願いいたします。
###コード
今回実装してエラーがでたコードをMLという形でgithubであげています。よろしくお願いいたします。
https://github.com/shotanaka0513/ML.git
###ML実行結果
python
1$ cd ./ML 2$ python naivebayes.py 3Traceback (most recent call last): 4 File "naivebayes.py", line 78, in <module> 5 Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。 多くのプラットフォームをサポートしており(動作するプラットフォーム)、また、豊富なドキュメント、豊富なライブラリがあることから、産業界でも利用が増えつつある。''', 'Python') 6 File "naivebayes.py", line 29, in train 7 word = getwords(doc) 8 File "naivebayes.py", line 9, in getwords 9 words = [s.lower() for s in morphological.split(doc)] 10 File "/Users/tanakasho/Desktop/Python/sample03/morphological.py", line 18, in split 11 results = urllib.request.urlopen(pageurl, params) 12 File "//anaconda/lib/python3.5/urllib/request.py", line 163, in urlopen 13 return opener.open(url, data, timeout) 14 File "//anaconda/lib/python3.5/urllib/request.py", line 464, in open 15 req = meth(req) 16 File "//anaconda/lib/python3.5/urllib/request.py", line 1183, in do_request_ 17 raise TypeError(msg) 18TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str
###参考サイト
http://gihyo.jp/dev/serial/01/machine-learning/0003?page=3