PTT
Submit
Submit
选择语言
正體中文
简体中文
PTT
Python
[问题] unicodedecodeerror
楼主:
l1221l
(一一二二一一)
2015-07-06 15:48:17
试着使用word2vector
他们官网提供了train好的资料
但是是binary 1的bin档
想转成可阅读的形式
en = content.decode('utf-8')
print(en)
看到的是
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 5:
invalid start byte
还没找到解决方案
有train了binary 0的资料是
71291 48
</s> 0.008339 0.009207 -0.007980 -0.006829 0.002847 0.006294
0.001960 0.000440 -0.007507 0.004622 -0.009076 0.002603 -0.001565 -0.001994
-0.006908 -0.003921 0.005374 0.006303 0.006186 0.003328 0.003218 -0.007922
-0.008533 0.010353 0.007919 0.006438 -0.001258 0.008366 -0.001031 0.001531
-0.000311 -0.006215 0.002734 -0.002786 -0.007970 0.009905 0.009123 -0.002282
-0.000471 0.001061 -0.007579 -0.008348 0.009489 0.000131 -0.005380 -0.006338
-0.006409 0.003535
binary 1的第一行是
b'71291 200\n'
b'</s> \xf6(\x03;\xa4\xd0\x10;\x1f\x05\xfb\xba{\xd4\xd6\xba\xb8\x1e3:
q\xfd\xc5:\xd7\xa3\xf69\x9a\x99\xdd8\xf6(\xec\xba\xd7c\x91:
\x00\xc0\x0e\xbb\xae\xc7#:\xc3\xf5\xc4\xb9\x85\xeb\xfa\xb9\xcdL
\xd9\xba3\xb3v\xba=\n'
不过这个是小的档案拿来做对比的
他train好的档案很大 没有data给我重新来train
请问各位大大有没有好解法呢
谢谢
作者:
chuanmaotou
(0xFFFFFFFF)
2015-07-06 22:39:00
试着把他输出成json
https://goo.gl/qFssBd
开档的时候 补上with open(id + '.json', 'w', encoding='utf8')我改打一篇好了
继续阅读
爬新闻网站资料存成csv档问题
quingtw
[问题] PyDev开发GUI异常
tyc5116
Fw: [发案]高奖金3-10万,MIT面试程式题目, 征求
jiarjia
[问题] 请问撷取原始码中文问题
Czero
[推荐] from HackNTU_台大黑客松 import *
linamy85
Re: [问题] django on android
uranusjr
[问题] django on android
aiweisen
[问题] 爬取infinite scrolling web
ntuleo
[问题]python可以将CSV档案分割成数个CSV吗?
allen511081
[问题] Python3 print出参数左右有空格
coolchung
Links
booklink
Contact Us: admin [ a t ] ucptt.com