snownlp icon indicating copy to clipboard operation
snownlp copied to clipboard

关于sentiment模块的训练

Open wzc118 opened this issue 7 years ago • 1 comments

你好,我用自己的语料库(短文本)做sentiment analysis,frequency.py报了如下错 ~\AppData\Local\Continuum\anaconda3\lib\site-packages\snownlp\utils\frequency.py in freq(self, key) 22 23 def freq(self, key): ---> 24 return float(self.get(key)[1])/self.total 25 26 def samples(self):

ZeroDivisionError: float division by zero 这是什么情况呢?

wzc118 avatar Oct 25 '17 07:10 wzc118

看一下是不是语料里面有空串

isnowfy avatar Oct 28 '17 02:10 isnowfy