WordNet是之前Princeton大学的一个项目,对英语单词之间相关性进行分析,总结出了一套单词相关度体系。
WordNet类似一个同义词辞典(thesaurus),对公众是免费开发的。事实上,它也提供了一个类似辞典的程序共大家伙使用。
这个辞典可以在https://wordnet.princeton.edu/download下载。
好多发行版也可以直接通过包管理下载,比如在Ubuntu上:sudo apt install wordnet
:
wn
可以在命令行查词wnb
可以打开图形界面(基于tk)查词man 5 wndb
可以查看其文件格式
但问题是,WordNet在3.1版本之后就停更了。
别急,后继者还是有的。https://en-word.net/
就是WordNet的一个后继。
这个网站的代码竟然是基于rust,源码在:https://github.com/jmccrae/wordnet-angular
https://en-word.net/
背后的概念叫做GWN,也就是Global WordNet的缩写,Github页面:https://github.com/globalwordnet/english-wordnet。也就是说作者想从英文扩展到其他语言。
为此,还专门定义了相应的LMF(LexicalMarkupFramework)XML数据格式,查看https://github.com/globalwordnet/schemas。同等的还有JSON LD和RDF格式。
不过从https://github.com/globalwordnet/english-wordnet/issues/31看,源码采用的是yaml格式,发布的时候才采用这个LMF XML格式。 WordNet的元数据采用https://dublincore.org/描述。
有一些相关的工具可以用来处理此LMF XML格式:
- https://github.com/rse/wordnet-lmf
- 基于nodejs的命令行,可以解析LMF XML
- https://github.com/goodmami/wn
- 基于python和sqlite的工具,可以把解析LMF XML,并把结果放到SQLite数据库中处理
- 文档页:https://wn.readthedocs.io/en/latest/index.html
- Pypi包:https://pypi.org/project/wn/
WN的文档The Structure of a Wordnet很形象解释了WordNet的构成:
- 一个wordnet是一个按照概念来组织词汇的体系
- 构成语言的word按照形态(form)和含义(meaning)进行区分
- 同一个概念的一组词形成一个synset(合意)
- word通过sense连结到synset
- 不同的synset之间可以两两关联(粗粒度关联),关联可以分门别类
- 不同的sense之间可以两两关联(细粒度关联),关联可以分门别类
- 甚至sense和synset之间也可以有关联(跨粒度关联)
其他
- Open Multilingual WordNet:https://github.com/omwn/omw-data
- 英文以外的WordNet
- libxml2: https://github.com/GNOME/libxml2
- 提供了一些处理XML的工具,比如xmllint
- https://github.com/Planeshifter/node-wordnet-magic
- https://wordnet.princeton.edu/related-projects
(本篇完)
2022-10-28 更新
wngloss(7WN)
- Description
- manpage的section 7代表是Miscellaneous Information about WordNet
- System Description
- WordNet体系由lexicographer files构成,以及相关的代码(grind)可以这些files转为数据库
- lexicographer files将nouns, verbs, adjectives以及adverbs以synonym群组的方式组织起来
- grind代码并不对外公开
- Database Organization
- 这些群组叫做synsets,每个synset由一组同义词/短语构成
- synset之间可以相互关联,由指针表示
- 一个词/短语可以出现在多个synset中
- 指针可以描述两种关联种类:lexical和semantic,前者和词语的形态相关,后者和词语的含义相关
- 关联类别包括但不限于:hypernymy/hyponymy (superordinate/subordinate), antonymy, entailment, and meronymy/holonymy.
- Nouns和verbs按照 hypernymy/hyponymy的层级关联组织,并辅以其他类别的指针
- Adjective按照head synset和satellite synset组织成簇,每簇以antonymous pair/triplet划分。
- Pertainym类别的adjectives不遵循上述结构。Pertainyms没有antonyms。 Pertainym指向nouns。
- Participial adjectives指向verbs。
- Adverbs从adjectives跳脱出来。Adverbs有指针指向adjective
- Glossary of Terms
- ……
wninput(5WN)
- Name
- noun.suffix , verb.suffix , adj.suffix , adv.suffix这些都是lexicographer file的名字,给grind做输入
- Description
- WordNet的源文件是lexicographers写就的。
- 基本的构建块包括word form(orthography)以及word meaning(synonym sets)
- synset是一组在特定情境下可以交换使用的词语
- word form之间的关联叫做lexical relation
- synset之间的关联叫做semantic relation
- 措辞类别包括:noun verb adj adverb,每个lexicographer file存储一个措辞类别,并存储synset之间的关联
- 一个词语可以出现在多个synset中,也可以出现于多个part of speech
- Adjectives会被按按蔟组织,簇首为一个synset,簇丛为若干synsets。
- Lexicographer File Names
- lexicographer files的命名方式为pos.suffic,其中pos为noun,verb,adj或adv;suffix用于对其进一步分组,比如noun.animal以及noun.plant。
- Pointers
- synset之间的semantic pointer对synset里面的所有词语都有效
- 词语形态之间的lexial pointer只针对synset中的个别词语
- lexical relation一般包括:Antonym, Pertainym, Participle, Also See, Derivationally Related
- 剩余的pointer类型用于semantic pointer
- 用于noun的pointer类型
- Antonym, Hypernym, Instance Hypernym, Hyponym , Instance Hyponym , Member holonym, Substance holonym , Part holonym, Member meronym , Substance meronym , Part meronym , Attribute , Derivationally related form , Domain of synset - TOPIC , Member of this domain - TOPIC , Domain of synset - REGION , Member of this domain - REGION Domain of synset - USAGE , Member of this domain - USAGE
- 用于verb的pointer类型
- Antonym ,Hypernym ,Entailment ,Cause ,Also see , Verb Group , Derivationally related form, Domain of synset - TOPIC, Domain of synset - REGION, Domain of synset - USAGE
- 用于形容词的pointer类型
- Antonym , Similar to , Participle of verb ,Pertainym (pertains to noun) , Attribute , Also see , Domain of synset - TOPIC , Domain of synset - REGION, Domain of synset - USAGE
- 用于副词的pointer类型
- Antonym ,Derived from adjective,Domain of synset - TOPIC,Domain of synset - REGION ,Domain of synset - USAGE
- pointer之间的镜像关系
- Antonym - Antonym
- Hyponym - Hypernym
- (instance) Hypernym - (instance) Hyponym
- Holonym - Meronym
- Meronym - Holonym
- Similar to - Similar to
- Attribute - Attribute
- Verb Group - Verb Group
- Derivationally Related - Derivationally Related
- Domain of synset - Member of Doman
- Verb Frames
- 略
- Lexicographer File Format
- 略
- Pointer Syntax
- 略
- Examples
- 略
(更新完)