wordnet

Get WordNet's domain name for the specified word

╄→гoц情女王★ 提交于 2019-11-29 05:20:51
I know WordNet has Domains Hierarchy: e.g. sport->football. 1) Is it possible to list all words related, for example, to the 'sport->football' sub-domain? Response: goalkeeper, forward, penalty, ball, field, stadium, referee and so on. 2) Get domain's name for a given word , e.g. 'goalkeeper'? Need something like [sport->football; sport->hockey] or [football;hockey] or just 'football'. It is for a document classification task. WordNet has a hypernym / hyponym hierarchy but that is not what you want here, as you can see when you look up goalkeeper : from nltk.corpus import wordnet s = wordnet

Import Arabic Wordnet in python

只愿长相守 提交于 2019-11-29 04:50:05
i need to do function on arabic words by using python.. and i need to link arabic wordnet with python to do some method like : wn.synset('جميل') i find Multilingual Lexicons: AWN - ArabicWN http://www.talp.upc.edu/index.php/technology/resources/multilingual-lexicons-and-machine-translation-resources/multilingual-lexicons/72-awn and i try to run : A set of basic python functions for accessing the database http://nlp.lsi.upc.edu/awn/AWNDatabaseManagement.py.gz but when run the code(AWNDatabaseManagement.py) this error occur: processing file E:/usuaris/horacio/arabicWN/AWNdatabase/upc_db.xml file

How do I calculate the shortest path (geodesic) distance between two adjectives in WordNet using Python NLTK?

我怕爱的太早我们不能终老 提交于 2019-11-28 23:27:53
问题 Computing the semantic similarity between two synsets in WordNet can be easily done with several built-in similarity measures, such as: synset1.path_similarity(synset2) synset1.lch_similarity(synset2) , Leacock-Chodorow Similarity synset1.wup_similarity(synset2) , Wu-Palmer Similarity (as seen here) However, all of these exploit WordNet's taxonomic relations, which are relations for nouns and verbs. Adjectives and adverbs are related via synonymy, antonymy and pertainyms. How can one measure

using python nltk to find similarity between two web pages?

倖福魔咒の 提交于 2019-11-28 21:41:41
问题 I want to find whether two web pages are similar or not. Can someone suggest if python nltk with wordnet similarity functions helpful and how? What is the best similarity function to be used in this case? 回答1: The spotsigs paper mentioned by joyceschan addresses content duplication detection and it contains plenty of food for thought. If you are looking for a quick comparison of key terms, nltk standard functions might suffice. With nltk you can pull synonyms of your terms by looking up the

How to get the WordNet synset given an offset ID?

时光毁灭记忆、已成空白 提交于 2019-11-28 20:44:48
I have a WordNet synset offset (for example id="n#05576222" ). Given this offset, how can I get the synset using Python? donners45 As of NLTK 3.2.3, there's a public method for doing this: wordnet.synset_from_pos_and_offset(pos, offset) In earlier versions you can use: wordnet._synset_from_pos_and_offset(pos, offset) This returns a synset based on it's POS and offest ID. I think this method is only available in NLTK 3.0 but I'm not sure. Example: from nltk.corpus import wordnet as wn wn._synset_from_pos_and_offset('n',4543158) >> Synset('wagon.n.01') For NTLK 3.2.3 or newer, please see

Wordnet Find Synonyms

六月ゝ 毕业季﹏ 提交于 2019-11-28 16:23:12
问题 I am searching for a way to find all the synonyms of a particular word using wordnet. I am using JAWS. For example: love(v): admire, adulate, be attached to, be captivated by, be crazy about, be enamored of, be enchanted by, be fascinated with, be fond of, be in love with, canonize, care for, cherish, choose, deify, delight in, dote on, esteem, exalt, fall for, fancy, glorify, go for, gone on.... love(n): Synonym : adulation, affection, allegiance, amity, amorousness, amour, appreciation,

Is wordnet path similarity commutative?

房东的猫 提交于 2019-11-28 10:52:34
I am using the wordnet API from nltk. When I compare one synset with another I got None but when I compare them the other way around I get a float value. Shouldn't they give the same value? Is there an explanation or is this a bug of wordnet? Example: wn.synset('car.n.01').path_similarity(wn.synset('automobile.v.01')) # None wn.synset('automobile.v.01').path_similarity(wn.synset('car.n.01')) # 0.06666666666666667 alvas Technically without the dummy root, both car and automobile synsets would have no link to each other: >>> from nltk.corpus import wordnet as wn >>> x = wn.synset('car.n.01') >>>

Stemming some plurals with wordnet lemmatizer doesn't work

萝らか妹 提交于 2019-11-28 10:29:42
问题 Hi i've a problem with nltk (2.0.4): I'm trying to stemming the word 'men' or 'teeth' but it doesn't seem to work. Here's my code: ############################################################################ import nltk from nltk.corpus import wordnet as wn from nltk.stem.wordnet import WordNetLemmatizer lmtzr=WordNetLemmatizer() words_raw = "men teeth" words = nltk.word_tokenize(words_raw) for word in words: print 'WordNet Lemmatizer NOUN: ' + lmtzr.lemmatize(word, wn.NOUN) #################

comparing synonyms NLTK [duplicate]

为君一笑 提交于 2019-11-28 09:30:21
问题 This question already has answers here : All synonyms for word in python? [duplicate] (3 answers) Closed 4 years ago . I can't come up with a stranger problem, guess you'll help me. for p in wn.synsets('change'):<br> print(p) Getting: Synset('change.n.01') Synset('change.n.02') Synset('change.n.03') Synset('change.n.04') Synset('change.n.05') Synset('change.n.06') Synset('change.n.07') Synset('change.n.08') Synset('change.n.09') Synset('variety.n.06') Synset('change.v.01') Synset('change.v.02

Using WN-Affect to detect emotion/mood of a string

旧巷老猫 提交于 2019-11-28 07:45:01
I downloaded WN-Affect . I am however not sure how to use it to detect the mood of a sentence. For example if I have a string "I hate football." I want to be able to detect whether the mood is bad and the emotion is fear. WN-Affect has no tutorial on how to do it, and I am kind of new to python. Any help would be great! In short : Use SentiWordNet instead and look at https://github.com/kevincobain2000/sentiment_classifier In Long : Affectedness vs Sentiment The line between affect and sentiment is very fine. One should looking into Affectedness in linguistics studies, e.g. http://compling.hss