查看: 1037|回复: 4
打印 上一主题 下一主题

[词典求助] Wordnet MySQL

[复制链接]

该用户从未签到

58

主题

933

回帖

3897

积分

被盗用户

积分
3897

灌水大神章小蜜蜂章笑傲江湖章

跳转到指定楼层
1
发表于 2016-5-13 19:58:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
完整版本

https://sourceforge.net/projects/wnsql/files/


不少在线字典都是用这数据。

谁会用这个数据库?怎样快速查到同义词、反义词等等?

该用户从未签到

58

主题

933

回帖

3897

积分

被盗用户

积分
3897

灌水大神章小蜜蜂章笑傲江湖章

2
 楼主| 发表于 2016-5-14 01:34:12 | 只看该作者
找到一份资料:

https://stackoverflow.com/questi ... net-sql-explanation

The Synset Table The synsets table is one of the most important tables in the database. It is responsible for housing all the definitions within WordNet. Each row in the synset table has a synsetid, a definition, a pos (parts of speech field) and a lexdomainid (which links to the lexdomain table) There are 117373 synsets in the WordNet Database.

The Words Table WordNet also has a “words” table, that only has two fields: a wordid, and a “lemma”. The words table is responsible for housing all the lemmas (base words) within the Wordnet Database. There are 146625 entries in this table

So.. how are these two tables linked? The answer? The sense table!

The Sense Table The sense table is responsible for linking together words (in the words table), with definitions (in the synset table). The entries in the sense table are referred as “word-sense pairs” - because each pairing of a wordid with a synset is one complete meaning of a word - a “sense of the word”.
There are a total of 206,354 word senses in the WordNet database.

The Lexdomains table The Lexdomains table is referenced by the sense table, and is used to define what lexical domain a word-sense pair belongs to. There are 45 lexical domains in the lexdomains table. The lexdomain table therefore, is WordNet’s way of “tagging” a word-sense pair. However, it is quite limited, because a word-sense pair can only belong to ONE lexical domain.

The 45 lexical domains include:

Adjectives: all, pert

Adverbs all

Nouns tops, act, animal, artifact, attribute,body, cognition, communication, event, feeling, food, group, location,motive,object, person, phenomenon, plant, possession, process, quantity,linkdef, shape, state, substance, time,

Verbs body, change, cognition,communication, competition, consumption, contact, creation, emotion, motion, perception, possession, social, stative, weather, ppl

The casedwords table Some words within the words table naturally have the first letter capitalized ie: “A-team”. Since the words table stores all words as lowercase, WordNet uses this table to specify the uppercase version of the word. There are 40313 entries in this table.

There are many other tables in the WordNet DB, once I have them researched, I'll post again.

Finding yer synonyms To answer your question regarding synonyms - You need to do the following.

Let's say you want to find the synonyms for the word "Carry". In order to do so, you would first search the words table for a lemma matching the word "carry". This would yield the wordid 21253. You would then search the senses table, to find all word-sense pairs for the word carry. This yields 41 results - each result lists the wordid 21253, and a senseid (which is the index of the word-sense pair) and a synsetid.

Now, you would then need to query the synset table for each of the synsetid's returned so you can access the associated definition field in the synset table.

Lastly to find the synonyms for each of the synsets listed, you'd simply need to search the sense table for other word-sense pairs that shared the same synset.

Example: One of the 41 word-sense pairs for the word "carry" is listed below: wordsense example If we lookup the definition for this synsetid 202083512, you will find “transmit or serve as the medium for transmission”

To find all the synonyms for this definition, you would then search the sense table for the same synsetid 202083512. This yields synonyms: channel, conduct, convey, impart, and transmit (note: you will need to left join the words table to get the actual lemmas)

该用户从未签到

19

主题

363

回帖

2553

积分

解元

Rank: 5Rank: 5

积分
2553

灌水大神章小蜜蜂章笑傲江湖章

3
发表于 2016-7-5 13:08:57 | 只看该作者
用nltk调用wordnet非常方便。。。。

该用户从未签到

58

主题

933

回帖

3897

积分

被盗用户

积分
3897

灌水大神章小蜜蜂章笑傲江湖章

4
 楼主| 发表于 2016-7-5 18:28:14 | 只看该作者
fnaviwwo1 发表于 2016-7-5 13:08
用nltk调用wordnet非常方便。。。。

嗯 是的 发现到了 谢谢