wordnet

Get antonyms for a word in java - Wordnet JWI

↘锁芯ラ 提交于 2021-01-29 02:34:53
问题 I am interested in finding antonyms for a word using wordnet in Java. I am currently using this method to find antonyms but I have yet to find any words which have antonyms. Are antonyms not common in Wordnet? Or is this implementation flawed? public List<String> getAntonyms(String baseWord) { List<String> synonymList = new ArrayList<>(); IIndexWord[] baseWordPOS = getAllPOSForBaseWord(baseWord); for (IIndexWord iIndexWord : baseWordPOS) { if (iIndexWord == null) { continue; } for (IWordID

How to find the lemmas and frequency count of each word in list of sentences in a list?

醉酒当歌 提交于 2021-01-28 12:43:52
问题 I want to find out the lemmas using WordNet Lemmatizer and also I need to compute each word frequency. I am getting the following error. The trace is as follows: TypeError: unhashable type: 'list' Note: The corpus is available on the nltk package itself. What I have tried so far is as follows: import nltk, re import string from collections import Counter from string import punctuation from nltk.tokenize import TweetTokenizer, sent_tokenize, word_tokenize from nltk.corpus import gutenberg,

How to find the lemmas and frequency count of each word in list of sentences in a list?

孤街浪徒 提交于 2021-01-28 12:42:00
问题 I want to find out the lemmas using WordNet Lemmatizer and also I need to compute each word frequency. I am getting the following error. The trace is as follows: TypeError: unhashable type: 'list' Note: The corpus is available on the nltk package itself. What I have tried so far is as follows: import nltk, re import string from collections import Counter from string import punctuation from nltk.tokenize import TweetTokenizer, sent_tokenize, word_tokenize from nltk.corpus import gutenberg,

WordNet - What does n and the number represent?

半世苍凉 提交于 2020-12-29 13:14:21
问题 My question is related to WordNet Interface. >>> wn.synsets('cat') [Synset('cat.n.01'), Synset('guy.n.01'), Synset('cat.n.03'), Synset('kat.n.01'), Synset('cat-o'-nine-tails.n.01'), Synset('caterpillar.n.02'), Synset('big_cat.n.01'), Synset('computerized_tomography.n.01'), Synset('cat.v.01'), Synset('vomit.v.01')] >>> I could not find the answer to what is the purpose of n and the following number in cat.n.01 or caterpillar.n.02 . 回答1: Per the NLTK docs, a <lemma>.<pos>.<number> Synset string

WordNet - What does n and the number represent?

送分小仙女□ 提交于 2020-12-29 13:13:32
问题 My question is related to WordNet Interface. >>> wn.synsets('cat') [Synset('cat.n.01'), Synset('guy.n.01'), Synset('cat.n.03'), Synset('kat.n.01'), Synset('cat-o'-nine-tails.n.01'), Synset('caterpillar.n.02'), Synset('big_cat.n.01'), Synset('computerized_tomography.n.01'), Synset('cat.v.01'), Synset('vomit.v.01')] >>> I could not find the answer to what is the purpose of n and the following number in cat.n.01 or caterpillar.n.02 . 回答1: Per the NLTK docs, a <lemma>.<pos>.<number> Synset string

WordNet - What does n and the number represent?

给你一囗甜甜゛ 提交于 2020-12-29 13:09:34
问题 My question is related to WordNet Interface. >>> wn.synsets('cat') [Synset('cat.n.01'), Synset('guy.n.01'), Synset('cat.n.03'), Synset('kat.n.01'), Synset('cat-o'-nine-tails.n.01'), Synset('caterpillar.n.02'), Synset('big_cat.n.01'), Synset('computerized_tomography.n.01'), Synset('cat.v.01'), Synset('vomit.v.01')] >>> I could not find the answer to what is the purpose of n and the following number in cat.n.01 or caterpillar.n.02 . 回答1: Per the NLTK docs, a <lemma>.<pos>.<number> Synset string