wordnet

How to test whether a word is in singular form or not in python?

﹥>﹥吖頭↗ 提交于 2021-02-17 19:14:54
问题 I am trying to get whether a word is in singular form or in plural form by using nltk pos_tag. But the results are not accurate. So, I need a way to find how can get whether a word is in singular form or in plural form? moreover I need it without using any python package. 回答1: For English, every word should somehow have a root lemma where the default plurality is singular. Assuming that you have only nouns in your list, you can try this: from nltk.stem import WordNetLemmatizer wnl =

How to test whether a word is in singular form or not in python?

匆匆过客 提交于 2021-02-17 19:14:16
问题 I am trying to get whether a word is in singular form or in plural form by using nltk pos_tag. But the results are not accurate. So, I need a way to find how can get whether a word is in singular form or in plural form? moreover I need it without using any python package. 回答1: For English, every word should somehow have a root lemma where the default plurality is singular. Assuming that you have only nouns in your list, you can try this: from nltk.stem import WordNetLemmatizer wnl =

with NLTK, How can I generate different form of word, when a certain word is given?

别来无恙 提交于 2021-02-16 14:39:06
问题 For example, Suppose the word "happy" is given, I want to generate other forms of happy such as happiness, happily... etc. I have read some other previous questions on Stackoverflow and NLTK references. However, there are only POS tagging, morph just like identifying the grammatical form of certain words within sentences, not generating a list of different words. Is there anyone who bumped into similar issues? Thank you. 回答1: This type of information is included in the Lemma class of NLTK's

Printing the part of speech along with the synonyms of the word

社会主义新天地 提交于 2021-02-10 03:50:54
问题 I have the following code for taking a word from the input text file and printing the synonyms, definitions and example sentences for the word using WordNet. It separates the synonyms from the synset based on the part-of-speech, i.e., the synonyms that are verbs and the synonyms that are adjectives are printed separately. Example for the word flabbergasted the synonyms are 1) flabbergast , boggle , bowl over which are verbs and 2)dumbfounded , dumfounded , flabbergasted , stupefied ,

Printing the part of speech along with the synonyms of the word

戏子无情 提交于 2021-02-10 03:49:42
问题 I have the following code for taking a word from the input text file and printing the synonyms, definitions and example sentences for the word using WordNet. It separates the synonyms from the synset based on the part-of-speech, i.e., the synonyms that are verbs and the synonyms that are adjectives are printed separately. Example for the word flabbergasted the synonyms are 1) flabbergast , boggle , bowl over which are verbs and 2)dumbfounded , dumfounded , flabbergasted , stupefied ,

Add words to a local copy of WordNet

三世轮回 提交于 2021-02-07 03:26:49
问题 I am using WordNet, accessed through Python's NLTK to compare the synsets of words from social media. Many of those words aren't in the version of WordNet that NLTK connects to. When I say I words I mean domain-specific terms, not abbreviations or emoticons. I've compiled a list of these words and would like to merge that list with WordNet. Searching for prior efforts turns up on attempts to develop methods of automatically updating WordNet. The steps I imagine are: Clone the WordNet db Write

Add words to a local copy of WordNet

六月ゝ 毕业季﹏ 提交于 2021-02-07 03:26:47
问题 I am using WordNet, accessed through Python's NLTK to compare the synsets of words from social media. Many of those words aren't in the version of WordNet that NLTK connects to. When I say I words I mean domain-specific terms, not abbreviations or emoticons. I've compiled a list of these words and would like to merge that list with WordNet. Searching for prior efforts turns up on attempts to develop methods of automatically updating WordNet. The steps I imagine are: Clone the WordNet db Write

Add words to a local copy of WordNet

自古美人都是妖i 提交于 2021-02-07 03:22:21
问题 I am using WordNet, accessed through Python's NLTK to compare the synsets of words from social media. Many of those words aren't in the version of WordNet that NLTK connects to. When I say I words I mean domain-specific terms, not abbreviations or emoticons. I've compiled a list of these words and would like to merge that list with WordNet. Searching for prior efforts turns up on attempts to develop methods of automatically updating WordNet. The steps I imagine are: Clone the WordNet db Write

Get a full list of all hyponyms [duplicate]

放肆的年华 提交于 2021-01-29 03:06:18
问题 This question already has answers here : How to get all the hyponyms of a word/synset in python nltk and wordnet? (2 answers) Closed 3 years ago . Is there any way I can get a full list of hyponyms related to a single word? relative = wordnet.synsets("relative", pos='n')[0] hyponyms = ([lemma.name() for synset in relative.hyponyms() for lemma in synset.lemmas()]) This gives me quite a lot of hyponyms, but many that are in the full hyponyms list on Wordnet's online search are not in my list.

Get a full list of all hyponyms [duplicate]

夙愿已清 提交于 2021-01-29 03:04:32
问题 This question already has answers here : How to get all the hyponyms of a word/synset in python nltk and wordnet? (2 answers) Closed 3 years ago . Is there any way I can get a full list of hyponyms related to a single word? relative = wordnet.synsets("relative", pos='n')[0] hyponyms = ([lemma.name() for synset in relative.hyponyms() for lemma in synset.lemmas()]) This gives me quite a lot of hyponyms, but many that are in the full hyponyms list on Wordnet's online search are not in my list.