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

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

Built with:

Python Plotly matplotlib scikit-learn Gensim NumPy

Last Version Updates

Fixed

  • Added validation on zip file download to ensure the file is not corrupted before extraction.
  • Moved internal files related functions outside of the EmbeddingLoader class to improve modularity and maintainability. Put the new file in helpers/ together with other helper functions.
  • Removed internal deprecated glove2word2vec conversion, as GloVe files are now directly loaded in word2vec format.
  • Fixed error in FastText loading when using binary files.
  • Substituted list comprehension in load_from_file with gensim .vectors to improve performance.
  • Removed broken GoogleNews pretrained embeddings from the package, as it is no longer available for download. Added a warning to inform users about this change.

Added

  • Tests for loading module, including tests for GloVe, Word2Vec, and FastText loading.

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

Built distribution (wheel)

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

Total release size: 3.4 MB

Release files / wordviz-0.6.1.tar.gz

Download URL wordviz-0.6.1.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
6d18e4fc374ae445f9f1e75f51c3e75e61602c9cf683200ed80ad7926cd62e05
BLAKE2b-256 checksum
How to use checksums
c00e322b4264afa1f619f4246911382c9043f0c240fcf112171870eaa42f41b5
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.6.1-py3-none-any.whl

Download URL wordviz-0.6.1-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05c061f7819ab4cfd0944aa6e65337c79a9bb46df3e5d969828c3c78e5f3c636
BLAKE2b-256 checksum
How to use checksums
c62f596fded0035ed8756f9ba219a20f9c48f9754d3483da14fd4e897c21f309
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.6.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