Yet Another Sentence Embedding Library
The goal of this library is to make it easy to transform lists of sentences or sets of sentences into a matrix of embeddings (eg. one per sentence). This can be done either at the sentence/document level or by grouping sentence embeddings into grouped embeddings.
Such matrices of documents can easily be queried using kd-trees (see notebook in examples) for the most similar document in training data to a queried sentence. It can also be used to cluster document groups together solely by the text in the campaign.
The results can be tested for quality on a handcrafted evaluation dataset by checking how well the sentence embeddings cluster around the natural clusters of the existing ad campaigns.
(Gensim) Weighed Sentence Embeddings with Gensim model
import gensim.downloader as model_api
import yase
# Load pretrained gensim model
model = model_api.load("glove-wiki-gigaword-300")
# Tokenize list of sentences
tokens = yase.tokenize(data, lower=True, split=True)
# get word weights for higher quality embeddings
weights = yase.getWordWeights(data, "tf-idf")
# create sentence embeddings from tokens
my_embeddings = embedding.sentenceEmbedding(tokens, model, weights)
Running unit tests
python -m unittest discover tests
Metadata
Release files for YASE 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| YASE-1.0.1.tar.gz | 23.2 kB | Without provenance | Details for YASE-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| YASE-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for YASE-1.0.1-py3-none-any.whl |
Total release size: 45.1 kB
Release files / YASE-1.0.1.tar.gz
| Download URL | YASE-1.0.1.tar.gz |
|---|---|
| Size | 23.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
884e99689a161ed5a35b13a4b5935d29f83a10838d34bfd3a1197b9aa78f19a4
|
|
BLAKE2b-256 checksum How to use checksums |
0bed870c43059abeac4128fe58e54e5a69d2255ebdef3c03f2b05eaba7da2c67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / YASE-1.0.1-py3-none-any.whl
| Download URL | YASE-1.0.1-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb804e2dd00c2f544a9dfff452c53e7b1e32afbb31715a631ae6bbb68c45b53e
|
|
BLAKE2b-256 checksum How to use checksums |
9b5ad0e88feb1c72d3064777fa52af2f2cb55ad76622c726d331906f6a15dd9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Security for YASE 1.0.1
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.