TypeError: reduce() of empty sequence with no initial value
import thulac
thu = thulac.thulac(seg_only=True)
def thu_segment(sent):
'''
:type sent: str
:return:
'''
text = thu.cut(sent, text=True)
return text # 返回的编码是UTF-8
if __name__ == '__main__':
sent = thu_segment(" ") # 中文空格
print(sent)
I run the above code, then I got following errors:
Traceback (most recent call last):
File "E:/python/text_classification/preprocess/segment.py", line 35, in
Thanks for your issue! We have fixed this bug.