Skip to main content

Swarmauri Logo

PyPI - Downloads PyPI - Python Version PyPI - License PyPI - Version


TF-IDF Vector Store

A vector store implementation using TF-IDF (Term Frequency-Inverse Document Frequency) for document embedding and retrieval. This package provides efficient document storage and similarity-based retrieval using the TF-IDF algorithm.

Installation

pip install swarmauri_vectorstore_tfidf

Usage

Here's a basic example of how to use the TF-IDF Vector Store:

from swarmauri.vector_stores.TfidfVectorStore import TfidfVectorStore
from swarmauri.documents.Document import Document

# Initialize the vector store
vector_store = TfidfVectorStore()

# Add documents
documents = [
    Document(content="Machine learning basics"),
    Document(content="Python programming guide"),
    Document(content="Data science tutorial")
]
vector_store.add_documents(documents)

# Retrieve similar documents
results = vector_store.retrieve(query="python tutorial", top_k=2)

Want to help?

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.

Metadata

Release files for swarmauri_vectorstore_tfidf 0.6.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 swarmauri_vectorstore_tfidf 0.6.1
File Size Uploaded
swarmauri_vectorstore_tfidf-0.6.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_vectorstore_tfidf 0.6.1
File Interpreter ABI Platform
swarmauri_vectorstore_tfidf-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / swarmauri_vectorstore_tfidf-0.6.1.tar.gz

Download URL swarmauri_vectorstore_tfidf-0.6.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9326b1bce02896c424454aa36e1c7754542a10580cafe40e7d2f15dbc6dc1214
BLAKE2b-256 checksum
How to use checksums
b26dcfcc00ed5c6f4927578ba5babbf764c03c95cd4f5dd1eb1a711a5bd703ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.9 Linux/6.8.0-1021-azure

Release files / swarmauri_vectorstore_tfidf-0.6.1-py3-none-any.whl

Download URL swarmauri_vectorstore_tfidf-0.6.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
432fa97048b991dbe809ddbc1465bf50a23703df78b3c8c0fe58897712dca6b9
BLAKE2b-256 checksum
How to use checksums
f4ac283495a3fdd40d995b55dd1c86e78f9e56c078221d56c3fac58a0ad2ec49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.9 Linux/6.8.0-1021-azure
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