Skip to main content

Decomposition of word embeddings (word vectors) into qualities ("ness"es) of interest

Project description

nessvec

Installation

$ git clone git@gitlab.com:tangibleai/nessvec
$ cd nessvec
$ pip install -e .

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


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.10.tar.gz (43.5 kB view hashes)

Uploaded Source

Built Distribution

nessvec-0.0.10-py2.py3-none-any.whl (48.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page