Skip to main content

A lightweight open-source package to fine-tune embedding models.

Project description

Embedding Adapter 💬 📐

Finetune embedding models in just 4 lines of code.

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 label 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.

Installation 🔧

pip install embedding_adapter

License 📄

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

embedding_adapter-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

embedding_adapter-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file embedding_adapter-0.1.0.tar.gz.

File metadata

  • Download URL: embedding_adapter-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for embedding_adapter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a9a00fd5521f107f02330373d47da1b997cc27eccb7617d35c623b28d6d2fce
MD5 d580fb83396f626e411840ef7f502068
BLAKE2b-256 fc29652938dfcb07e696c11ddf75279a716d8d97d8c16bc37ced18278fe1a5a6

See more details on using hashes here.

File details

Details for the file embedding_adapter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for embedding_adapter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fd7513bb7af764cf09451936b9645b946c4d89d808154fd0cd1d618f41a9b0e
MD5 5d10b739418259a7781c971e44b5e0e0
BLAKE2b-256 183a85ed20df4779194ba839ff77528b0405c2bae48fe83849e0b2c99914d70e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page