rkcosmos / deepcut

A Thai word tokenization library using Deep Neural Network
MIT License
420 stars 96 forks source link

AttributeError: 'list' object has no attribute 'ravel' #14

Closed earthy123 closed 7 years ago

earthy123 commented 7 years ago

จะให้ตัดคำภาษาไทย 100,000 บรรทัด ครับแล้วขึ้นแบบนี้ Using TensorFlow backend. Traceback (most recent call last): File "deepv1.py", line 64, in x.append(deep(line)) File "deepv1.py", line 24, in deep z =deepcut.tokenize(list) File "/home/essz/anaconda3/lib/python3.6/site-packages/deepcut/deepcut.py", line 45, in tokenize y_predict = (y_predict.ravel() > 0.5).astype(int) AttributeError: 'list' object has no attribute 'ravel'

rkcosmos commented 7 years ago

What is type of your list variable in deepcut.tokenize(list)? Is it a string?

earthy123 commented 7 years ago

I found the solution is my own mistake. Because deepcut.tokenize get empty string (empty line) from txt file so it cause an error. Thank you for your response