词典词典的同义词 [英] Lexicon dictionary for synonym words

查看:128
本文介绍了词典词典的同义词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很少有可用于自然语言处理的词典.像是肯定词,否定词字典等

There are few dictionaries available for natural language processing. Like positive, negative words dictionaries etc.

是否有可用的词典包含所有词典单词的同义词列表?

Is there any dictionary available which contains list of synonym for all dictionary words?

喜欢nice

synonyms: enjoyable, pleasant, pleasurable, agreeable, delightful, satisfying, gratifying, acceptable, to one's liking, entertaining, amusing, diverting, marvellous, good; 

推荐答案

尽管WordNet是查找同义词的好资源,但必须注意其局限性,这是NLTK库中python API的示例:

Although WordNet is a good resource to start for finding synonym, one must note its limitations, here's an example with python API in NLTK library:

首先,单词具有多种含义(即感觉):

Firstly, words have multiple meanings (i.e. senses):

>>> from nltk.corpus import wordnet as wn
>>> wn.synsets('nice')
[Synset('nice.n.01'), Synset('nice.a.01'), Synset('decent.s.01'), Synset('nice.s.03'), Synset('dainty.s.04'), Synset('courteous.s.01')]

要访问单词的正确含义,您需要在给定上下文的情况下知道单词的正确含义.

And to access the correct sense of a word, you will need to know the correct sense of a word given a context.

>>> wn.synset('nice.a.01').definition()
u'pleasant or pleasing or agreeable in nature or appearance'

您可以尝试使用Word Sense消歧软件,但它们并不完美(请参阅

You can try Word Sense Disambiguation software but they are not perfect (see Anyone know of some good Word Sense Disambiguation software?). Even if you know the sense of the word, the entries of wordnet are limited. You cannot expect much:

>>> wn.synset('nice.a.01').lemma_names()
[u'nice']
>>> wn.synset('nice.a.01').similar_tos()
[Synset('good.s.06'), Synset('pleasant.s.02')]
>>> [i.lemma_names() for i in wn.synset('nice.a.01').similar_tos()]
[[u'good'], [u'pleasant']]

这篇关于词典词典的同义词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆