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.5.0

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

Built with:

Python Plotly matplotlib scikit-learn Gensim NumPy

Last Version Updates

Updated

  • Adapted map_colors function to handle both class labels and cluster labels, with appropriate legend labeling. Changed color format to hex for better compatibility with Plotly.
  • Moved optional classes parameter to the end of the load_contextual method signature for better clarity and usability.

Added

  • Added getter and setter for the classes property to use it also with static embeddings.
  • Added tests for map colors function.
  • All scatter plots now support coloring by class labels if available, with a new color_by_class parameter in the plotting functions.

Fixed

  • Added default n_neighbors parameter to UMAP dimensionality reduction to avoid errors when the number of samples is less than 15.
  • Fixed plot_similarity 3d function, which displayed incorrect target word position.

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.5.0

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.5.0
File Size Uploaded Provenance Actions
wordviz-0.5.0.tar.gz 3.4 MB Without provenance Details for wordviz-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.4 MB

Release files / wordviz-0.5.0.tar.gz

Download URL wordviz-0.5.0.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
c5afe46440504263493a38ba39e1ecd024fcc95259f34dd4d65fe4d2cff81661
BLAKE2b-256 checksum
How to use checksums
ccd4a0b2cf422269789ae9fca14361ce184a1bfaf5e2d94c2ae027580ce32f87
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.5.0-py3-none-any.whl

Download URL wordviz-0.5.0-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47a29cf3a4d0b0802888d840e67b0df5c51f5d0f4c116f7b7e01bee3a2cb03ee
BLAKE2b-256 checksum
How to use checksums
de34e00088759e71a7129c3f8a784c3fb0f007d9fd3bc209c98e50ec63d047e1
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.5.0

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