Luc*_*lla 5 nlp artificial-intelligence ontology wordnet
我正在尝试理解WordNet的文件格式,主要文件是WNDB和WNINPUT.正如我在WNDB的理解,也有所谓的文件index.something和data.something,在此something可以noun, adv, vrb, adj.
所以,如果我想了解一下这个词dog的noun,我想看看到index.noun,搜索的单词dog,这给了我行:
dog n 7 5 @ ~ #m #p %p 7 1 02086723 10133978 10042764 09905672 07692347 03907626 02712903
Run Code Online (Sandbox Code Playgroud)
根据WNDB的文件,这一行代表了这些数据:
lemma pos synset_cnt p_cnt [ptr_symbol...] sense_cnt tagsense_cnt synset_offset [synset_offset...]
Run Code Online (Sandbox Code Playgroud)
当lemma这个词,pos是告诉它是一个名词,标识synset_cnt告诉我们有多少同义词集包含这个词,p_cnt告诉我们许多指针这些同义词集我们怎么样,[ptr_symbol]是指针数组,sense_cnt而tagsense_cnt我不明白,并会像解释一样,synset_offset是要查看data.noun文件的一个或多个同义词
好的,所以我知道那些指针指向某些东西,这是他们的描述,如WNINPUT中所写:
@ Hypernym
~ Hyponym
#m Member holonym
#p Part holonym
%p Part meronym
Run Code Online (Sandbox Code Playgroud)
我不知道如何找到这个名词的Hypernym,但让我们继续:
其他重要数据是synset_offsets,它们是:
02086723 10133978 10042764 09905672 07692347 03907626 02712903
Run Code Online (Sandbox Code Playgroud)
让我们来看看第一个02086723,在data.noun:
02086723 05 n 03 dog 0 domestic_dog 0 Canis_familiaris 0 023 @ 02085998 n 0000 @ 01320032 n 0000 #m 02086515 n 0000 #m 08011383 n 0000 ~ 01325095 n 0000 ~ 02087384 n 0000 ~ 02087513 n 0000 ~ 02087924 n 0000 ~ 02088026 n 0000 ~ 02089774 n 0000 ~ 02106058 n 0000 ~ 02112993 n 0000 ~ 02113458 n 0000 ~ 02113610 n 0000 ~ 02113781 n 0000 ~ 02113929 n 0000 ~ 02114152 n 0000 ~ 02114278 n 0000 ~ 02115149 n 0000 ~ 02115478 n 0000 ~ 02115987 n 0000 ~ 02116630 n 0000 %p 02161498 n 0000 | a member of the genus Canis (probably descended from the common wolf) that has been domesticated by man since prehistoric times; occurs in many breeds; "the dog barked all night"
Run Code Online (Sandbox Code Playgroud)
如您所见,我们找到了以第一行开头的行02086723.该行的内容在WNDB中描述为:
synset_offset lex_filenum ss_type w_cnt word lex_id [word lex_id...] p_cnt [ptr...] [frames...] | gloss
Run Code Online (Sandbox Code Playgroud)
我们已经知道了synset_offset,
lex_filenum说哪个词典编纂者文件是我们的话(这是我最不了解的部分),
ss_type是n它告诉我们,这是一个名词,
w_cnt:两位十六进制整数,表示synset中的单词数,在本例中为03,表示我们在此synset中有3个单词:dog 0 domestic_dog 0 Canis_familiaris 0每个单词后跟一个名为的数字:
lex_id:一位十六进制整数,当附加到引理上时,唯一地标识词典编纂者文件中的意义
p_cnt: counts the number of pointers, which in our case is `023`, so we have 23 pointers, wow
Run Code Online (Sandbox Code Playgroud)
之后p_cnt,然后是指针,每个指针的格式如下:
pointer_symbol synset_offset pos source/target
Run Code Online (Sandbox Code Playgroud)
pointer_symbol我所展示的符号(@,〜,...)在哪里,
synset_offset:是对应于的数据文件中目标synset的字节偏移量 pos
source/target:field区分词法和语义指针.它是一个四字节字段,包含两个两位十六进制整数.前两位数字表示当前(源)synset中的字数,后两位数字表示目标synset中的字数.值0000表示pointer_symbol表示当前(源)synset与synset_offset指示的目标synset之间的语义关系.
好的,让我们检查第一个指针:
@ 02085998 n 0000
Run Code Online (Sandbox Code Playgroud)
它与符号的指针@,指示它是一个Hypernym,并指向同义词集wiuth偏移02085998型的n(名词),和source/target是0000
当我在data.noun中搜索时,我得到了
02085998 05 n 02 canine 0 canid 0 011 @ 02077948 n 0000 #m 02085690 n 0000 + 02688440 a 0101 ~ 02086324 n 0000 ~ 02086723 n 0000 ~ 02116752 n 0000 ~ 02117748 n 0000 ~ 02117987 n 0000 ~ 02119787 n 0000 ~ 02120985 n 0000 %p 02442560 n 0000 | any of various fissiped mammals with nonretractile claws and typically long muzzles
Run Code Online (Sandbox Code Playgroud)
这是一个Hypernym的dog.这就是你如何找到同义词之间的关系.我想狗的行中的指针符号只是为了告知我可以为单词dog找到哪种类型的关系?这不是多余的吗?因为这些指针符号已经在synset_offsets我们看到的每一个中.当我们查看每个synset_offset时data.noun,我们可以看到那些指针符号,为什么它们在index.noun文件中是必要的?
另外,看到我根本没有使用词典编纂者文件.我知道data.noun,特别是在现场lex_filenum,我可以知道数据结构的dog位置,但这个结构是什么?正如你所看到的,我可以通过查看index和data文件找到hypernym和许多其他关系,我没有使用任何所谓的词典编纂文件
是的,Wordnet 文档相当难以阅读......
您正在寻找此页面:https://wordnet.princeton.edu/wordnet/man/lexnames.5WN.html
在 WordNet 开发过程中,同义词集根据句法类别和逻辑分组被组织成 45 个词典编纂者文件
这些分组是超下位词分层本体的某种并行集群(平面分组)。
简而言之:
来自文档:
文件格式[ 中的词典编纂者文件WordNet-3.0/dict/]
lexnames 中的每一行包含 3 个制表符分隔的字段,并以换行符结尾。第一个字段是两位十进制整数文件号。(列表中的第一个文件编号为 00 。)第二个字段是由该数字表示的词典编纂器文件的名称,第三个字段是一个整数,指示文件中包含的同义词集的语法类别。这只是程序和脚本的快捷方式,因为语法类别也是词典编纂器文件名称的一部分。
用外行人的解释(我):
这只是您应该如何为文件中的第二列分配值的标准,例如
data.nouns、data.verbs等。传统上,Wordnet 创建者/维护者应该相应地命名他们的文件,但有时,将所有名词放在一起并使用表示同义词集类别的索引会更容易。
类别指南如下:
File Number Name Contents
00 adj.all all adjective clusters
01 adj.pert relational adjectives (pertainyms)
02 adv.all all adverbs
03 noun.Tops unique beginner for nouns
04 noun.act nouns denoting acts or actions
05 noun.animal nouns denoting animals
06 noun.artifact nouns denoting man-made objects
07 noun.attribute nouns denoting attributes of people and objects
08 noun.body nouns denoting body parts
09 noun.cognition nouns denoting cognitive processes and contents
10 noun.communication nouns denoting communicative processes and contents
11 noun.event nouns denoting natural events
12 noun.feeling nouns denoting feelings and emotions
13 noun.food nouns denoting foods and drinks
14 noun.group nouns denoting groupings of people or objects
15 noun.location nouns denoting spatial position
16 noun.motive nouns denoting goals
17 noun.object nouns denoting natural objects (not man-made)
18 noun.person nouns denoting people
19 noun.phenomenon nouns denoting natural phenomena
20 noun.plant nouns denoting plants
21 noun.possession nouns denoting possession and transfer of possession
22 noun.process nouns denoting natural processes
23 noun.quantity nouns denoting quantities and units of measure
24 noun.relation nouns denoting relations between people or things or ideas
25 noun.shape nouns denoting two and three dimensional shapes
26 noun.state nouns denoting stable states of affairs
27 noun.substance nouns denoting substances
28 noun.time nouns denoting time and temporal relations
29 verb.body verbs of grooming, dressing and bodily care
30 verb.change verbs of size, temperature change, intensifying, etc.
31 verb.cognition verbs of thinking, judging, analyzing, doubting
32 verb.communication verbs of telling, asking, ordering, singing
33 verb.competition verbs of fighting, athletic activities
34 verb.consumption verbs of eating and drinking
35 verb.contact verbs of touching, hitting, tying, digging
36 verb.creation verbs of sewing, baking, painting, performing
37 verb.emotion verbs of feeling
38 verb.motion verbs of walking, flying, swimming
39 verb.perception verbs of seeing, hearing, feeling
40 verb.possession verbs of buying, selling, owning
41 verb.social verbs of political and social activities and events
42 verb.stative verbs of being, having, spatial relations
43 verb.weather verbs of raining, snowing, thawing, thundering
44 adj.ppl participial adjectives
Run Code Online (Sandbox Code Playgroud)
例如,在 中WordNet-3.0/dict/data.noun,我们看到以下几行:
00034213 03 n 01 phenomenon 0 008 @ 00029677 n 0000 ~ 11408559 n 0000 ~ 11408733 n 0000 ~ 11408914 n 0000 ~ 11410625 n 0000 ~ 11418138 n 0000 ~ 11418460 n 0000 ~ 11529295 n 0000 | any state or process known through the senses rather than by intuition or reasoning
00034479 04 n 01 thing 0 001 @ 00037396 n 0000 | an action; "how could you do such a thing?"
Run Code Online (Sandbox Code Playgroud)
查看第二列,因为phenomenon该值是03指向 的noun.Tops。
对于,它具有指代 的thing值。04noun.act
恕我直言,根据使用情况,这些分配可能没有用。它们主要在创建词网以及我们如何轻松地将本体层次结构扁平化为简单的平面集群时使用。
| 归档时间: |
|
| 查看次数: |
780 次 |
| 最近记录: |