Cannot Import Romanian Wordnet with nltk

299 views
Skip to first unread message

Marc Miquel

unread,
May 11, 2017, 2:42:00 PM5/11/17
to nltk-users
Hello!

I am writing since I am struggling in order to use Romanian Wordnet with nltk.

I copied the folder and files I download from: http://compling.hss.ntu.edu.sg/omw/
open multilingual wordnet

But I couldn't make it work using:

 from nltk.corpus import RoWordNet as we


I also tried with different Romanian Wordnet and the result is the same... I am not sure the files are ok, the extensions inside are very different from the files from the original folder named Wordnet I downloaded automatically with nltk install.
Could anybody help me?

Thank you very much.

Marc

Dimitriadis, A. (Alexis)

unread,
May 11, 2017, 3:36:26 PM5/11/17
to <nltk-users@googlegroups.com>
That’s not how it works. Find the folder nltk_data/corpora/omw/, and put the files you downloaded in a subfolder to match the others. Then access them using the usual wordnet interface, e.g. like this:

    from nltk.corpus import wordnet as wn

    print(wn.all_lemma_names(lang=“rom”)   # Or whatever the abbreviation is for Romanian

You also add `lang=rom` to get Romanian lemmas instead of English ones. I think the synsets are in principle shared among languages.

Alexis



Dr. Alexis Dimitriadis | Assistant Professor and Senior Research Fellow | Utrecht Institute of Linguistics OTS | Utrecht University | Trans 10, 3512 JK Utrecht, room 2.33 | +31 30 253 65 68 | a.dimi...@uu.nl | www.hum.uu.nl/medewerkers/a.dimitriadis

-- 
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nltk-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages