Skip to main content

Vectors of Locally Aggregated Concepts (VLAC)

PyPI - Status PyPI - Python PyPI - Python

Purpose

As illustrated in the Figure below, VLAC clusters word embeddings to create k concepts. Due to the high dimensionality of word embeddings (i.e., 300) spherical k-means is used to perform the clustering as applying euclidean distance will result in little difference in the distances between samples. The method works as follows. Let wi be a word embedding of size D assigned to cluster center ck. Then, for each word in a document, VLAC computes the element-wise sum of residuals of each word embedding to its assigned cluster center. This results in k feature vectors, one for each concept, and all of size D. All feature vectors are then concatenated, power normalized, and finally, l2 normalization is applied. For example, if 10 concepts were to be created out of word embeddings of size 300 then the resulting document vector would contain 10 x 300 values.

Usage

Tested in python 3.5.4.

# Train model and transform collection of documents
vlac_model = VLAC(documents=train_docs, model=model, oov=False)
vlac_features, kmeans = vlac_model.fit_transform(num_concepts=30)

# Create features new documents
vlac_model = VLAC(documents=train_docs, model=model, oov=False)
test_features = vlac_model.transform(kmeans=kmeans)

Metadata

Release files for vlac 0.1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vlac 0.1.2.5
File Size Uploaded
vlac-0.1.2.5.tar.gz 3.6 kB Details

Built distribution (wheel)

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

Total release size: 10.8 kB

Release files / vlac-0.1.2.5.tar.gz

Download URL vlac-0.1.2.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5390d4f8b554e10eddb45a41ea774711bf5f6c1c21fb58206571a6a2cf933161
BLAKE2b-256 checksum
How to use checksums
fe94de8061646846aa96929685a0a499c44e4ec400079f9b11088f069e1e3567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

Release files / vlac-0.1.2.5-py3-none-any.whl

Download URL vlac-0.1.2.5-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
949ba13018a9836f7bb73ce43c1bc7f75f2b7c55b3cb1222e4bbf3cf872fc995
BLAKE2b-256 checksum
How to use checksums
68a5f0059f6c080eb18471b0bff13f828406d10b3a07c26bb93b578ee26f7561
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.1.2.5 This release

2 release files

0.1.2

3 release files

0.1.1

1 release file

0.1

2 release files

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