wordnet

What part of speech does “s” stand for in WordNet synsets

前提是你 提交于 2019-11-30 18:22:46
I have a list of GRE words which I am getting a list of synsets for. for word in words: synsets = wordnet.synsets(word['name']) for synset in synsets: print synset.pos #prints part of speech For many of the words in the list, I see familiar parts of speech like verbs, nouns, etc. However, I am coming across many words which are classified with "s". I can't for the life of me figure out what part of speech "s" stands for. The only thing I can think of is that "s" stands for "singular", but that isn't a part of speech classification. For example, the word "admonitory" is an adjective. The two

split sentence without space in python (nltk?)

点点圈 提交于 2019-11-30 17:07:33
问题 I have a set of concatenated word and i want to split them into arrays For example : split_word("acquirecustomerdata") => ['acquire', 'customer', 'data'] I found pyenchant , but it's not available for 64bit windows. Then i tried to split each string into sub string and then compare them to wordnet to find a equivalent word. For example : from nltk import wordnet as wn def split_word(self, word): result = list() while(len(word) > 2): i = 1 found = True while(found): i = i + 1 synsets = wn

What part of speech does “s” stand for in WordNet synsets

人走茶凉 提交于 2019-11-30 16:43:14
问题 I have a list of GRE words which I am getting a list of synsets for. for word in words: synsets = wordnet.synsets(word['name']) for synset in synsets: print synset.pos #prints part of speech For many of the words in the list, I see familiar parts of speech like verbs, nouns, etc. However, I am coming across many words which are classified with "s". I can't for the life of me figure out what part of speech "s" stands for. The only thing I can think of is that "s" stands for "singular", but

MIT Java WordNet Interface: Getting WordNet lexicographer classes or super-senses

不问归期 提交于 2019-11-30 16:23:27
问题 I have a project where I need to get the lexical meaning of a word. I am thinking of using WordNet because it has its own lexicographer classes also called super-senses. I just downloaded MIT JWI and trying to see if this JWI does support it. The manual doesn't say anything about returning any lexical information attached to the word. import java.io.File; import java.io.IOException; import java.io.ObjectInputStream.GetField; import java.net.URL; import edu.mit.jwi.*; import edu.mit.jwi.item

How to get the wordnet sense frequency of a synset in NLTK?

南笙酒味 提交于 2019-11-30 14:13:31
问题 According to the documentation i can load a sense tagged corpus in nltk as such: >>> from nltk.corpus import wordnet_ic >>> brown_ic = wordnet_ic.ic('ic-brown.dat') >>> semcor_ic = wordnet_ic.ic('ic-semcor.dat') I can also get the definition , pos , offset , examples as such: >>> wn.synset('dog.n.01').examples >>> wn.synset('dog.n.01').definition But how can get the frequency of a synset from a corpus? To break down the question: first how to count many times did a synset occurs a sense

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

邮差的信 提交于 2019-11-30 13:40:17
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 doable, but I don't know how to create the Python script. I'd like to do it in Python as that's the NLTK

How to get the wordnet sense frequency of a synset in NLTK?

不问归期 提交于 2019-11-30 10:02:04
According to the documentation i can load a sense tagged corpus in nltk as such: >>> from nltk.corpus import wordnet_ic >>> brown_ic = wordnet_ic.ic('ic-brown.dat') >>> semcor_ic = wordnet_ic.ic('ic-semcor.dat') I can also get the definition , pos , offset , examples as such: >>> wn.synset('dog.n.01').examples >>> wn.synset('dog.n.01').definition But how can get the frequency of a synset from a corpus? To break down the question: first how to count many times did a synset occurs a sense-tagged corpus? then the next step is to divide by the the count by the total number of counts for all

Get WordNet's domain name for the specified word

穿精又带淫゛_ 提交于 2019-11-30 07:41:04
问题 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. 回答1: WordNet has a hypernym / hyponym hierarchy but that is not

Installing nltk data dependencies in setup.py script

荒凉一梦 提交于 2019-11-30 07:25:46
问题 I use NLTK with wordnet in my project. I did the installation manually on my PC, with pip: pip3 install nltk --user in a terminal, then nltk.download() in a python shell to download wordnet. I want to automatize these with a setup.py file, but I don't know a good way to install wordnet. For the moment, I have this piece of code after the call to setup ( "nltk" is in the install_requires list of the call to setup ): import sys if 'install' in sys.argv: import nltk nltk.download("wordnet") Is

What is the connection or difference between lemma and synset in wordnet?

给你一囗甜甜゛ 提交于 2019-11-30 07:12:44
I am a complete beginner to NLP and NLTK. I was not able to understand the exact difference between lemmas and synsets in wordnet , because both are producing nearly the same output. for example for the word cake it produce this output. lemmas : [Lemma('cake.n.01.cake'), Lemma('patty.n.01.cake'), Lemma('cake.n.03.cake'), Lemma('coat.v.03.cake')] synsets : [Synset('cake.n.01'), Synset('patty.n.01'), Synset('cake.n.03'), Synset('coat.v.03')] please help me to understand this concept. Thank you. The terms are based on the general sense of the words "lemma" and "synonym". A lemma is wordnet's