collections.counter

Discussion in 'Python' started by thewal, Nov 6, 2020.

  1. thewal

    thewal New Member

    Joined:
    Nov 5, 2020
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Hi,
    I wish to use collections.counter
    So I have imported nltk and trained/tested my txt file already. Now I want to use counter to count frequencies and probability of words. I think that I need to do something like, see code below
    Code:
    from collections import Counter
    
    def word_count(word):
      
        return
      
    
    def prob(word):
       
        return 0
     
    Last edited: Nov 6, 2020

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice