Wordnet interface library
Project description
a Python library for wordnets
Available Wordnets
| Documentation
| FAQ
| Migrating from NLTK
| Citation
Wn is a Python library for exploring information in wordnets.
Installation
Install it from PyPI using pip:
pip install wn
or uv:
uv add wn
[!IMPORTANT] Existing users of Wn may encounter an error about an incompatible database schema. The remedy is to rebuild the database. There is a new function to help with this:
>>> wn.reset_database(rebuild=True) # re-add any indexed lexiconsor
>>> wn.reset_database() # initialize without re-adding; start from scratch
Getting Started
First, download some data:
python -m wn download oewn:2025+ # the Open English WordNet 2025+
Now start exploring:
>>> import wn
>>> en = wn.Wordnet('oewn:2025+') # Create Wordnet object to query
>>> ss = en.synsets('win', pos='v')[0] # Get the first synset for 'win'
>>> ss.definition() # Get the synset's definition
'be the winner in a contest or competition; be victorious'
Features
- Multilingual by design; first-class support for wordnets in any language
- Interlingual queries via the Collaborative Interlingual Index
- Six similarity metrics
- Functions for exploring taxonomies
- Support for lemmatization (Morphy for English is built-in) and unicode normalization
- Full support of the WN-LMF 1.4 format, including word pronunciations and lexicon extensions
- SQL-based backend offers very fast startup and improved performance on many kinds of queries
Available Wordnets
Any WN-LMF-formatted wordnet can be added to Wn's database from a local file or remote URL, but Wn also maintains an index (see wn/index.toml) of available projects, similar to a package manager for software, to aid in the discovery and downloading of new wordnets. The projects in this index are listed below.
English Wordnets
There are several English wordnets available. In general it is recommended to use the latest Open English Wordnet, but if you have stricter compatibility needs for, e.g., experiment replicability, you may try the OMW English Wordnet based on WordNet 3.0 (compatible with the Princeton WordNet 3.0 and with the NLTK), or OpenWordnet-EN (for use with the Portuguese wordnet OpenWordnet-PT).
| Name | Specifier | # Synsets | Notes |
|---|---|---|---|
| Open English WordNet | oewn:2025+oewn:2025oewn:2024oewn:2023oewn:2022oewn:2021ewn:2020ewn:2019 |
120564 107519 120630 120135 120068 120039 120053 117791 |
← Recommended |
| OMW English Wordnet based on WordNet 1.5 | omw-en15:2.0 |
91591 | |
| OMW English Wordnet based on WordNet 1.6 | omw-en16:2.0 |
99642 | |
| OMW English Wordnet based on WordNet 1.7 | omw-en17:2.0 |
109377 | |
| OMW English Wordnet based on WordNet 1.7.1 | omw-en171:2.0 |
111223 | |
| OMW English Wordnet based on WordNet 2.0 | omw-en20:2.0 |
115424 | |
| OMW English Wordnet based on WordNet 2.1 | omw-en21:2.0 |
117597 | |
| OMW English Wordnet based on WordNet 3.0 | omw-en:2.0omw-en:1.4 |
117659 117659 |
Included with omw:2.0Included with omw:1.4 |
| OMW English Wordnet based on WordNet 3.1 | omw-en31:2.0omw-en31:1.4 |
117791 117791 |
|
| OpenWordnet-EN | own-en:1.0.0 |
117659 | Included with own:1.0.0 |
Other Wordnets and Collections
These are standalone non-English wordnets and collections. The wordnets of each collection are listed further down.
| Name | Specifier | # Synsets | Language |
|---|---|---|---|
| Open Multilingual Wordnet | omw:1.4 |
n/a | multiple [mul] |
| Open German WordNet | odenet:1.4odenet:1.3 |
36268 36159 |
German [de] |
| Open Wordnets for Portuguese and English | own:1.0.0 |
n/a | multiple [mul] |
| KurdNet | kurdnet:1.0 |
2144 | Kurdish [ckb] |
Open Multilingual Wordnet (OMW) Collection
The Open Multilingual Wordnet collection (omw:1.4) installs the
following lexicons (from
here) which can
also be downloaded and installed independently:
| Name | Specifier | # Synsets | Language |
|---|---|---|---|
| Albanet | omw-sq:2.0omw-sq:1.4 |
4679 4675 |
Albanian [sq] |
| Arabic WordNet (AWN v2) | omw-arb:2.0omw-arb:1.4 |
9916 9916 |
Arabic [arb] |
| BulTreeBank Wordnet (BTB-WN) | omw-bg:2.0omw-bg:1.4 |
4959 4959 |
Bulgarian [bg] |
| Chinese Open Wordnet | omw-cmn:2.0omw-cmn:1.4 |
42300 42312 |
Mandarin (Simplified) [cmn-Hans] |
| Croatian Wordnet | omw-hr:2.0omw-hr:1.4 |
23115 23120 |
Croatian [hr] |
| DanNet | omw-da:2.0omw-da:1.4 |
4476 4476 |
Danish [da] |
| FinnWordNet | omw-fi:2.0omw-fi:1.4 |
116763 116763 |
Finnish [fi] |
| Greek Wordnet | omw-el:2.0omw-el:1.4 |
18113 18049 |
Greek [el] |
| Hebrew Wordnet | omw-he:2.0omw-he:1.4 |
5448 5448 |
Hebrew [he] |
| IceWordNet | omw-is:2.0omw-is:1.4 |
4951 4951 |
Icelandic [is] |
| Italian Wordnet | omw-iwn:2.0omw-iwn:1.4 |
15563 15563 |
Italian [it] |
| Japanese Wordnet | omw-ja:2.0omw-ja:1.4 |
117659 57184 |
Japanese [ja] |
| Lithuanian WordNet | omw-lt:2.0omw-lt:1.4 |
9462 9462 |
Lithuanian [lt] |
| Multilingual Central Repository | omw-ca:2.0omw-ca:1.4 |
60765 45826 |
Catalan [ca] |
| Multilingual Central Repository | omw-eu:2.0omw-eu:1.4 |
29420 29413 |
Basque [eu] |
| Multilingual Central Repository | omw-gl:2.0omw-gl:1.4 |
34776 19312 |
Galician [gl] |
| Multilingual Central Repository | omw-es:2.0omw-es:1.4 |
78948 38512 |
Spanish [es] |
| MultiWordNet | omw-it:2.0omw-it:1.4 |
35001 35001 |
Italian [it] |
| Norwegian Wordnet | omw-nb:2.0omw-nb:1.4 |
4455 4455 |
Norwegian (Bokmål) [nb] |
| Norwegian Wordnet | omw-nn:2.0omw-nn:1.4 |
3671 3671 |
Norwegian (Nynorsk) [nn] |
| OMW English Wordnet based on WordNet 3.0 | omw-en:2.0omw-en:1.4 |
117659 117659 |
English [en] |
| Open Dutch WordNet | omw-nl:2.0omw-nl:1.4 |
30177 30177 |
Dutch [nl] |
| OpenWN-PT | omw-pt:2.0omw-pt:1.4 |
43895 43895 |
Portuguese [pt] |
| plWordNet | omw-pl:2.0omw-pl:1.4 |
33826 33826 |
Polish [pl] |
| Romanian Wordnet | omw-ro:2.0omw-ro:1.4 |
58754 56026 |
Romanian [ro] |
| Slovak WordNet | omw-sk:2.0omw-sk:1.4 |
18507 18507 |
Slovak [sk] |
| sloWNet | omw-sl:2.0omw-sl:1.4 |
42590 42583 |
Slovenian [sl] |
| Swedish (SALDO) | omw-sv:2.0omw-sv:1.4 |
6796 6796 |
Swedish [sv] |
| Thai Wordnet | omw-th:2.0omw-th:1.4 |
73350 73350 |
Thai [th] |
| WOLF (Wordnet Libre du Français) | omw-fr:2.0omw-fr:1.4 |
59091 59091 |
French [fr] |
| Wordnet Bahasa | omw-id:2.0omw-id:1.4 |
46774 38085 |
Indonesian [id] |
| Wordnet Bahasa | omw-zsm:2.0omw-zsm:1.4 |
36911 36911 |
Malaysian [zsm] |
Open Wordnet (OWN) Collection
The Open Wordnets for Portuguese and English collection (own:1.0.0)
installs the following lexicons (from
here)
which can also be downloaded and installed independently:
| Name | Specifier | # Synsets | Language |
|---|---|---|---|
| OpenWordnet-PT | own-pt:1.0.0 |
52670 | Portuguese [pt] |
| OpenWordnet-EN | own-en:1.0.0 |
117659 | English [en] |
Collaborative Interlingual Index
While not a wordnet, the Collaborative Interlingual Index (CILI) represents the interlingual backbone of many wordnets. Wn, including interlingual queries, will function without CILI loaded, but adding it to the database makes available the full list of concepts, their status (active, deprecated, etc.), and their definitions.
| Name | Specifier | # Concepts |
|---|---|---|
| Collaborative Interlingual Index | cili:1.0 |
117659 |
Changes to the Index
ewn → oewn
The 2021 version of the Open English WordNet (oewn:2021) has
changed its lexicon ID from ewn to oewn, so the index is updated
accordingly. The previous versions are still available as ewn:2019
and ewn:2020.
pwn → omw-en, omw-en31
The wordnet formerly called the Princeton WordNet (pwn:3.0,
pwn:3.1) is now called the OMW English Wordnet based on WordNet
3.0 (omw-en) and the OMW English Wordnet based on WordNet 3.1
(omw-en31). This is more accurate, as it is a OMW-produced
derivative of the original WordNet data, and it also avoids license or
trademark issues.
*wn → omw-* for OMW wordnets
All OMW wordnets have changed their ID scheme from ...wn to omw-.. and the version no longer
includes +omw (e.g., bulwn:1.3+omw is now omw-bg:1.4).
Citation
Michael Wayne Goodman and Francis Bond. 2021. Intrinsically Interlingual: The Wn Python Library for Wordnets In Proceedings of the 11th Global Wordnet Conference, pages 100–107, University of South Africa (UNISA). Global Wordnet Association.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wn-1.0.0.tar.gz.
File metadata
- Download URL: wn-1.0.0.tar.gz
- Upload date:
- Size: 160.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
216c0e635f9df5b7dc8c8fc360a649477f7d299adcd06578ebda851c1b2e6a59
|
|
| MD5 |
198827eb58a30b1818a6371b23ea14ec
|
|
| BLAKE2b-256 |
d929c225f35bf237e6bb21a7af47b570f5710a8d803c31d307728ebb70faf6f7
|
Provenance
The following attestation bundles were made for wn-1.0.0.tar.gz:
Publisher:
publish.yml on goodmami/wn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wn-1.0.0.tar.gz -
Subject digest:
216c0e635f9df5b7dc8c8fc360a649477f7d299adcd06578ebda851c1b2e6a59 - Sigstore transparency entry: 889731737
- Sigstore integration time:
-
Permalink:
goodmami/wn@ddf012db65a9954ec1756293d241278a3f278ac6 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/goodmami
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ddf012db65a9954ec1756293d241278a3f278ac6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wn-1.0.0-py3-none-any.whl.
File metadata
- Download URL: wn-1.0.0-py3-none-any.whl
- Upload date:
- Size: 94.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d721afc53c650460cd5c8bdb02c249e45311e4726376d947acc45a86b916019
|
|
| MD5 |
8636a7dab58523049c4632dc7a3f5511
|
|
| BLAKE2b-256 |
52194c223c0f3a8f0eb41992cb6a66208a42c4e8dffc5c91b48e7d532d542aec
|
Provenance
The following attestation bundles were made for wn-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on goodmami/wn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wn-1.0.0-py3-none-any.whl -
Subject digest:
5d721afc53c650460cd5c8bdb02c249e45311e4726376d947acc45a86b916019 - Sigstore transparency entry: 889731800
- Sigstore integration time:
-
Permalink:
goodmami/wn@ddf012db65a9954ec1756293d241278a3f278ac6 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/goodmami
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ddf012db65a9954ec1756293d241278a3f278ac6 -
Trigger Event:
push
-
Statement type: