Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

main License: MIT PyPI - Version

Word Sense Disambiguation

Installation

The easiest way to install wsd is to use pip:

pip install wsd

You will also need the The JMDict Project dictionary. You can use the following helper to download the file:

python -m wsd download jmdict

Getting Started

Currently, only JMDict model is available. The model has not been trained yet and will currently returns all matching entries found in the The JMDict Project.

The JMDict model can be imported from the wsd.models module:

from wsd.models import JMDict

jmdict = JMDict()

From there, you can use it to search all relevant entries in the dictionary:

for entry in jmdict.search("かんじ"):
    print(entry)
# Output:
# Entry(ent_seq='1210280', ...
# Entry(ent_seq='1211690', ...
# ...

Alternatively, you can use the predict method to get the unique ent_seq of the best entry:

jmdict.search("かんじ")
# Output:
# '1210280'

Adding more data

The training data for JMDict is sourced from the WSD Data Annotation Project.

To contribute more data:

  • Create an account on Linhub
  • Add your Linhub token to the .env file as LINHUB_TOKEN
  • Run the annotation interface with the following command: task annotate

The annotation interface will be available at https://localhost:32123/.

Training a model from scratch

TODO: Add instructions.

Build using Docker

See Using Docker

Attribution and LICENSE

Metadata

Release files for wsd 0.0.1rc0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wsd 0.0.1rc0
File Size Uploaded Provenance Actions
wsd-0.0.1rc0.tar.gz 3.5 kB With provenance Details for wsd-0.0.1rc0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wsd 0.0.1rc0
File Interpreter ABI Platform Actions
wsd-0.0.1rc0-py3-none-any.whl Python 3 none any Details for wsd-0.0.1rc0-py3-none-any.whl

Total release size: 6.9 kB

Release files / wsd-0.0.1rc0.tar.gz

Download URL wsd-0.0.1rc0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0e091adb81647cdc654b7d0de4deac46008f20ce314f4c86edd95877ce7f0cf3
BLAKE2b-256 checksum
How to use checksums
181031053da3d4c5cf8d7ad80be7b0ba1e932600b1f9a3b3acf8d51f066d1fc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2025.

Transparency log

Release files / wsd-0.0.1rc0-py3-none-any.whl

Download URL wsd-0.0.1rc0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4eb2aad6d344cd4380df59fcf2c10e2a434ac8c69655840c1b5ca08c5a8bbea2
BLAKE2b-256 checksum
How to use checksums
b88ba4d96467351027657c0bf05f643ab2b0c126882db65391b0e0d0c0d93ca8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2025.

Transparency log

Security for wsd 0.0.1rc0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wsd-0.0.1rc0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page