Counting bi-gram frequencies

后端 未结 4 455
感情败类
感情败类 2021-02-06 17:10

I\'ve written a piece of code that essentially counts word frequencies and inserts them into an ARFF file for use with weka. I\'d like to alter it so that it can count bi-gram f

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 18:12

    Life is much more easier if you start using NLTK's FreqDist function to do the counting. Also NLTK has bigram feature. Examples for both of them are in the following page.

    http://nltk.googlecode.com/svn/trunk/doc/book/ch01.html

提交回复
热议问题