Skip to main content

Embedding Adapter 💬 📐

PyPI version

Finetune embedding models in just 4 lines of code.

Quick Start ⚡

Installation

pip install embedding_adapter

Usage

from embedding_adapter import EmbeddingAdapter
adapter = EmbeddingAdapter()
EmbeddingAdapter.fit(query_embeddings, document_embeddings, labels)
EmbeddingAdapter.transform(new_embeddings)

Once you've trained the adapter, you can use patch your pre-trained embedding model.

patch = EmbeddingAdapter.patch()
adapted_embeddings = patch(original_embedding_fn("SAMPLE_TEXT"))

Synthetic Label Generation 🧪

No user feedback to use as labels? 🤔 Create synthetic labels with the LabelGenerator util

from embedding_adapter.utils import LabelGenerator
generator = LabelGenerator()
generator.run()

Note: This requires an OpenAI API key saved as an OPENAI_API_KEY env var.

License 📄

This project is licensed under the MIT License.

Metadata

Release files for embedding-adapter 0.1.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 embedding-adapter 0.1.1
File Size Uploaded
embedding_adapter-0.1.1.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for embedding-adapter 0.1.1
File Interpreter ABI Platform
embedding_adapter-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / embedding_adapter-0.1.1.tar.gz

Download URL embedding_adapter-0.1.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4892d725c65907933d34f73688f91a750b2757b76330cb36202aff513244ed42
BLAKE2b-256 checksum
How to use checksums
306cc25f33d6b8a2493150d50fbf6b7de57b93beac494d680002a00cf5502f91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / embedding_adapter-0.1.1-py3-none-any.whl

Download URL embedding_adapter-0.1.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20b316c460beaed33a6d5e1cca181335b5b58fd91a8c9e314e955fab95ebde31
BLAKE2b-256 checksum
How to use checksums
c5ed444608c631d6ce2ccd45e7f42b227f21dc015723dc958c7159811c2f834b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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