Advertisement
Guest User

Untitled

a guest
May 5th, 2015
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. score_fn=BigramAssocMeasures.chi_sq
  2. n=200
  3. bigram_finder = BigramCollocationFinder.from_words(all_words)
  4. bigrams = bigram_finder.nbest(score_fn, n)
  5.  
  6. Traceback (most recent call last):
  7. File "C:/Users/HeeswiM/Desktop/Scriptie/CorpusBasisWERKT.py", line 98, in <module>
  8. evaluate_classifier(best_bigram_word_feats)
  9. File "C:/Users/HeeswiM/Desktop/Scriptie/CorpusBasisWERKT.py", line 21, in evaluate_classifier
  10. negfeats = [(featx(movie_reviews.words(fileids=[f])), 'neg') for f in negids]
  11. File "C:/Users/HeeswiM/Desktop/Scriptie/CorpusBasisWERKT.py", line 92, in best_bigram_word_feats
  12. bigrams = bigram_finder.nbest(score_fn, n)
  13. File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 112, in nbest
  14. return [p for p, s in self.score_ngrams(score_fn)[:n]]
  15. File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 108, in score_ngrams
  16. return sorted(self._score_ngrams(score_fn), key=lambda t: (-t[1], t[0]))
  17. File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 100, in _score_ngrams
  18. score = self.score_ngram(score_fn, *tup)
  19. File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkcollocations.py", line 169, in score_ngram
  20. return score_fn(n_ii, (n_ix, n_xi), n_all)
  21. File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkmetricsassociation.py", line 220, in chi_sq
  22. return n_xx * cls.phi_sq(n_ii, (n_ix, n_xi), n_xx)
  23. File "C:UsersHeeswiMAppDataRoamingPythonPython27site-packagesnltkmetricsassociation.py", line 212, in phi_sq
  24. ((n_ii + n_io) * (n_ii + n_oi) * (n_io + n_oo) * (n_oi + n_oo)))
  25. ZeroDivisionError: float division by zero
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement