hi @monorienaghogho going further with your excellent program as I am interested in NLP.
I read quicky SumBasic and tried to understand your code. Then using it for made homework stuff.
- I have been forced to add 3 lines:
Summarizing ‘Vehicle insurance’, get error message:
ZeroDivisionError Traceback (most recent call last)
<ipython-input-13-76705753430b> in <module>
80 for i, datum in enumerate(data('Actuary', 'Vehicle insurance')):
---> 81 sumbasic(lemmatizer(word_tokenizer(sentence_tokenizer(datum))))
82 if i == 0:
83 print('*'*100, sep='\n')
<ipython-input-13-76705753430b> in sumbasic(lemmatizer)
66 for word in value:
---> 68 importance[key] = sum(scores[key]) / len(scores[key])
70 most_importance_sentence = max(scores, key=scores.get)
ZeroDivisionError: division by zero
So len(scores) is zero. He got a sentence where all prob[words] = 0. Strange. What do you think ?