How do I use WordNet in Python?

how do i import and use WordNet 3.0 in python?

  • I have downloaded the latest version of WordNet 3.0. I am not able to find a proper documentation of how to use it in python. Does NLTK have wordnet 3.0 ? I have already used an older version of wordnet in nltk. Please help me.

  • Answer:

    No, it seems that NLTK only supports 3.0. If I were doing this, I'd choose between using the 3.0 Java API through http://www.jython.org or spawn the wn executable using the http://docs.python.org/library/subprocess.html. I'd lean towards the latter method in case I needed to integrate with an extensive existing codebase. Unfortunately this means doing work that a future 3.0 implementation in NLTK will make obsolete, but well - that's life.

Apps at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

Did you check out this useful site- http://nltk.googlecode.com/svn/trunk/doc/howto/wordnet.html ? From experience, you do get WordNet-3.0 when you download wordnet via nltk in the middle of June. On my Mac, nltk stores the data files in a folder ~/nltk_data/corpora/wordnet. I diff-ed them against the data files that came with the WordNet-3.0 I installed independently. They're identical. I bet you could use any version of WordNet by copying/ sym-linking the data files (in WordNetxx/dict) to nltk's folder.

Lavanya

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.