Skip to main content

PyPI version Python License: MIT

logo

WordViz is a Python visualization library designed for exploring and visualizing word embeddings. Built on top of popular libraries such as matplotlib, plotly, and gensim, WordViz provides intuitive tools for analyzing embeddings through clustering, similarity exploration, and dimensionality reduction, all wrapped in interactive and customizable plots. With WordViz, users can gain insights into the structure of their word embeddings, making it a valuable tool for researchers and practitioners in natural language processing.

This project was created as part of my Bachelor's Degree thesis in Statistics and Information Management with title (translated): "Word Embeddings in Practice: Designing a Library for Visualization and Operations"

version 0.4.1

Documentation: https://wordviz.readthedocs.io/

Built with:

Python Plotly matplotlib scikit-learn Gensim NumPy

Last Version Updates

Updated

  • Edit embedding_distance (old word_distance) to use compute_distances function for flexibility in distance calculations.
  • Little optimizations in n_most_similar function to avoid redundant computations and improve performance.

Added

  • Added tests for similarity module.

Deprecated

  • From /similarity:
    • word_distance will change name to embedding_distance (FutureWarning added)

See more about previous changes in CHANGELOG.md

Main Features

  • Load and explore pretrained embeddings (e.g., GloVe, FastText)
  • Select from a variety of available embeddings
  • Visualize embeddings in 2D or 3D with flexible dimensionality reduction options
  • Identify and plot the most similar words to a given token
  • Visualize clusters of related words
  • Interactive plots powered by plotly
  • Support for many light and dark themes

Installation

Install the latest version from PyPI:

pip install wordviz

Notes: Python version compatibility

The only versions that support Python 3.13 are the latest releases starting from version 0.3.5.

If you still have problems with the installation, it is recommended to use Python 3.12.

uv init --python 3.12

This warning will be removed in the next versions of wordviz, as Python 3.13 will be fully supported.

Usage

You can load and manage embeddings though the EmbeddingLoader class, and then visualize them with the Visualizer (or Visualizer3D) class.

from wordviz import EmbeddingLoader, Visualizer

loader = EmbeddingLoader()
loader.load_from_file('path/to/your/embedding/file', 'word2vec')

vis = Visualizer(loader)
vis.plot_embeddings()

You can explore all functionalities through the example notebook provided in the docs/ folder:

👉 View example notebook

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.

Contacts

Elena Zen - My Portfolio Website - info.elenazen@gmail.com

Metadata

Release files for wordviz 0.4.1

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

Source distribution (sdist)

Source distribution for wordviz 0.4.1
File Size Uploaded Provenance Actions
wordviz-0.4.1.tar.gz 3.4 MB Without provenance Details for wordviz-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 3.4 MB

Release files / wordviz-0.4.1.tar.gz

Download URL wordviz-0.4.1.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
2920ec49bb7025488a2808e1e0eb48c9137dfbff40abf20a2f2e23502ca46a84
BLAKE2b-256 checksum
How to use checksums
f43b36660997d1017a4dbc5bbe97d96abcccba2c794e650c0c5e91a67eb37bd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.10 Windows/11

Release files / wordviz-0.4.1-py3-none-any.whl

Download URL wordviz-0.4.1-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e39f769aa78a4a0fe848743ab4c9533e14bb19c617df6b26563748a2772f01b
BLAKE2b-256 checksum
How to use checksums
fe54c59f2f0b6b06ca69f4391dc623602c8f3254c9a1389cd4b51739fa600695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.10 Windows/11

Security for wordviz 0.4.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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