Decomposition of word embeddings (word vectors) into qualities ("ness"es) of interest
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 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.0.13rc0.tar.gz
(45.8 kB
view details)
Built Distribution
File details
Details for the file nessvec-0.0.13rc0.tar.gz
.
File metadata
- Download URL: nessvec-0.0.13rc0.tar.gz
- Upload date:
- Size: 45.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.23.0 setuptools/59.8.0 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99c8ee414e9f3189e3977ddc9f9d63a4dad6a35d60846e82c6c399f93feb57ad |
|
MD5 | f91e7fcf0c2b690fd8a08d255b7b2914 |
|
BLAKE2b-256 | e841182a0b7add96afdcb2a02615f3e94d24bbd7bcc83e39d37c444b4f8c8003 |
Provenance
File details
Details for the file nessvec-0.0.13rc0-py2.py3-none-any.whl
.
File metadata
- Download URL: nessvec-0.0.13rc0-py2.py3-none-any.whl
- Upload date:
- Size: 50.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.23.0 setuptools/59.8.0 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cddc328fb7aa0a90c64be46b39007c4f907e1cf6cb40950d2bea07d613082dc |
|
MD5 | 04961bbae7c420681620dfad8b17276a |
|
BLAKE2b-256 | 9cdb9140abd7b7158533e2978280704bb9af3ec8418d3bb192bc87196f108d09 |