我正在尝试理解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
根据WNDB文件,这一行代表了这些数据:
lemma pos synset_cnt p_cnt [ptr_symbol...] sense_cnt tagsense_cnt synset_offset [synset_offset...]
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
我不知道如何为这个名词找到一个Hypernym,但让我们继续:
其他重要数据是synset_offset
s,它们是:
02086723 10133978 10042764 09905672 07692347 03907626 02712903
让我们看一下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"
如您所见,我们找到了以02086723
开头的行。该行的内容在WNDB中描述为:
synset_offset lex_filenum ss_type w_cnt word lex_id [word lex_id...] p_cnt [ptr...] [frames...] | gloss
我们已经知道了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
在p_cnt
之后,然后出现指针,每个指针的格式为:
pointer_symbol synset_offset pos source/target
其中pointer_symbol
与我所展示的符号(@,〜,...)有关,
synset_offset
:是与pos
source/target
:字段区分词汇和语义指针。它是一个四字节字段,包含两个两位十六进制整数。前两位数字表示当前(源)synset中的字数,后两位数字表示目标synset中的字数。值0000表示pointer_symbol表示当前(源)synset与synset_offset指示的目标synset之间的语义关系。
好的,让我们检查第一个指针:
@ 02085998 n 0000
这是一个带有符号@
的指针,表示它是Hypernym
,并指向02085998
(名词)类型的同义词集合n
,{{1是} source/target
当我在data.noun中搜索时,我得到了
0000
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
Hypernym
。这就是你如何找到同义词之间的关系。我想狗的行中的指针符号只是为了告知我可以为单词dog找到哪种类型的关系?这不是多余的吗?因为这些指针符号已经在我们看到的每个dog
中。当我们查看synset_offsets
中的每个synset_offset
时,我们可以看到那些指针符号,那么为什么它们在data.noun
文件中是必要的?
另外,请注意我根本没有使用词典编纂者文件。我知道在index.noun
中,特别是在data.noun
字段中,我可以知道lex_filenum
的数据结构位于何处,但 的结构是什么?正如你所看到的,我可以通过查看dog
和index
文件找到hypernym和许多其他关系,我没有使用任何所谓的词典编纂者文件
答案 0 :(得分:2)
此信息中有用的是它们之间存在的关系,以及(有时)信息的类型。每个人都使用Wordnet!有些甚至将其链接到RDF表示法。但... 几年前我使用过Wordnet,因为我想构建一个单词的超文本,它们的超类和子类(es),以及WN中不存在的一些其他类型的关系,我不得不放弃Wordnet及其行话。 我需要一个不太简单的'组织"现实世界"。我提出了自己的想法,混合了维基词典,许多正则表达式,一些YAGO,一些其他本体,让我建立层次结构和其他关系,一些ML。我还研究了Roger Schank的分类,Roget词库,以及识别和分类(类型学)概念的各种尝试,例如Wierzbicka和其他。 如果你想要一些严肃的事情,那就是diy。
答案 1 :(得分:1)
是的,Wordnet文档很难阅读......
您正在寻找此页面:https://wordnet.princeton.edu/wordnet/man/lexnames.5WN.html
在WordNet开发期间,基于句法类别和逻辑分组,同义词被组织成45个词典编纂者文件
这些分组是超级下位分层本体的某种并行聚类(平面聚集)。
简而言之:
来自文档:
文件格式 [WordNet-3.0/dict/
]中的词典编纂者文件
lexnames中的每一行包含3个制表符分隔的字段,并以换行符结尾。第一个字段是两位十进制整数文件号。 (列表中的第一个文件编号为00.)第二个字段是由该编号表示的词典编纂者文件的名称,第三个字段是一个整数,表示文件中包含的同义词集的语法类别。这只是程序和脚本的快捷方式,因为语法类别也是词典编纂者文件名称的一部分。
外行的解释(我):
这只是您应该如何为文件中的第二列分配值的标准,例如
data.nouns
,data.verbs
等传统上,Wordnet创建者/维护者应该相应地命名他们的文件,但有时,将所有名词放在一起并使用索引来表示synset的类别更容易。
类别指南如下:
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
例如,在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?"
查看第2列,phenomenon
的值为03
,指向noun.Tops
。
对于thing
,其值04
引用noun.act
。
恕我直言,根据使用情况,这些作业可能没用。它们主要用于创建wordnet以及我们如何轻松地将本体层次结构扁平化为简单的平面簇。