Isaacus embedders for Haystack 2.x
Project description
Overview
Isaacus is a foundational legal AI research company building AI models, apps, and tools for the legal tech ecosystem.
Isaacus' offering includes Kanon 2 Embedder, the world's best legal embedding model (as measured on the Massive Legal Embedding Benchmark), as well as legal zero-shot classification and legal extractive question answering models.
Isaacus offers first-class support for Haystack through the isaacus-haystack integration package.
Installation
pip install isaacus-haystack
Components
IsaacusTextEmbedder– embeds query text into a vector.IsaacusDocumentEmbedder– embeds HaystackDocuments and writes todocument.embedding.
Quick Example
from haystack import Pipeline, Document
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
from haystack.utils import Secret
from haystack_integrations.components.embedders.isaacus import (IsaacusTextEmbedder, IsaacusDocumentEmbedder)
store = InMemoryDocumentStore(embedding_similarity_function="dot_product")
embedder = IsaacusDocumentEmbedder(
api_key=Secret.from_env_var("ISAACUS_API_KEY"),
model="kanon-2-embedder", # choose any supported Isaacus embedding model
# dimensions=1792, # optionally set to match your vector DB
)
raw_docs = [Document(content="Isaacus releases Kanon 2 Embedder: the world's best legal embedding model."),
Document(content="Isaacus also offers legal zero-shot classification and extractive question answering models.")]
store.write_documents(embedder.run(raw_docs)["documents"])
pipe = Pipeline()
pipe.add_component("q", IsaacusTextEmbedder(
api_key=Secret.from_env_var("ISAACUS_API_KEY"),
model="kanon-2-embedder",
))
pipe.add_component("ret", InMemoryEmbeddingRetriever(document_store=store))
pipe.connect("q.embedding", "ret.query_embedding")
print(pipe.run({"q": {"text": "Who built Kanon 2 Embedder?"}}))
Docs
- Isaacus Embeddings API: https://docs.isaacus.com/capabilities/embedding
- Haystack: https://haystack.deepset.ai/
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file isaacus_haystack-0.1.0.tar.gz.
File metadata
- Download URL: isaacus_haystack-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddcd781659e0875ffd19cf1374a74c779fa963266497bd0634948fbcdba5fa79
|
|
| MD5 |
a715ec569527612a3f8115aee0c7ff86
|
|
| BLAKE2b-256 |
1447a39287b21c63b3246cdb22629714b95f935312d5246574cef8716a1d74c2
|
File details
Details for the file isaacus_haystack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: isaacus_haystack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85ba1897f0421794c41b169fa2298f0fb76bbdf4109d3e1f5d0bf0cd55e7149d
|
|
| MD5 |
ff3eabe7cde9db2aecfc362f4e5d79d2
|
|
| BLAKE2b-256 |
84f1c56c8ae49188f56d2f07687512cdde57197918d7e93068cd701cdeed9ccb
|