Word embeddings with meaningful dimensions for better explainability.
Project description
nessvec
Install from Source (recommended)
Clone the repository with all the source code and data:
$ git clone git@gitlab.com:tangibleai/nessvec
$ cd nessvec
Create a conda environment and install the dependencies:
$ conda create -n nessvec 'python==3.9.7'
$ conda env update -n nessvec -f scripts/environment.yml
$ pip install -e .
Install from PyPi (only tested on Linux)
$ pip install nessvec
Get Started
>>> from nessvec.util import load_glove
>>> w2v = load_glove()
>>> seattle = w2v['seattle']
>>> seattle
array([-2.7303e-01, 8.5872e-01, 1.3546e-01, 8.3849e-01, ...
>>> portland = w2v['portland']
>>> portland
array([-0.78611 , 1.2758 , -0.0036066, 0.54873 , -0.31474 ,...
>>> len(portland)
50
>>> from numpy.linalg import norm
>>> norm(portland)
4.417...
>>> portland.std()
0.615...
>>> cosine_similarity(seattle, portland)
0.84...
>>> cosine_similarity(portland, seattle)
0.84...
>>> from nessvec.util import cosine_similarity
>>> cosine_similarity(w2v['los_angeles'], w2v['mumbai'])
.5
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
nessvec-0.2.0.tar.gz
(169.8 kB
view details)
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
nessvec-0.2.0-py3-none-any.whl
(196.5 kB
view details)
File details
Details for the file nessvec-0.2.0.tar.gz.
File metadata
- Download URL: nessvec-0.2.0.tar.gz
- Upload date:
- Size: 169.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
347fcf0fe8457614095969f29a00085b8f4b1e49e6e92274c8608845e4144d81
|
|
| MD5 |
3177fce8e291f09604ca78c9ff0655b2
|
|
| BLAKE2b-256 |
68148bbb7f0f94e7e024d0951d47b7fdba979e0f4f7725928e3d33ef292d7124
|
File details
Details for the file nessvec-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nessvec-0.2.0-py3-none-any.whl
- Upload date:
- Size: 196.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ce6a1e47024eeba3e3091e8a6d9f03ab75a1977e6b3b6b032cd08fa6ce2b3bf
|
|
| MD5 |
89174a05e90730365bbd40f42a34caea
|
|
| BLAKE2b-256 |
5bf45b0463bced1d205244963f9f3c163250a56bb279f0d14eecc29332627005
|