Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- score_fn=BigramAssocMeasures.chi_sq
- n=200
- bigram_finder = BigramCollocationFinder.from_words(all_words)
- bigrams = bigram_finder.nbest(score_fn, n)
- Traceback (most recent call last):
- File "C:/Users/HeeswiM/Desktop/Scriptie/CorpusBasisWERKT.py", line 98, in <module>
- evaluate_classifier(best_bigram_word_feats)
- File "C:/Users/HeeswiM/Desktop/Scriptie/CorpusBasisWERKT.py", line 21, in evaluate_classifier
- negfeats = [(featx(movie_reviews.words(fileids=[f])), 'neg') for f in negids]
- File "C:/Users/HeeswiM/Desktop/Scriptie/CorpusBasisWERKT.py", line 92, in best_bigram_word_feats
- bigrams = bigram_finder.nbest(score_fn, n)
- File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 112, in nbest
- return [p for p, s in self.score_ngrams(score_fn)[:n]]
- File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 108, in score_ngrams
- return sorted(self._score_ngrams(score_fn), key=lambda t: (-t[1], t[0]))
- File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 100, in _score_ngrams
- score = self.score_ngram(score_fn, *tup)
- File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 169, in score_ngram
- return score_fn(n_ii, (n_ix, n_xi), n_all)
- File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkmetricsassociation.py", line 220, in chi_sq
- return n_xx * cls.phi_sq(n_ii, (n_ix, n_xi), n_xx)
- File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkmetricsassociation.py", line 212, in phi_sq
- ((n_ii + n_io) * (n_ii + n_oi) * (n_io + n_oo) * (n_oi + n_oo)))
- ZeroDivisionError: float division by zero
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement