wordnet

To find synonyms, definitions and example sentences using WordNet

∥☆過路亽.° 提交于 2019-12-20 08:32:15
问题 I need to take an input text file with a one word. I then need to find the lemma_names, definition and examples of the synset of the word using wordnet. I have gone through the book : "Python Text Processing with NLTK 2.0 Cookbook" and also "Natural Language Processing using NLTK" to help me in this direction. Though I have understood how this can be done using the terminal, I'm not able to do the same using a text editor. For example, if the input text has the word "flabbergasted", the

Semantic Relatedness Algorithms - python [closed]

邮差的信 提交于 2019-12-19 13:45:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I want to find relatedness between two synsets and I came across many algorithms like resnik,lin,wu palmer,path algorithm,leacock chodorow etc. Can somebody tell me which one is most efficient among these algorithms? 回答1: From a "show me an example" perspective, here's an example

wordnet getDict() could not find Wordnet dictionary

a 夏天 提交于 2019-12-19 10:52:37
问题 when using the following code to use the Lemmatizer algorithm from WordNet > initDict("C:/Program Files (x86)/WordNet/2.1/dict") [1] TRUE if(initDict("C:/Program Files (x86)/WordNet/2.1/dict")) getDict() I have the following error when trying to get the dictionary: Error in getDict() : could not find Wordnet dictionary Thanks! 回答1: The problem is that the package is looking for the environment variable WNHOME Try this: > setDict("C:/Program Files (x86)/WordNet/2.1/dict") - getDict() [1] "Java

Not getting the required output using Wordnet Synset's definition method

一个人想着一个人 提交于 2019-12-19 03:35:19
问题 from nltk.corpus import wordnet syn=wordnet.synsets('cookbook')[0] print syn.definition Expected Output: 'a book of recipes and cooking directions' Actual Output: bound method Synset.definition of Synset('cookbook.n.01') I am unable to pinpoint the error in my code which is causing the difference between the actual output and the expected output. 回答1: >>> from nltk.corpus import wordnet as wn >>> wn.synsets('dog')[0] Synset('dog.n.01') >>> wn.synsets('dog')[0].definition <bound method Synset

How to find out wether a word exists in english using nltk

自作多情 提交于 2019-12-18 17:04:58
问题 I am looking for a proper solution to this question. This question has been asked many times before and i didnt find a single answer that suited. I need to use a corpus in NLTK to detect whether a word is an english word I have tried to do : wordnet.synsets(word) This doesnt word for many common words. Using a list of words in english and performing lookup in a file is not an option. Using enchant is not an option either. If there is another library that can do the same, please provide the

How to generate a list of antonyms for adjectives in WordNet using Python

好久不见. 提交于 2019-12-18 16:17:11
问题 I want to do the following in Python (I have the NLTK library, but I'm not great with Python, so I've written the following in a weird pseudocode): from nltk.corpus import wordnet as wn #Import the WordNet library for each adjective as adj in wn #Get all adjectives from the wordnet dictionary print adj & antonym #List all antonyms for each adjective once list is complete then export to txt file This is so I can generate a complete dictionary of antonyms for adjectives. I think it should be

Wordnet SQL Explanation

﹥>﹥吖頭↗ 提交于 2019-12-18 10:19:52
问题 I'm trying to get a simple synonym database up and running, so I can find synonyms of words the user entered (nothing else!). For this I grabbed a copy of the Wordnet sql thesarus (http://wnsql.sourceforge.net/), but now I'm presented with all these tables, and I can't find any simple explanation for their content anywhere: adjpositions adjpositiontypes casedwords lexdomains lexlinks linktypes morphmaps morphs postypes samples semlinks senses synsets vframemaps vframes vframesentencemaps

Import Arabic Wordnet in python

十年热恋 提交于 2019-12-18 04:23:06
问题 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

Is wordnet path similarity commutative?

谁说我不能喝 提交于 2019-12-17 19:33:49
问题 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 回答1: Technically without the dummy root, both car and automobile synsets would

Using NLTK and WordNet; how do I convert simple tense verb into its present, past or past participle form?

爷,独闯天下 提交于 2019-12-17 06:34:19
问题 Using NLTK and WordNet, how do I convert simple tense verb into its present, past or past participle form? For example: I want to write a function which would give me verb in expected form as follows. v = 'go' present = present_tense(v) print present # prints "going" past = past_tense(v) print past # prints "went" 回答1: I think what you're looking for is the NodeBox::Linguistics library. It does exactly that: print en.verb.present("gave") >>> give 回答2: With the help of NLTK this can also be