ZeroDivisionError
ZeroDivisionError Traceback (most recent call last)
ZeroDivisionError: float division by zero
This is happening because the text you provided doesnt have a . in it jaja. AS you see it is spliting the text so you can try/catch that and wen it fails catch it with new_frame = fn[0] + _clean It works for me.
@mynameisvinn Would love to help fix this error, but don't have access. 😞
Need to add a try/except statement here to account for any "sentences" that don't contain words and get a length of zero:
I.e. -
try:
doc = pos_tagger(sentence)
verb_count = np.sum([token.pos_ != "VERB" for token in doc])
return float(verb_count) / len(doc)
except Exception:
return 0