Skip to main content

# bigcode-embeddings

NOTE: data must be generated with [bigcode-ast-tools][2] before being able to use this tool

bigcode-embeddings allows to generate and visualize embeddings for AST nodes.

## Install

This project should be used with Python 3.

To install the package either run

` pip install bigcode-embeddings `

or clone the repository and run

` cd bigcode-embeddings pip install -r requirements.txt python setup.py install `

NOTE: tensorflow needs to be installed separately.

## Usage

### Training embeddings

Training data can be generated using [bigcode-ast-tools][2]

Given a data.txt.gz generated from a vocabulary of size 30000, 100D embeddings can be trained using

` ./bin/bigcode-embeddings train -o embeddings/ --vocab-size 30000 --emb-size 100 --l2-value 0.05 --learning-rate 0.01 data.txt.gz `

[Tensorboard][2] can be used to visualize the progress

` tensorboard --logdir embeddings/ `

After the first epoch, embeddings visualization becomes available from Tensorboard. The vocabulary TSV file generated by bigcode-ast-tools can be loaded to have labels on the embeddings.

### Visualizing the embeddings

Trained embeddings can be visualized using the visualize subcommand If the generated vocabulary file is vocab.tsv, the above embeddings can be visualized with the following command

` ./bin/data-explorer visualize clusters -m embeddings/embeddings.bin-STEP -l vocab.tsv `

where STEP should be the largest value found in the embeddings/ directory.

The -i flag can be passed to generate an interactive plot.

[1]: ../bigcode-ast-tools/README.md [2]: https://github.com/tensorflow/tensorboard

Metadata

Release files for bigcode-embeddings 0.1.2

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

Source distribution (sdist)

Source distribution for bigcode-embeddings 0.1.2
File Size Uploaded Provenance
bigcode-embeddings-0.1.2.tar.gz 7.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bigcode-embeddings 0.1.2
File Interpreter ABI Platform
bigcode_embeddings-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 kB

Release files / bigcode-embeddings-0.1.2.tar.gz

Download URL bigcode-embeddings-0.1.2.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
889e98d29ccbe4459337a8dcb9830918aa1bc1bfbe17d4e2ded5f48e5e0b0530
BLAKE2b-256 checksum
How to use checksums
f3060e4ac9ab46ed577f3f5499fb4264b3e73bf6d59fe7dd343baba0215aa03f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / bigcode_embeddings-0.1.2-py3-none-any.whl

Download URL bigcode_embeddings-0.1.2-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46eb6fa689cb5f98f70bbab06f21440e743735d2d3eef4c02521c4670473fa22
BLAKE2b-256 checksum
How to use checksums
17fcbd4bee5397bfb57eb847b82edf7691ae5af49deba15c2d94ff64203c3f57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for bigcode-embeddings 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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