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 Vectors-of-Locally-Aggregate-Concepts 0.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 Vectors-of-Locally-Aggregate-Concepts 0.1
File Size Uploaded
Vectors of Locally Aggregate Concepts-0.1.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Vectors-of-Locally-Aggregate-Concepts 0.1
File Interpreter ABI Platform
Vectors_of_Locally_Aggregate_Concepts-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / Vectors of Locally Aggregate Concepts-0.1.tar.gz

Download URL Vectors of Locally Aggregate Concepts-0.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
11ec6867b432497dbe42e4b2b79cd6e90929deffae34592fbbaffb2a9e6d8d5b
BLAKE2b-256 checksum
How to use checksums
cfe397582cb32c27e8a0563d5cc64b6f77c08322579faea1ef166197e7759279
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / Vectors_of_Locally_Aggregate_Concepts-0.1-py3-none-any.whl

Download URL Vectors_of_Locally_Aggregate_Concepts-0.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d86a9229135a8f3394a284b8acaf1cdc2a60de9262177f118656aa8069a698b
BLAKE2b-256 checksum
How to use checksums
853eb7888528694ddd21dae631fd257b306c64825fc6d8bf9697daa4feec5f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1 This release

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